Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1540
How to Bind the IsChecked property to objects IsSelected property
posted

 

 

 

 

 

 

 

 

 

 

 

 

 

I have a simple <ig:HierarchicalDataTemplate> that works. Shown below:

<UserControl.Resources>

 

 

 

<ig:HierarchicalDataTemplate ItemsSource="{Binding Sites}" x:Key="CompanyTemplate">
    <DataTemplate>
       
<TextBlock Text="{Binding company_name}" />
   
</DataTemplate>
   
<ig:HierarchicalDataTemplate.ItemTemplate>
       
<DataTemplate>
           
<TextBlock Text="{Binding site_name}" />
       
</DataTemplate>
   
</ig:HierarchicalDataTemplate.ItemTemplate>
</ig:HierarchicalDataTemplate>
</UserControl.Resources>

CheckBoxes are enabled.  Now I need to Bind the IsChecked property to an IsSelected property of each item.  Is that possible in XAML?  Is it possible in code?  If so, how?  I would prefer to do it in XAML.