Problems with APP.XAML moved to .NET Core 5 - resourcedictionary

I have a WPF application that is working just fine as written for .NET Framework targeting 4.7.2
There are several styles in the App.xaml file.
<BitmapImage x:Key="BitImageAdd" UriSource="Images/iconAdd.png" ></BitmapImage>
<BitmapImage x:Key="BitImageDelete" UriSource="Images/iconDelete.png" ></BitmapImage>
<BitmapImage x:Key="BitImageArrowUp" UriSource="Images/iconArrowUp.png" ></BitmapImage>
<BitmapImage x:Key="BitImageArrowDown" UriSource="Images/iconArrowDown.png" ></BitmapImage>
<Style TargetType="Button" x:Key="btnAdd" x:Shared="False">
<Setter Property="Content">
<Setter.Value>
<Image Source="{StaticResource BitImageAdd}"></Image>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Button" x:Key="btnDelete" x:Shared="False">
<Setter Property="Content">
<Setter.Value>
<Image Source="{StaticResource BitImageDelete}"></Image>
</Setter.Value>
</Setter>
</Style>
When I use this in the new application written in a new project for .NET CORE 5.0 I get an underline below 'BitmapImage' that says the System.Windows.Media.Imaging.BitmapImage must have IsFrozen set to false to modify. I can't set that property. If I use that for Content on a button it shows "System.Windows.Style"
Another part of the App.xaml file creates a text style that's used later in data grid.
<Style TargetType="{x:Type DataGridRow}" x:Key="BatchStateRowStyle">
<Style.Resources>
<LinearGradientBrush x:Key="Hold" StartPoint="0,0" EndPoint="0,1" >
<GradientStop Offset="0.35" Color="#FF4F4F4F" />
<GradientStop Offset="0.5" Color="Purple" />
<GradientStop Offset="0.65" Color="#FF4F4F4F" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="Sent" StartPoint="0,0" EndPoint="0,1" >
<GradientStop Offset="0.35" Color="#FF4F4F4F" />
<GradientStop Offset="0.5" Color="Purple" />
<GradientStop Offset="0.65" Color="#FF4F4F4F" />
</LinearGradientBrush>
... more styles
</Style.Resources>
<Style.Triggers>
<DataTrigger Binding="{Binding State}" Value="3">
<Setter Property="Background" Value="{StaticResource Hold}" />
</DataTrigger>
<DataTrigger Binding="{Binding State}" Value="4">
<Setter Property="Background" Value="{StaticResource Sent}" />
</DataTrigger>
... more triggers
<Style.Triggers>
In this case the underlined word is the Style at the top which says that StaticResourceExtension is not valid for Setter.Value. So it appears that it's the Setter.Value on Background that's complaining about the StaticResource of the styles defined just above.
I tried moving the BitmapImage items into their own ResourceDictionary and merging it into App.XAML but that didn't help.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Bitmap Images-->
<BitmapImage x:Key="BitImageAdd" UriSource="Images/iconAdd.png" ></BitmapImage>
<BitmapImage x:Key="BitImageDelete" UriSource="Images/iconDelete.png" ></BitmapImage>
<BitmapImage x:Key="BitImageArrowUp" UriSource="Images/iconArrowUp.png" ></BitmapImage>
<BitmapImage x:Key="BitImageArrowDown" UriSource="Images/iconArrowDown.png" ></BitmapImage>
</ResourceDictionary>
App.XAML
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ImageDictionary.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
and with that the app crashed telling me the Resources property was already set on App.
I've been looking at different options for how to use these but nothing that really explains how to make these work for .Net Core 5

Related

Wpf tree-view two-way binding not working when using custom style for TreeViewItem

