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
40
XamOutlookBar custom template creation
posted

Hi. I'm trying to create a custom template for XamOutlookBar control.

Here is my xaml for custom template:

 

        <igWPF:XamOutlookBar.Template>

             <ControlTemplate TargetType="{x:Type igWPF:XamOutlookBar}">

                 <Grid>

                     <Grid.RowDefinitions>

                         <RowDefinition />

                         <RowDefinition />

                         <RowDefinition />

                         <RowDefinition />

                         <RowDefinition />

                     </Grid.RowDefinitions>

                     <igWPF:SelectedGroupHeader Grid.Row="0" x:Name="PART_SelectedGroupHeader" />

                     <igWPF:SelectedGroupContent Grid.Row="1" x:Name="PART_SelectedGroupContent" />

                     <igWPF:GroupAreaSplitter Grid.Row="2" x:Name="PART_Splitter" />

                     <igWPF:GroupsPresenter Grid.Row="3" x:Name="PART_NavigationArea" />

                     <igWPF:GroupOverflowArea Grid.Row="4" x:Name="PART_OverflowArea" />

                 </Grid>

             </ControlTemplate>

         </igWPF:XamOutlookBar.Template>

 

SelectedGroupHeader and SelectedGroupContent part work fine - they contain expected info from OutlookBarGroup. However, GroupsPresenter and GroupOverflowArea are not shown. WPF Inspector shows, that GroupsPresenter is empty. I also tried to use PART_NavigationArea partname, but that didn't help.

Could you help me, please? Thanks in advance.

Parents
  • 5600
    Verified Answer
    Offline posted

    Hello Mychail,

    In order to display the groups in xamOutlookBar you should set the GroupsPresenter's ItemsSource. Add this code for GroupsPresneter in the OutlookBar's template:

    ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=NavigationAreaGroups}"

    You can check the default XamOutlookBar's style at OutlookBarBase.xaml file, which is located at the [InstallFolder]\WPF\DefaultStyles\OutlookBar folder.

    Hope this helps you.

    Best regards,

    Anastas

Reply Children