Hi all, I want to know how to bind the properties IsEnabled and Visibilty from the xaml in the outlookbar, for each element like :
<igOB:XamWebOutlookBar.GroupHeaderTemplate> <DataTemplate> <TextBlock Text="{Binding Header}" /> </DataTemplate> </igOB:XamWebOutlookBar.GroupHeaderTemplate>
or something like : <Setter Property="IsEnabled"> and there put some template for each group ...
Any help will be appreciated...
Paul.
Hi Paul,Look at this small sample.DataItem class represents some external data. I added the Enabled and Visible properties to keep everything simple, but you may need to use converters.C#public class DataItem{ public bool Enabled { get; set; } public Visibility Visible { get; set; } public string Name { get; set; }}private void xob_Loaded(object sender, RoutedEventArgs e){ ObservableCollection<DataItem> c = new ObservableCollection<DataItem>(); c.Add(new DataItem { Name = "A", Enabled = true, Visible = Visibility.Visible }); c.Add(new DataItem { Name = "B", Enabled = false, Visible = Visibility.Visible }); c.Add(new DataItem { Name = "C", Enabled = true, Visible = Visibility.Collapsed }); c.Add(new DataItem { Name = "D", Enabled = false, Visible = Visibility.Collapsed }); xob.GroupsSource = c;}XAML <igOB:XamWebOutlookBar x:Name="xob" Grid.Column="1" Loaded="xob_Loaded"> <igOB:XamWebOutlookBar.GroupHeaderTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Name}"/> </StackPanel> </DataTemplate> </igOB:XamWebOutlookBar.GroupHeaderTemplate> <igOB:XamWebOutlookBar.GroupContentTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Name}"/> <TextBlock Text="{Binding Enabled}"/> <TextBlock Text="{Binding Visible}"/> </StackPanel> </DataTemplate> </igOB:XamWebOutlookBar.GroupContentTemplate> <igOB:XamWebOutlookBar.DefaultGroupsContainer> <DataTemplate> <igOB:OutlookBarGroup IsEnabled="{Binding Enabled}" Visibility="{Binding Visible}"/> </DataTemplate> </igOB:XamWebOutlookBar.DefaultGroupsContainer></igOB:XamWebOutlookBar>Regards,Marin
Hi Marin,
that worked awesome! , but I have another issue, in the "Add / Remove " panel at the bottom the groups are still "Visible" so i want to know if there is a way to put it out of there without code behind :), only to make it "Collapsed".
Thanks!!,