I tried to set up a custom styled treeview that does "just in time" loading by two-way binding the expanded property to a similar property in the view-model. The style and functionality aspects work fine on their own, but not when put together.
When I do it like this the functionality is there:
<TreeView Name="treeView" ItemsSource="{Binding}" Grid.Column="0">
<TreeView.Resources>
<ResourceDictionary Source="GroupedTreeViewItemStyle.xaml"/>
</TreeView.Resources>
<TreeView.ItemContainerStyle>
<Style TargetType="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding Expanded, Mode=TwoWay}"/>
</Style>
</TreeView.ItemContainerStyle>
</TreeView>
But when I add the BasedOn to use my custom style it does no longer load any nodes.
I use my style by replacing the above style definition with the following:
<Style TargetType="TreeViewItem" BasedOn="{StaticResource GroupedTreeViewItemStyle}">
And here is my custom style based on this tutorial:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:this="*******namespace omitted*******">
<!-- This Style redefines the ControlTemplate used by TreeViewItems and
also provides a different itemspanel for their child items. -->
<Style TargetType="TreeViewItem" x:Key="GroupedTreeViewItemStyle">
<Style.Resources>
<LinearGradientBrush x:Key="ItemAreaBrush" StartPoint="0.5, 0" EndPoint="0.5, 1" Opacity="1">
<GradientStop Color="#fff" Offset="0" />
<GradientStop Color="#f2fcfe" Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="SelectedItemAreaBrush" StartPoint="0.5, 0" EndPoint="0.5, 1" Opacity="1">
<GradientStop Color="#fff" Offset="0" />
<GradientStop Color="#f2fcfe" Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="ItemBorderBrush" StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Color="#243B55" Offset="0" />
<GradientStop Color="#141E30" Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="SelectedItemBorderBrush" StartPoint="0.5, 0" EndPoint="0.5, 1">
<GradientStop Color="#243B55" Offset="0" />
<GradientStop Color="#141E30" Offset="1" />
</LinearGradientBrush>
<DropShadowBitmapEffect x:Key="DropShadowEffect" />
</Style.Resources>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TreeViewItem">
<Grid Margin="8,4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- This Border contains elements which display
the content and child items of the TreeViewItem. -->
<Border Name="Bd"
Background="{StaticResource ItemAreaBrush}"
BorderBrush="{StaticResource ItemBorderBrush}"
BorderThickness="0.6"
CornerRadius="8"
Padding="6"
SnapsToDevicePixels="True"
>
<Grid>
<!-- Items with children are
shown in an Expander. -->
<Expander Name="Exp" IsExpanded="{TemplateBinding TreeViewItem.IsExpanded}">
<Expander.Header>
<!-- Displays the item's header in the Expander. -->
<ContentPresenter ContentSource="Header" />
</Expander.Header>
<!-- Displays the item's children. -->
<ItemsPresenter />
</Expander>
<!-- Items without children are
shown in a ContentPresenter. -->
<ContentPresenter Name="CntPres"
ContentSource="Header"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Visibility="Collapsed"
/>
</Grid>
</Border>
</Grid>
<ControlTemplate.Triggers>
<!-- If the TreeViewItem has child items,
show it in an Expander. Otherwise
hide the Expander and show the hidden
ContentPresenter. -->
<Trigger Property="TreeViewItem.HasItems" Value="false">
<Setter
TargetName="Exp"
Property="Visibility"
Value="Collapsed" />
<Setter
TargetName="CntPres"
Property="Visibility"
Value="Visible" />
</Trigger>
<!--When the item is selected in the TreeView, use the
"selected" colors and give it a drop shadow. -->
<Trigger Property="IsSelected" Value="true">
<Setter
TargetName="Bd"
Property="Panel.Background"
Value="{StaticResource SelectedItemAreaBrush}" />
<Setter
TargetName="Bd"
Property="Border.BorderBrush"
Value="{StaticResource SelectedItemBorderBrush}" />
<!--<Setter
TargetName="Bd"
Property="TextElement.Foreground"
Value="{DynamicResource
{x:Static SystemColors.HighlightTextBrushKey}}" />-->
<Setter
TargetName="Bd"
Property="Border.BitmapEffect"
Value="{StaticResource DropShadowEffect}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<!-- Make each TreeViewItem show it's children
in a StackPanel. If it is a root item then
the Orientation will be 'Horizontal', else
'Vertical'. -->
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<ItemsPanelTemplate.Resources>
<this:ItemsPanelOrientationConverter x:Key="conv" />
</ItemsPanelTemplate.Resources>
<StackPanel
IsItemsHost="True"
Orientation="{Binding
RelativeSource={x:Static RelativeSource.TemplatedParent},
Converter={StaticResource conv}}"
/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
Does anybody know, what I am doing wrong in combining the style and functionality of my tree?
Is the problem that the style already defines something according to the isExpanded property? Or is there something missing, something along the lines of super(isExpanded)?
Thanks for your help!
Expander binding is probably the cause of the issue:
<Expander Name="Exp" IsExpanded="{TemplateBinding TreeViewItem.IsExpanded}">
according to documentation,
A TemplateBinding is always a one-way binding, even if properties involved default to two-way binding.
(see also TemplateBinding limitations)
try re-write binding as:
<Expander Name="Exp"
IsExpanded="{Binding IsExpanded,
RelativeSource={RelativeSource TemplatedParent}}">

