|
I still cant get this to work. I have tried every combination from posts about this subject but I am still running into the issue of it thinking I am selecting the entire row instead of firing off the button command.
PLEASE HELP!
<UserControl.Resources>
<ObjectDataProvider x:Key="Viewmodel" ObjectType="{x:Type ViewModels:DocManagementViewModel}"/>
<Utilities:ArithmeticConverter x:Key="arithConverter" />
<Utilities:BooleanToVisibilityConverter x:Key="MyBooleanToVisibilityConverter" />
</UserControl.Resources>
<Grid Margin="0,32.667,3,20" Panel.ZIndex="2296" x:Name="LayoutGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto" MinWidth="18.542"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition MinHeight="300"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Margin="0,-20,7,0" >
<Grid.RowDefinitions></Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<dg:DataGrid
Visibility="{Binding HideElement, Converter={StaticResource MyBooleanToVisibilityConverter}}"
Grid.Column="1" Cursor="Hand"
Margin="15.5,-19,17,12"
Grid.Row="0"
AlternationCount="2"
Panel.ZIndex="1000"
Style="{DynamicResource DataGridStyle}"
AutoGenerateColumns="False"
SelectedItem="{Binding SelectedPatientDocInfoItem}"
ItemsSource="{Binding PatientDocInfoCollection}"
x:Name="DocumentSearchResultsDG"
BorderThickness="0">
<dg:DataGrid.Resources>
<Style TargetType="{x:Type dg:DataGridRowHeader}">
<Setter Property="Background" Value="Transparent"/>
</Style>
</dg:DataGrid.Resources>
<dg:DataGrid.Columns>
<dg:DataGridTextColumn Binding="{Binding DocumentName}" IsReadOnly="True" Width=".5*" Header="Doc Name" />
<dg:DataGridTextColumn Binding="{Binding Category}" IsReadOnly="True" Width=".5*" Header="Category" />
<dg:DataGridTextColumn Binding="{Binding CreatedDate, StringFormat=\{0:MM/dd/yyyy\}}" IsReadOnly="True" Width=".5*" Header="Scanned Date" />
<dg:DataGridTextColumn Binding="{Binding CreatedByUserId}" IsReadOnly="True" Width=".5*" Header="Scanned By" />
<dg:DataGridTextColumn Binding="{Binding Comment}" IsReadOnly="True" Width=".5*" Header="Comment" />
<dg:DataGridTemplateColumn Header="Delete" Width="100" >
<dg:DataGridTemplateColumn.CellTemplate >
<DataTemplate >
<Button HorizontalAlignment="Center" Command="{Binding Path=DataContext.DeleteItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Margin="0,1,0,0" Height="15" Width="15" Template="{DynamicResource RedGlassButton}" Style="{StaticResource CloseBtnStyle}" >
</Button>
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
</dg:DataGrid.Columns>
</dg:DataGrid>
</Grid>
</Grid>
Here is my ViewModel
<br />
public ICommand DeleteItem { get; private set; }<br />
public DocManagementViewModel()<br />
{ <br />
DeleteItem = new DelegateCommand<object>(obj => DeleteDocumentGroup());<br />
}<br />
<br />
private void DeleteDocumentGroup()<br />
{<br />
PatientDocumentRepository.Delete(PatientDocument);<br />
}<br />
|
|
|
|
|
Hi All,
I'm just implementing my first Silverlight WCF service in an ASP.NET web site hosting a Silverlight client and have run into a problem.
The service and client are working together fine, I've just done a little "Hello World" test on the two communicating. Now I'm ready to move onto the implementation and the guts of the service.
In a normal WCF setup for me I would create a separate class library project containing the service contract and any required domain objects. Then I can link to that from the service and the client and get all the same objects used at both ends of the pipe.
However, I'm running into an error:
Could not load file or assembly 'System.ServiceModel, Version=2.0.5.0
I'm assuming this is because the service and client are using two different versions of .NET. So the Core library is getting compiled in one environment and then told to run in two, fail!
Is there a work around for this?
Cheers,
|
|
|
|
|
Either use .NET 4 which allows this (in a somewhat limited way), or you need to create a separate Silverlight DLL and link your classes in as external items."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi Pete,
I tried this both ways, making a normal class library and a silverlight class library and each time either the client or the service complained about the runtime version.
|
|
|
|
|
Hi .......
I want to display popup window ............
when user click on asp.net button(register clientside
JavaScript function) in aspx page .....
then popupwindow should display with given text,
text is parameter ......................
that pass asp.net button to client JavaScript function ...
waiting your replyDre@m is not th@t wh@t u see in sleep.Dre@m is the thing which does not allow u to sleep
|
|
|
|
|
Sorry. I dont think I can understand you question completely.
For popups, see here[^]. Searching on the internet should give you plenty more popup options.
If you want to pass something between Javascript and Silverlight - use the html bridge as described here[^].Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hi,
I wanted to create wpf controls dynamically based on a business model.
for that i tried to use DataTemplates for creation of controls based on values from an array. And then bind the array to ItemControls Itemsource.
I used this example for testing.. This is what i did..
< Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="dialog" xmlns:sys="clr-namespace:System;assembly=mscorlib"
Width="393.412" Height="333.4">
< Window.Resources>
< ResourceDictionary
Source="ResourceDictionary\ControlCreatorDataTemplate.xaml"/>
</ Window.Resources>
< StackPanel>
< ItemsControl ItemsSource="{Binding Source={StaticResource data}}" Visibility="Visible" />
</ StackPanel>
</ Window>
resource dictionary
< ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
< x:ArrayExtension Type="{x:Type sys:Object}" x:Key="data">
< sys:String>String</ sys:String>
< sys:Boolean>True</ sys:Boolean>
< sys:Boolean>False</ sys:Boolean>
< sys:Double>10.0</ sys:Double>
</ x:ArrayExtension >
< DataTemplate DataType="{x:Type sys:Boolean}" >
< CheckBox Content="CheckBox" IsChecked="{Binding Mode=OneWay}" />
</ DataTemplate >
< DataTemplate DataType="{x:Type sys:String}" >
< TextBox Text="{Binding Mode=OneWay}" />
</DataTemplate >
< DataTemplate DataType="{x:Type sys:Double}" >
< TextBox Text="{Binding Mode=OneWay}" />
</ DataTemplate >
</ ResourceDictionary >
Problem is i am able to view the checkbox and text in the designer window in VS08
When i run the window -> the controls are not visible...
Any help is appreciated
-JasperJ.p.Jasper
|
|
|
|
|
Hi,
I have a class which derives from TextBox called EntryTextBox and provides a PreviewKeyDown event handler (although for the purposes of this question, it's not relevant).
I have produced a ControlTemplate within a style as follows:
<Style TargetType="{x:Type my:EntryTextBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type my:EntryTextBox}">
<DockPanel>
<Border BorderThickness="1" HorizontalAlignment="Stretch" BorderBrush="DarkGray" Background="White" Width="100">
<DockPanel>
<Button DockPanel.Dock="Right" Visibility="{Binding Path=KeyboardPopup,Converter={StaticResource VisibilityConverter},RelativeSource={RelativeSource TemplatedParent}}">
<ContentControl Width="15" Height="10" Template="{StaticResource KeyboardIconContent}"/>
</Button>
<ScrollViewer Margin="0" Background="Transparent" HorizontalAlignment="Stretch" x:Name="PART_ContentHost"/>
</DockPanel>
</Border>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Which as you can see displays a Button as part of the TextEntry box depending on the value of KeyboardPopup. This works fine, but I want to be able to act on the button's click handler from within my EntryTextBox class but don't know how to do it.
I've read in "Pro WPF in C# 2008, Matthew MacDonald, P872" that you need to "give your elements recognisable names and attach event handlers to them programatically in the control constructor" but I am unsure of the syntax I should use in the class constructor of EntryTextBox.
Can anyone help me?
Cheers
Richard
|
|
|
|
|
1. Name the button something line "PART_Button" .
2. Then override OnApplyTemplate() .
3. In OnApplyTemplate use GetTemplateChild("PART_Button") .
That will get you a reference to the button to add your event handler. Of course you will want to check the returned object to make sure is is not null. Someone may change the template for your control.
|
|
|
|
|
Thank-you rhuiden, you are a star! That's exactly what I was after.
Richard
|
|
|
|
|
|
Rants belong in the lounge or the soapbox, not here. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
fjparisIII wrote: I was hoping to elicit thoughtful responses.
Then ask a question, don't rant. The forums are for questions. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
I think one type is programming is no more, or less, difficult than another. It's all about understanding the tools, techniques, environment, etc. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
I think, as originally stated, you should move this to the lounge. It would be a better place to have such a discussion since, once again, the forums are for questions and don't seem to have any, only opinions and a need to discuss your difficulty in keeping up with the body of knowledge in this career field.
fjparisIII wrote: I've been a professional programmer undoubtedly for more years than you've been alive
I wouldn't be so arrogant and make such assumptions. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi.
I'm building a SL aplication and at the begining it worked fine. Bute now i change all the basic control properties(like Color, MArgins,Size, etc..) from the MyPage.xaml to App.xaml where i defined the Styles declaration. With this change my application does not run anymore. When i try to run the application, it stopes and the Visual Web Developer 2008 ExpressEdition goes down and dissapear.
Any ideas to solve that?
(Excuse my english but i don't speak better than this )
Thanks
Regards Jonatan_556
|
|
|
|
|
Your xaml has some sort of a problem.
If you can paste some of your xaml code here, someone may be able to help you out.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hi
Before i send you my xaml code i decided to saw it again carefully and slowly and i found the problem and fixed it.
Thanks any way
Regards Jonatan
|
|
|
|
|
jonatan_556 wrote: i found the problem and fixed it
Ok. That's great.
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hi,
I would like to implement a pop-up on screen keyboard which can be used to interact with a textbox through a touchscreen. I've found a load of WPF examples online but they all cause Security Exceptions when used in Partial Trust (as they use keyboard events).
Can anyone point me at a resource which will provide this functionality in a partial-trust XBAP?
Regards
Richard
|
|
|
|
|
I use animations all the time in WPF, but they seem to work completely different in Silverlight, principally because the elements being animated don't have a BeginAnimation method. So, given the element being animated, how can I find the Storyboard defining the animation?
|
|
|
|
|
fjparisIII wrote: Storyboard defining the animation
Not quite sure I understand your question.
What you need to do is create a Storyboard - see here[^].Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|