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,Don't forget to mark the post as answer, this will help next users to find the right answer.About Add or Remove Buttons:You don't need to show the add/remove menu item because you use some different logic to show/hide groups. But the user still can use the Navigation Pane Options dialog, so you must remove it also.You will need to re-template the OutlookBar to remove these menu items from UI.It is possible to remove these two menu items from control code (this code is not in your application). You can create a control that inherits from XamWebOutlookBar and you will remove the unwanted menu items with a few lines of code.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!!,
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