Setting ListView Background

I hope to set the background with different brush, however, it doesn't work. No error, No warnings.
In my code, I hope make rows in ListView have different backgrounds, So, I define a Style for ListViewItem, but it can't know now. While I debug the code, I could step into local:NumberConverter:Convert(object value, Type targetType, object parameter, CultureInfo culture), however, the backgrounds of rows keep its original colors.
<UserControl x:Class="demo05_wpf02_binding.TabControl2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:demo05_wpf02_binding"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<Style x:Key="BookListStyle" TargetType="{x:Type ListViewItem}">
<Style.Resources>
<LinearGradientBrush x:Key="ProfitBrush" StartPoint="0.2,0" EndPoint="0.8,1">
<GradientStop Offset="0.3" Color="LavenderBlush" />
<GradientStop Offset="0.7" Color="CornflowerBlue" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="LossBrush" StartPoint="0.2,0" EndPoint="0.8,1">
<GradientStop Offset="0.3" Color="LightYellow" />
<GradientStop Offset="0.7" Color="LightGoldenrodYellow" />
</LinearGradientBrush>
<local:NumberConverter x:Key="numConverter" />
</Style.Resources>
<Style.Triggers>
<DataTrigger Binding="{Binding Title, Converter={StaticResource numConverter}}" Value="0" >
<Setter Property="Background" Value="{StaticResource ProfitBrush}" />
</DataTrigger>
<DataTrigger Binding="{Binding Title, Converter={StaticResource numConverter}}" Value="1" >
<Setter Property="Background" Value="{StaticResource LossBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<DockPanel>
<ListView Name="ListView01" ItemContainerStyle="{StaticResource BookListStyle}" ItemsSource="{Binding}" Margin="5">
<ListView.View>
<GridView>
<GridViewColumn Header="Title" DisplayMemberBinding="{Binding Title}" Width="80" />
<GridViewColumn Header="Publisher" DisplayMemberBinding="{Binding Publisher}" Width="100" />
<GridViewColumn Header="ISBN" DisplayMemberBinding="{Binding ISBN}" Width="100" />
</GridView>
</ListView.View>
</ListView>
</DockPanel>
</UserControl>
Your problem must lie in your Converter. If you removed the Converter, then your XAML would work just fine as it is if your data items had Title values of 1 and 0.
<Style x:Key="BookListStyle" TargetType="{x:Type ListViewItem}">
<Style.Resources>
<LinearGradientBrush x:Key="ProfitBrush" StartPoint="0.2,0" EndPoint="0.8,1">
<GradientStop Offset="0.3" Color="LavenderBlush" />
<GradientStop Offset="0.7" Color="CornflowerBlue" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="LossBrush" StartPoint="0.2,0" EndPoint="0.8,1">
<GradientStop Offset="0.3" Color="LightYellow" />
<GradientStop Offset="0.7" Color="LightGoldenrodYellow" />
</LinearGradientBrush>
</Style.Resources>
<Style.Triggers>
<DataTrigger Binding="{Binding Title}" Value="0" >
<Setter Property="Background" Value="{StaticResource ProfitBrush}" />
</DataTrigger>
<DataTrigger Binding="{Binding Title}" Value="1" >
<Setter Property="Background" Value="{StaticResource LossBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
So look closely at the code in your Converter... put a breakpoint there and step through the code until you find your problem. One other thing to note is that your LossBrush is very hard to see... maybe a stronger colour would help, even if only used when testing.

