I'd like to have the header of each group show in 11 points, but I would like the title of the group that appears at the top of the xamOutlookbar to appear in 16 points. I'm having trouble figuring out how to do this. Any ideas?
The element at the top of the outlookbar is the SelectedGroupHeader so you could put a style that targets that into the Resources of the xamOutlookBar. Note: if you put it up higher and set the Theme it won't end up affecting it because the Theme will provide a local style for that element.
Hi All,
How can I change the Text of the header in xamOutlookbar ? What property I have to call to Add custom text?
Regards, Lello
Hello,
Which header you want to change - SelectedGroupHeader(whici is next to minimize\maximize xamOutlookBar button) or all groups headers?
Regards,
Anastas
Hello Anastas,
Thanks for the reply.I would like to change the text in SelectedGroupHeader with a text other than the button text.
Hello Anastas,,
I modified your project to manage external events (see attachment)
((TextBlock)this.Resources["OutLookTitle"]).Text = "Some Text";
Looks like we replied almost at the same time :)
Hello Lello,
See at the attached project. All I do is to copy and paste the defaultStyle for SelectedGroupHeader in XAML(this style is available in DefaultStyles folder in install folder), and one converter which adds the "Selected Group:" string.
If you want to display some text once(regardless of groups selection) you can change this row in style
Content="{Binding Path=(igOutlookBar:XamOutlookBar.OutlookBar).SelectedGroup.Header, RelativeSource={RelativeSource Self},Converter={StaticResource converter}}"
with something other like:
Content="Some Text"
Dear Anastas,I found this solution ...Is there a simpler solution than this?
-----------------------------------------------------------------------------------
<Style TargetType="{x:Type OutlookBar:SelectedGroupHeader}">
<Style.Resources>
<RotateTransform x:Key="MinimizeOnRightTransform" Angle="180"/>
</Style.Resources>
<Setter Property="Background" Value="{DynamicResource {x:Static OutlookBar:OutlookBarBrushKeys.CurrentGroupHeaderCenterFillKey}}"/>
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static OutlookBar:OutlookBarBrushKeys.GroupInnerBorderFillKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static OutlookBar:OutlookBarBrushKeys.HeaderDarkTextFillKey}}"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type OutlookBar:SelectedGroupHeader}">
<Grid Margin="0,0,0,1">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentPresenter
x:Name="ContentPresenterHeader"
Grid.Column="0"
Content= "This is My custom Text bla bla bla..."
Margin="7,7,8,3"/>
<ToggleButton
x:Name="MinimizeButton"
Visibility="Visible"
Grid.Column="1"
IsChecked="{Binding Path=(OutlookBar:XamOutlookBar.OutlookBar).IsMinimized, RelativeSource={RelativeSource Self}}"
IsEnabled="{Binding Path=(OutlookBar:XamOutlookBar.OutlookBar).AllowMinimized, RelativeSource={RelativeSource Self}}"
Style="{DynamicResource {x:Static OutlookBar:XamOutlookBar.MinimizeToggleButtonStyleKey}}"
Margin="0,4,0,3"/>
</Grid>
</Border>
<Border x:Name="innerBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,0,0"/>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding Path=OutlookBar.IsMinimized, RelativeSource={RelativeSource TemplatedParent}}" Value="True">
<Setter TargetName="ContentPresenterHeader" Property="Visibility" Value="Collapsed"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=OutlookBar.VerticalSplitterLocation, RelativeSource={RelativeSource TemplatedParent}}" Value="Left">
<Setter TargetName="MinimizeButton" Property="LayoutTransform" Value="{StaticResource MinimizeOnRightTransform}"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>