I have a situation here.
I have one ListView with check boxes. check boxes are defined as data template. I have another stack panel and it contains one button. My requirement is that, initially when the window loads, none of the check boxes are selected and button should be disabled. when user clicks on any one of the checkbox, button should be enabled. when user unchecks all the checkboxes,button should be disabled.
i am using MVVM pattern with cattle framework.With the help of events,i could able achieve this functionality.
but my quesion is, can we able to handle this scenario in xaml itself. May be using triggers or converters?
I am new to WPF and no deep knowledge about WPF. Any help is appreciated.
I have tried using triggers. but since the checkboxes are inside ListView and defined as data template i am not able to access element name of checkbox from button style.
Rough outline is as follows
<ListView x:Name="MylistView" ItemsSource="{Binding Collection}" Height="250"
SelectionMode="Single"
BorderBrush="Transparent">
<ListView.ItemTemplate>
<DataTemplate>
<CheckBox x:Name="Checkbox" Content="{Binding Description}" IsChecked="{Binding IsEnable, Mode=TwoWay}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<StackPanel Orientation="Horizontal">
<Button x:Name="Save" Content="{l:Language Key=SAVE}" Width="50" Height="25" Margin="10"
Command="{Binding Updpate, Source={StaticResource proxy}}">
<Button.Style>
//How do i refer checkbox from this level. I get only "Mylistview" control at this level
</Button.Style>
</Button>
</StackPanel>
thanks in advance