WPF how to set a tooltip to textbox (in style file)

I wanted to have nice ToolTip for my TextBox, so I started with simple ToolTip:
<TextBox>
<TextBox.ToolTip>
<StackPanel>
<TextBlock>Nice text</TextBlock>
<TextBlock>Nice text</TextBlock>
</StackPanel>
</TextBox.ToolTip>
</TextBox>
However I have a dozen TextBoxes and I wanted them all to have the ToolTip above. That's why I decided to transfer the code above into a Style file.
My Style file looks like:
<Style x:Key="DefaultStyle" TargetType="{x:Type TextBox}">
<Setter Property="FontFamily" Value="Tahoma"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="BorderBrush" Value="#A9C2DE"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" >
<GradientStop Color="#CDE1F7" Offset="0.01"/>
<GradientStop Color="#DFECFA" Offset="0.8" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="ToolTip">
<Setter.Value>
<StackPanel>
<TextBlock Text="Nice toolbox"/>
<TextBlock Text="Nice tooltip"/>
</StackPanel>
</Setter.Value>
</Setter>
</Style>
However now I get error XAML parse exception.
How can I set this kind of ToolTip (with StackPanels etc) to TextBox (from style file)??
Dotnet Version < 4
The style looks good but there seems to be an issue with specifing the tooltip directly in the styles value. Declare the ToolTip as a resource and then set it in the style via StaticResource.
<ToolTip x:Key="YourToolTip" >
<StackPanel>
<TextBlock Text="Nice toolbox"/>
<TextBlock Text="Nice tooltip"/>
</StackPanel>
</ToolTip>
... Your Style...
<Setter Property="TextBox.ToolTip" Value="{StaticResource YourToolTip}"/>
...
Dotnet Version == 4
If you work with .net4, it's something other. You wrote that you put it into a style file. Do you mean a resource-file? If yes, may be you have not loaded it during runtime. Something like:
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/YourStyleFile.xaml"/>
<ResourceDictionary>
<!-- Other local resources -->
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
Another possibility is that you try to use it on another type than TextBox. This does not work because you declared TextBox as target type.

Can't set style for path in resource dictionary

I create a style for Path in resource dictionary as below:
<Style x:Key="HeaderPathStyle" TargetType="Path">
<Setter Property="Opacity" Value="0.8"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="Stretch" Value="Fill"/>
<Setter Property="StrokeThickness" Value="0.5"/>
<Setter Property="Data" Value="M12.5,7 C47.333332,7 115.85664,7 117,7 C118.14336,7 122.1255,6.7291665 122.25,12 C122.3745,17.270834 122.25,18.333334 122.25,21.5 L12.5,21.5 z"/>
<Setter Property="Fill">
<Setter.Value>
<RadialGradientBrush GradientOrigin="0.699000000953674,0.792999982833862">
<RadialGradientBrush.RelativeTransform>
<TransformGroup>
<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.4" ScaleY="2.188"/>
<SkewTransform CenterX="0.5" CenterY="0.5"/>
<RotateTransform CenterX="0.5" CenterY="0.5"/>
<TranslateTransform X="0.017" Y="0.009"/>
</TransformGroup>
</RadialGradientBrush.RelativeTransform>
<GradientStop Color="#FF6C6C8E" Offset="1"/>
<GradientStop Color="#FFADD8E6" Offset="0"/>
</RadialGradientBrush>
</Setter.Value>
</Setter>
</Style>
Then use it usercontrol as below:
<Path Style="{StaticResource HeaderPathStyle}"/>
But I get error. If I set Path in user control xaml directly with same setting, no error.
How to fix it?
You can't just create a Resource Dictionary and expect all resources placed there to accessible immediately. If you want to create a resource that is available from any UserControl then place that resource in the App.xaml in the <Application.Resources> element.
If you'd rather not cluter the App.Xaml with all sorts of resources but still want them to be globally available then using a resource dictionary is the correct approach but then you need to create a reference to that dictionary in the App.xaml:-
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="YourDictionaryFile.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

How do you style a WPF GridView Header?

I went from this: WPF GridViewHeader styling questions
to this:
Now I just need to get rid of the white space to the right of the "Size" header. I basically have a template for the GridViewColumnHeader that makes it a TextBlock. Is there any way I can set the background for that header area so that it spans the entire width of the GridView?
ADDED CODE:
This is my right-most column. The grid does not span 100% of available window area. In the header I need everything to the right of this column to have the same background as the column headers themselves.
<Style x:Key="GridHeaderRight" TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
<TextBlock Text="{TemplateBinding Content}" Padding="5" Width="{TemplateBinding Width}" TextAlignment="Right">
<TextBlock.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0.0" Color="#373638" />
<GradientStop Offset="1.0" Color="#77797B" />
</LinearGradientBrush>
</TextBlock.Background>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Background" Value="Green" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0.0" Color="#373638" />
<GradientStop Offset="1.0" Color="#77797B" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<GridViewColumn Width="200" HeaderContainerStyle="{ StaticResource GridHeaderRight}" Header="Size">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=EmployeeNumber}" HorizontalAlignment="Right"></TextBlock>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
UPDATE
I am one step closer (I think) to solving this.
I added the following code inside the GridView tag:
<GridView.ColumnHeaderContainerStyle>
<Style TargetType="GridViewColumnHeader">
<Setter Property="BorderThickness" Value="1"></Setter>
<Setter Property="BorderBrush" Value="Green"></Setter>
<Setter Property="Height" Value="Auto"></Setter>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0.0" Color="#373638" />
<GradientStop Offset="1.0" Color="#77797B" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
</GridView.ColumnHeaderContainerStyle>
The border is there just so you can see the boundary of what this style covers. This is an enlarged image of what this does. It seems to be what I want if I can get rid of the little white border on the bottom.
So I guess removing that tiny white bottom border would also be an accepted answer for this one.
This is a simple style that will accomplish what you are looking for. Just change the Transparent background on the Border to be your desired gradient.
<Style TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
<Border BorderThickness="0,0,0,1" BorderBrush="Black" Background="Transparent">
<TextBlock x:Name="ContentHeader" Text="{TemplateBinding Content}" Padding="5,5,5,0" Width="{TemplateBinding Width}" TextAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="12" />
</Style>
sometimes the simplest way is the best. All you need to do it to change the TextBlock attached properties of GridViewColumnHeader
Define something like this in Resources:
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
<Setter Property="TextBlock.TextWrapping" Value="Wrap"/>
<Setter Property="TextBlock.Foreground" Value="Black"/>
</Style>
Have a look at the GridViewColumnHeader.Role property. The sample in the documentation for the GridViewColumnHeaderRole enumeration might give you some ideas...
EDIT: Have you considered using the GridView.HeaderStyle property ?
I solved this issue but I think there should be a better way of doing it. The problem was that I had TextBlocks on the header of each column. The unused area didn't have anything on the header row. I just added a TextBlock with the same background in the GridView.ColumnHeaderContainerStyle and it happened to span the rest of the unused width of the grid.
<GridView.ColumnHeaderContainerStyle>
<Style TargetType="GridViewColumnHeader">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
<TextBlock Text="" Padding="5">
<TextBlock.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0.0" Color="#373638" />
<GradientStop Offset="1.0" Color="#77797B" />
</LinearGradientBrush>
</TextBlock.Background>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GridView.ColumnHeaderContainerStyle>

Resources