This question is locked. New answers and comments are not allowed.
Hi,
I'm trying to restyle the GridView by altering parts of an existing Theme. Everything works fine when not setting the ApplicationTheme but defaults to the built-in Theme when setting the ApplicationTheme.
Here is my XAML:
Here is my code-behind:
Thanks,
Chris
I'm trying to restyle the GridView by altering parts of an existing Theme. Everything works fine when not setting the ApplicationTheme but defaults to the built-in Theme when setting the ApplicationTheme.
Here is my XAML:
| <UserControl |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| mc:Ignorable="d" |
| xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" |
| xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" |
| xmlns:grid="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView" |
| xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" |
| x:Class="RadControlsSilverlightApplication.MainPage" |
| d:DesignWidth="640" d:DesignHeight="480"> |
| <UserControl.Resources> |
| <SolidColorBrush x:Key="BzGridViewRowSelectedCell" Color="#FFE1F1F9" /> |
| <SolidColorBrush x:Key="BzGridViewDisabledBackground" Color="#FFEEEEEE" /> |
| <SolidColorBrush x:Key="BzGridViewDisabledBorderBrush" Color="#FFA9A9A9" /> |
| <SolidColorBrush x:Key="BzGridLinesFill" Color="#FFC3C3C3" /> |
| <LinearGradientBrush x:Key="BzGridViewRowSelectedBackground" EndPoint="0.5,1" StartPoint="0.5,0"> |
| <GradientStop Color="#FFE3F4FC" Offset="0"/> |
| <GradientStop Color="#FFA6D9F4" Offset="1"/> |
| </LinearGradientBrush> |
| <SolidColorBrush x:Key="BzGridViewInvalidBorder" Color="#FFCE7D7D" /> |
| <LinearGradientBrush x:Key="BzGridViewInvalidBackground" EndPoint="0.5,1" StartPoint="0.5,0"> |
| <GradientStop Color="#FFFCDCDC"/> |
| <GradientStop Color="#FFFCC1C1" Offset="1"/> |
| </LinearGradientBrush> |
| <SolidColorBrush x:Key="BzGridViewRowIndicatorBackground" Color="White" /> |
| <SolidColorBrush x:Key="BzGridViewExpanderForeground" Color="#FF003399" /> |
| <SolidColorBrush x:Key="BzGridViewBackground" Color="#FFFFFFFF"/> |
| <SolidColorBrush x:Key="BzGridViewForeground" Color="Black" /> |
| <SolidColorBrush x:Key="BzGridViewRowInnerBorderBackground_Alternate" Color="#FFF7F8FA" /> |
| <SolidColorBrush x:Key="BzGridViewHeaderRowDataCellsPresenterBackground" Color="#FFFFFFFF" /> |
| <SolidColorBrush x:Key="BzGridViewHeaderCellOuterBorderBrush" Color="#FF7FB7DB" /> |
| <LinearGradientBrush x:Key="BzGridViewHeaderCellInnerBorderBackground" EndPoint="0.5,1" StartPoint="0.5,0"> |
| <GradientStop Color="#FFE5F4FD" Offset="0"/> |
| <GradientStop Color="#FFA6D9F4" Offset="1"/> |
| <GradientStop Color="#FFD8EFFC" Offset="0.38"/> |
| <GradientStop Color="#FFBEE6FD" Offset="0.38"/> |
| </LinearGradientBrush> |
| <LinearGradientBrush x:Key="BzGridViewHeaderCellBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0"> |
| <GradientStop Color="#FFFFFFFF" Offset="0.5"/> |
| <GradientStop Color="#FF3C7FB1" Offset="0.5"/> |
| <GradientStop Color="#FFFFFFFF" Offset="0"/> |
| <GradientStop Color="#FF3C7FB1" Offset="1"/> |
| </LinearGradientBrush> |
| <LinearGradientBrush x:Key="BzGridViewHeaderCellInnerBorderBackground_Over" EndPoint="0.5,1" StartPoint="0.5,0"> |
| <GradientStop Color="#FFF2F9FC" Offset="0"/> |
| <GradientStop Color="#FFD8ECF6" Offset="1"/> |
| <GradientStop Color="#FFF2F9FC" Offset="0.38"/> |
| <GradientStop Color="#FFE1F1F9" Offset="0.38"/> |
| </LinearGradientBrush> |
| <LinearGradientBrush x:Key="BzGridViewHeaderCellInnerBorderBackground_Selected" EndPoint="0.5,1" StartPoint="0.5,0"> |
| <GradientStop Color="#FFC2E4F6" Offset="0"/> |
| <GradientStop Color="#FF90CBEA" Offset="1"/> |
| <GradientStop Color="#FFC2E4F6" Offset="0.38"/> |
| <GradientStop Color="#FFABDAF3" Offset="0.38"/> |
| </LinearGradientBrush> |
| <LinearGradientBrush x:Key="BzGridViewHeaderCellSortIndicator" EndPoint="0.724,0.182" StartPoint="0.344,0.726"> |
| <GradientStop Color="#FF3C5E72" Offset="0"/> |
| <GradientStop Color="#FF80BADA" Offset="1"/> |
| <GradientStop Color="#FF70A9C6" Offset="0.429"/> |
| <GradientStop Color="#FF95C6E0" Offset="0.739"/> |
| </LinearGradientBrush> |
| <SolidColorBrush x:Key="BzGridViewHeaderCellForeground" Color="#FF333333" /> |
| <SolidColorBrush x:Key="BzFrozenSplitterLine1" Color="#FFFFFFFF" /> |
| <SolidColorBrush x:Key="BzFrozenSplitterLine2" Color="#FF7FB7DB" /> |
| <SolidColorBrush x:Key="BzFrozenSplitterLine3" Color="#7F7FB7DB" /> |
| <SolidColorBrush x:Key="BzFrozenSplitterLine4" Color="#3E7FB7DB" /> |
| <SolidColorBrush x:Key="BzGridViewIndentCellBackground" Color="#FFFFFFFF" /> |
| <LinearGradientBrush x:Key="BzGridViewRowDetailsBackground" EndPoint="0.5,1" StartPoint="0.5,0"> |
| <GradientStop Color="#FF83ABC0" Offset="0"/> |
| <GradientStop Color="#FF4D95A9" Offset="1"/> |
| <GradientStop Color="#FF3F7E9D" Offset="0.15"/> |
| <GradientStop Color="#FF0A5276" Offset="0.15"/> |
| </LinearGradientBrush> |
| <SolidColorBrush x:Key="BzGridViewRowDetailsBorderBrush" Color="#FF3C7FB1"/> |
| <SolidColorBrush x:Key="BzGridViewRowDetailsForeground" Color="#FFFFFFFF"/> |
| <telerik:BooleanToOpacityConverter x:Key="BzBooleanToOpacityConverter" /> |
| <telerik:BooleanToVisibilityConverter x:Key="BzBooleanToVisibilityConverter" /> |
| <grid:GridLineWidthToThicknessConverter x:Key="BzGridLineWidthToThicknessConverter" /> |
| <LinearGradientBrush x:Key="BzDistinctFilterFunnelFill" EndPoint="0.703,0.697" StartPoint="0.26,0.134"> |
| <GradientStop Color="#FF3C5E72" Offset="0"/> |
| <GradientStop Color="#FF80BADA" Offset="1"/> |
| <GradientStop Color="#FF70A9C6" Offset="0.429"/> |
| <GradientStop Color="#FF95C6E0" Offset="0.739"/> |
| </LinearGradientBrush> |
| <ControlTemplate x:Key="BzDistinctFilterControlTemplate" TargetType="grid:FilteringDropDown"> |
| <Grid> |
| <ToggleButton x:Name="PART_DropDownButton" Width="18" Height="18"> |
| <ToggleButton.Template> |
| <ControlTemplate TargetType="ToggleButton"> |
| <ContentPresenter/> |
| </ControlTemplate> |
| </ToggleButton.Template> |
| <Grid Width="11" Height="12" Background="Transparent"> |
| <Path |
| Stretch="Fill" |
| Fill="{StaticResource BzDistinctFilterFunnelFill}" |
| Stroke="{x:Null}" |
| Data="M0,0 L11,0 11,1 10,1 10,2 9,2 9,3 8,3 8,3.9999999 7,3.9999999 7,12 4,12 4,3.9999999 3.0000001,3.9999999 3.0000001,3 2,3 2,2 1,2 1,1 0,1 z" |
| /> |
| <Path |
| Stretch="Fill" |
| Stroke="{x:Null}" |
| VerticalAlignment="Top" |
| Margin="0,1,0,0" |
| Width="5" |
| Height="3" |
| Data="M0,0 L1,0 2,0 3,0 4,0 5,0 5.9999999,0 7,0 7,0.99999996 5.9999999,0.99999996 5,0.99999996 5.9999999,1.0000001 5.9999999,2 5,2 4.981,2 4.981,3 4,3 3.9809999,3 3.9809999,4 2.9809999,4 2.9809999,3 2,3 2,2 1,2
1,1.0000001 0,1.0000001 z" |
| Fill="#FFFFFFFF" |
| Visibility="{TemplateBinding FunnelFillVisibility}" |
| /> |
| </Grid> |
| </ToggleButton> |
| <Popup x:Name="PART_DropDownPopup"/> |
| </Grid> |
| </ControlTemplate> |
| <Style x:Key="BzFilteringDropDownStyle" TargetType="grid:FilteringDropDown"> |
| <Setter Property="Template" Value="{StaticResource BzDistinctFilterControlTemplate}"/> |
| <Setter Property="Foreground" Value="#FF333333" /> |
| <Setter Property="FontWeight" Value="Normal" /> |
| <Setter Property="FontStyle" Value="Normal" /> |
| <Setter Property="FontSize" Value="11" /> |
| </Style> |
| <ControlTemplate x:Key="BzDetailsPresenterTemplate" TargetType="grid:DetailsPresenter"> |
| <Border |
| x:Name="DetailsBorder" |
| Visibility="Collapsed" |
| Background="{TemplateBinding Background}" |
| BorderBrush="{TemplateBinding BorderBrush}" |
| BorderThickness="{TemplateBinding BorderThickness}" |
| MinHeight="{TemplateBinding MinHeight}" |
| > |
| <ContentPresenter x:Name="PART_ContentPresenter" /> |
| <vsm:VisualStateManager.VisualStateGroups> |
| <vsm:VisualStateGroup x:Name="DetailsStates"> |
| <vsm:VisualState x:Name="DetailsVisible"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsBorder" Storyboard.TargetProperty="Visibility"> |
| <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| <vsm:VisualState x:Name="DetailsCollapsed" /> |
| </vsm:VisualStateGroup> |
| </vsm:VisualStateManager.VisualStateGroups> |
| </Border> |
| </ControlTemplate> |
| <Style x:Key="BzDetailsPresenterStyle" TargetType="grid:DetailsPresenter"> |
| <Setter Property="Template" Value="{StaticResource BzDetailsPresenterTemplate}" /> |
| <Setter Property="IsTabStop" Value="False" /> |
| <Setter Property="Background" Value="{StaticResource BzGridViewRowDetailsBackground}" /> |
| <Setter Property="BorderBrush" Value="{StaticResource BzGridViewRowDetailsBorderBrush}" /> |
| <Setter Property="BorderThickness" Value="1" /> |
| <Setter Property="Foreground" Value="{StaticResource BzGridViewRowDetailsForeground}" /> |
| <Setter Property="UseLayoutRounding" Value="True" /> |
| </Style> |
| <Style x:Key="BzGridViewIndentCellStyle" TargetType="grid:GridViewIndentCell"> |
| <Setter Property="BorderBrush" Value="{StaticResource BzGridLinesFill}" /> |
| <Setter Property="Background" Value="{StaticResource BzGridViewIndentCellBackground}" /> |
| <Setter Property="Template"> |
| <Setter.Value> |
| <ControlTemplate TargetType="grid:GridViewIndentCell"> |
| <Border |
| Background="{TemplateBinding Background}" |
| BorderBrush="{TemplateBinding BorderBrush}" |
| VerticalAlignment="Stretch" |
| BorderThickness="0,0,1,0" |
| Width="18" |
| /> |
| </ControlTemplate> |
| </Setter.Value> |
| </Setter> |
| </Style> |
| <ControlTemplate x:Key="BzIndentPresenterTemplate" TargetType="grid:IndentPresenter"> |
| <Grid> |
| <ItemsPresenter/> |
| </Grid> |
| </ControlTemplate> |
| <DataTemplate x:Key="BzIndentPresenterItemTemplate"> |
| <grid:GridViewIndentCell Style="{StaticResource BzGridViewIndentCellStyle}"/> |
| </DataTemplate> |
| <ItemsPanelTemplate x:Key="BzIndentPresenterItemsPanelTemplate"> |
| <StackPanel Orientation="Horizontal"/> |
| </ItemsPanelTemplate> |
| <Style x:Key="BzIndentPresenterStyle" TargetType="grid:IndentPresenter"> |
| <Setter Property="Template" Value="{StaticResource BzIndentPresenterTemplate}" /> |
| <Setter Property="ItemTemplate" Value="{StaticResource BzIndentPresenterItemTemplate}" /> |
| <Setter Property="ItemsPanel" Value="{StaticResource BzIndentPresenterItemsPanelTemplate}" /> |
| </Style> |
| <ControlTemplate x:Key="BzFrozenColumnsSplitterTemplate" TargetType="grid:FrozenColumnsSplitter"> |
| <StackPanel Orientation="Horizontal" Width="6" Opacity="1"> |
| <Border HorizontalAlignment="Left" Width="1" Background="{StaticResource BzFrozenSplitterLine1}" /> |
| <Border HorizontalAlignment="Left" Width="1" Background="{StaticResource BzFrozenSplitterLine2}" /> |
| <Border HorizontalAlignment="Left" Width="1" Background="{StaticResource BzFrozenSplitterLine3}" /> |
| <Border HorizontalAlignment="Left" Width="1" Background="{StaticResource BzFrozenSplitterLine4}" /> |
| </StackPanel> |
| </ControlTemplate> |
| <Style x:Key="BzFrozenColumnsSplitterStyle" TargetType="grid:FrozenColumnsSplitter"> |
| <Setter Property="Template" Value="{StaticResource BzFrozenColumnsSplitterTemplate}" /> |
| <Setter Property="IsTabStop" Value="False" /> |
| </Style> |
| <ControlTemplate x:Key="BzDataCellsPresenterTemplate" TargetType="grid:DataCellsPresenter"> |
| <Grid> |
| <ItemsPresenter /> |
| <grid:FrozenColumnsSplitter |
| HorizontalAlignment="Left" |
| x:Name="PART_FrozenColumnsSplitter" |
| Style="{StaticResource BzFrozenColumnsSplitterStyle}" |
| /> |
| </Grid> |
| </ControlTemplate> |
| <Style x:Key="BzDataCellsPresenterStyle" TargetType="grid:DataCellsPresenter"> |
| <Setter Property="Template" Value="{StaticResource BzDataCellsPresenterTemplate}" /> |
| <Setter Property="IsTabStop" Value="False" /> |
| <Setter Property="ItemsPanel"> |
| <Setter.Value> |
| <ItemsPanelTemplate> |
| <grid:GridViewCellsPanel /> |
| </ItemsPanelTemplate> |
| </Setter.Value> |
| </Setter> |
| </Style> |
| <ControlTemplate x:Key="BzGridViewHeaderIndentCellTemplate" TargetType="grid:GridViewHeaderIndentCell"> |
| <Border |
| Width="18" |
| BorderBrush="{TemplateBinding BorderBrush}" |
| Background="{TemplateBinding Background}" |
| BorderThickness="{TemplateBinding BorderThickness}" |
| MinHeight="{TemplateBinding MinHeight}" |
| Margin="{TemplateBinding Margin}" |
| /> |
| </ControlTemplate> |
| <Style x:Key="BzHeaderIndentCellStyle" TargetType="grid:GridViewHeaderIndentCell"> |
| <Setter Property="Template" Value="{StaticResource BzGridViewHeaderIndentCellTemplate}" /> |
| <Setter Property="Background" Value="{StaticResource BzGridViewHeaderCellInnerBorderBackground}" /> |
| <Setter Property="BorderBrush" Value="{StaticResource BzGridViewHeaderCellOuterBorderBrush}" /> |
| <Setter Property="BorderThickness" Value="0,0,1,0" /> |
| <Setter Property="Margin" Value="0" /> |
| <Setter Property="MinHeight" Value="18" /> |
| </Style> |
| <DataTemplate x:Key="BzGridViewHeaderIndentCellDataTemplate"> |
| <grid:GridViewHeaderIndentCell Style="{StaticResource BzHeaderIndentCellStyle}"/> |
| </DataTemplate> |
| <ControlTemplate x:Key="BzMyGridViewHeaderRowTemplate" TargetType="grid:GridViewHeaderRow"> |
| <Border |
| x:Name="PART_GridViewHeaderRowBorder" |
| BorderBrush="{TemplateBinding BorderBrush}" |
| Background="{TemplateBinding Background}" |
| BorderThickness="{TemplateBinding BorderThickness}" |
| MinHeight="{TemplateBinding MinHeight}" |
| Margin="{TemplateBinding Margin}" |
| Padding="{TemplateBinding Padding}"> |
| <grid:SelectiveScrollingGrid> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition Width="Auto" /> |
| <ColumnDefinition Width="Auto" /> |
| <ColumnDefinition Width="Auto" /> |
| <ColumnDefinition Width="*" /> |
| </Grid.ColumnDefinitions> |
| <Border |
| x:Name="PART_IndicatorPresenter" |
| Visibility="{TemplateBinding RowIndicatorVisibility}" |
| Grid.Column="0" |
| VerticalAlignment="Stretch" |
| BorderThickness="0,0,1,0" |
| Width="18" |
| BorderBrush="{StaticResource BzGridViewHeaderCellOuterBorderBrush}" |
| MinHeight="{TemplateBinding MinHeight}" |
| /> |
| <grid:IndentPresenter |
| x:Name="PART_IndentPresenter" |
| IndentLevel="{TemplateBinding IndentLevel}" |
| ItemTemplate="{StaticResource BzGridViewHeaderIndentCellDataTemplate}" |
| Grid.Column="1" |
| Style="{StaticResource BzIndentPresenterStyle}" |
| BorderBrush="{TemplateBinding BorderBrush}" |
| BorderThickness="{TemplateBinding BorderThickness}" |
| Background="{TemplateBinding Background}" |
| MinHeight="{TemplateBinding MinHeight}" |
| Margin="{TemplateBinding Margin}" |
| /> |
| <Border |
| x:Name="PART_HierarchyIndentPresenter" |
| Grid.Column="2" |
| VerticalAlignment="Stretch" |
| BorderThickness="0,0,1,0" |
| Width="18" |
| BorderBrush="{StaticResource BzGridViewHeaderCellOuterBorderBrush}" |
| MinHeight="{TemplateBinding MinHeight}" |
| Visibility="{Binding HasHierarchy, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BzBooleanToVisibilityConverter}}" |
| /> |
| <grid:DataCellsPresenter |
| x:Name="PART_DataCellsPresenter" |
| Background="{StaticResource BzGridViewHeaderRowDataCellsPresenterBackground}" |
| Grid.Column="3" |
| MinHeight="{TemplateBinding MinHeight}" |
| Style="{StaticResource BzDataCellsPresenterStyle}" |
| /> |
| </grid:SelectiveScrollingGrid> |
| </Border> |
| </ControlTemplate> |
| <Style x:Key="BzHeaderRowStyle" TargetType="grid:GridViewHeaderRow"> |
| <Setter Property="Template" Value="{StaticResource BzMyGridViewHeaderRowTemplate}" /> |
| <Setter Property="Background" Value="{StaticResource BzGridViewHeaderCellInnerBorderBackground}" /> |
| <Setter Property="BorderBrush" Value="{StaticResource BzGridViewHeaderCellBorderBrush}" /> |
| <Setter Property="BorderThickness" Value="0,0,0,1" /> |
| <Setter Property="MinHeight" Value="18" /> |
| <Setter Property="Margin" Value="0" /> |
| <Setter Property="Padding" Value="0" /> |
| </Style> |
| <Style x:Key="BzColumnHeaderGripperStyle" TargetType="Thumb"> |
| <Setter Property="Width" Value="5"/> |
| <Setter Property="Background" Value="Transparent"/> |
| <Setter Property="Cursor" Value="SizeWE"/> |
| <Setter Property="Template"> |
| <Setter.Value> |
| <ControlTemplate TargetType="Thumb"> |
| <Border Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" /> |
| </ControlTemplate> |
| </Setter.Value> |
| </Setter> |
| </Style> |
| <ControlTemplate x:Key="BzGridViewHeaderCellTemplate" TargetType="grid:GridViewHeaderCell"> |
| <Grid x:Name="PART_HeaderCellGrid" MinHeight="{TemplateBinding MinHeight}"> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition Width="*" /> |
| <ColumnDefinition Width="Auto"/> |
| </Grid.ColumnDefinitions> |
| <vsm:VisualStateManager.VisualStateGroups> |
| <vsm:VisualStateGroup x:Name="CommonStates"> |
| <vsm:VisualState x:Name="Normal" /> |
| <vsm:VisualState x:Name="MouseOver" > |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="GridViewHeaderCell_Over" |
| Storyboard.TargetProperty="Opacity" |
| > |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| </vsm:VisualStateGroup> |
| <vsm:VisualStateGroup x:Name="SortingStates"> |
| <vsm:VisualState x:Name="Ascending"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="PART_SortIndicator" |
| Storyboard.TargetProperty="Visibility" |
| > |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> |
| </ObjectAnimationUsingKeyFrames> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="PART_SortIndicator" |
| Storyboard.TargetProperty="RenderTransform" |
| > |
| <DiscreteObjectKeyFrame KeyTime="0:0:0"> |
| <DiscreteObjectKeyFrame.Value> |
| <ScaleTransform ScaleX="1" ScaleY="-1" /> |
| </DiscreteObjectKeyFrame.Value> |
| </DiscreteObjectKeyFrame> |
| </ObjectAnimationUsingKeyFrames> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="GridViewHeaderCell_Selected" |
| Storyboard.TargetProperty="Opacity" |
| > |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| <vsm:VisualState x:Name="Descending"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="PART_SortIndicator" |
| Storyboard.TargetProperty="Visibility" |
| > |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> |
| </ObjectAnimationUsingKeyFrames> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="PART_SortIndicator" |
| Storyboard.TargetProperty="RenderTransform" |
| > |
| <DiscreteObjectKeyFrame KeyTime="0:0:0"> |
| <DiscreteObjectKeyFrame.Value> |
| <ScaleTransform ScaleX="1" ScaleY="1" /> |
| </DiscreteObjectKeyFrame.Value> |
| </DiscreteObjectKeyFrame> |
| </ObjectAnimationUsingKeyFrames> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="GridViewHeaderCell_Selected" |
| Storyboard.TargetProperty="Opacity" |
| > |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| <vsm:VisualState x:Name="None"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="PART_SortIndicator" |
| Storyboard.TargetProperty="Visibility" |
| > |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed" /> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| </vsm:VisualStateGroup> |
| </vsm:VisualStateManager.VisualStateGroups> |
| <Border |
| x:Name="GridViewHeaderCell" |
| Grid.ColumnSpan="2" |
| Margin="{TemplateBinding Margin}" |
| Background="{TemplateBinding Background}" |
| BorderBrush="{TemplateBinding BorderBrush}" |
| BorderThickness="{TemplateBinding BorderThickness}" |
| /> |
| <Border |
| x:Name="GridViewHeaderCell_Over" |
| Grid.ColumnSpan="2" |
| Opacity="0" |
| Margin="{TemplateBinding Margin}" |
| Background="{StaticResource BzGridViewHeaderCellInnerBorderBackground_Over}" |
| BorderBrush="{TemplateBinding BorderBrush}" |
| BorderThickness="{TemplateBinding BorderThickness}" |
| /> |
| <Border |
| x:Name="GridViewHeaderCell_Selected" |
| Grid.ColumnSpan="2" |
| Opacity="0" |
| Margin="{TemplateBinding Margin}" |
| Background="{StaticResource BzGridViewHeaderCellInnerBorderBackground_Selected}" |
| BorderBrush="{TemplateBinding BorderBrush}" |
| BorderThickness="{TemplateBinding BorderThickness}" |
| /> |
| <grid:AlignmentContentPresenter |
| TextAlignment="{TemplateBinding TextAlignment}" |
| Margin="{TemplateBinding Padding}" |
| HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
| VerticalAlignment="{TemplateBinding VerticalAlignment}" |
| /> |
| <Grid Grid.Column="1" HorizontalAlignment="Right"> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition Width="Auto"/> |
| <ColumnDefinition Width="Auto"/> |
| </Grid.ColumnDefinitions> |
| <Path |
| x:Name="PART_SortIndicator" |
| Stretch="Fill" |
| HorizontalAlignment="Right" |
| VerticalAlignment="Center" |
| Width="7" |
| Height="4" |
| Margin="1,0,2,0" |
| Data="M0,0 L1,0 2,0 3,0 4,0 5,0 5.9999999,0 7,0 7,0.99999996 5.9999999,0.99999996 5,0.99999996 5.9999999,1.0000001 5.9999999,2 5,2 4.981,2 4.981,3 4,3 3.9809999,3 3.9809999,4 2.9809999,4 2.9809999,3 2,3 2,2 1,2
1,1.0000001 0,1.0000001 z" |
| RenderTransformOrigin="0.5,0.5" |
| Fill="{StaticResource BzGridViewHeaderCellSortIndicator}" |
| Visibility="Visible" |
| > |
| <Path.RenderTransform> |
| <TransformGroup> |
| <ScaleTransform ScaleX="1" ScaleY="-1"/> |
| <SkewTransform AngleX="0" AngleY="0"/> |
| <RotateTransform Angle="0"/> |
| <TranslateTransform X="0" Y="0"/> |
| </TransformGroup> |
| </Path.RenderTransform> |
| </Path> |
| <grid:FilteringDropDown |
| Name="PART_DistinctFilterControl" |
| Grid.Column="1" |
| Visibility="{TemplateBinding FilteringUIVisibility}" |
| Style="{StaticResource BzFilteringDropDownStyle}" |
| Margin="0,0,5,0" |
| /> |
| </Grid> |
| <Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Style="{StaticResource BzColumnHeaderGripperStyle}" Grid.ColumnSpan="2" /> |
| <Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Style="{StaticResource BzColumnHeaderGripperStyle}" Grid.ColumnSpan="2" /> |
| </Grid> |
| </ControlTemplate> |
| <Style x:Key="BzHeaderCellStyle" TargetType="grid:GridViewHeaderCell"> |
| <Setter Property="Template" Value="{StaticResource BzGridViewHeaderCellTemplate}" /> |
| <Setter Property="Background" Value="{StaticResource BzGridViewHeaderCellInnerBorderBackground}" /> |
| <Setter Property="BorderBrush" Value="{StaticResource BzGridViewHeaderCellOuterBorderBrush}" /> |
| <Setter Property="BorderThickness" Value="0,0,1,0" /> |
| <Setter Property="Margin" Value="0" /> |
| <Setter Property="MinHeight" Value="18" /> |
| <Setter Property="Padding" Value="3,0,1,0" /> |
| <Setter Property="Foreground" Value="{StaticResource BzGridViewHeaderCellForeground}" /> |
| <Setter Property="FontWeight" Value="Bold" /> |
| <Setter Property="FontStyle" Value="Normal" /> |
| <Setter Property="HorizontalAlignment" Value="Stretch" /> |
| <Setter Property="VerticalAlignment" Value="Center" /> |
| </Style> |
| <ControlTemplate x:Key="BzGridViewRowTemplate" TargetType="grid:GridViewRow"> |
| <grid:SelectiveScrollingGrid x:Name="grid"> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition Width="Auto" /> |
| <ColumnDefinition Width="Auto" /> |
| <ColumnDefinition Width="Auto" /> |
| <ColumnDefinition Width="*" /> |
| </Grid.ColumnDefinitions> |
| <Grid.RowDefinitions> |
| <RowDefinition Height="*" /> |
| <RowDefinition Height="Auto" /> |
| <RowDefinition Height="Auto" /> |
| <RowDefinition Height="Auto" /> |
| </Grid.RowDefinitions> |
| <vsm:VisualStateManager.VisualStateGroups> |
| <vsm:VisualStateGroup x:Name="FocusStates"> |
| <vsm:VisualState x:Name="Unfocused" /> |
| <vsm:VisualState x:Name="Focused"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="NavigatorIndicator" |
| Storyboard.TargetProperty="Visibility"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" /> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| </vsm:VisualStateGroup> |
| <vsm:VisualStateGroup x:Name="SelectionStates"> |
| <vsm:VisualState x:Name="Unselected"/> |
| </vsm:VisualStateGroup> |
| <vsm:VisualStateGroup x:Name="CommonStates"> |
| <vsm:VisualState x:Name="Normal"/> |
| <vsm:VisualState x:Name="MouseOver"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="BackgroundRectangle" |
| Storyboard.TargetProperty="Opacity"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value=".5" /> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| <vsm:VisualState x:Name="Selected"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="BackgroundRectangle" |
| Storyboard.TargetProperty="Opacity"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| </vsm:VisualStateGroup> |
| <vsm:VisualStateGroup x:Name="ValueStates"> |
| <vsm:VisualState x:Name="Valid"/> |
| <vsm:VisualState x:Name="Invalid"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames |
| Storyboard.TargetName="InvalidBorder" |
| Storyboard.TargetProperty="Opacity"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1" /> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| </vsm:VisualStateGroup> |
| </vsm:VisualStateManager.VisualStateGroups> |
| <Border |
| x:Name="SelectionBackground" |
| Grid.Column="2" |
| Grid.ColumnSpan="2" |
| MinHeight="{TemplateBinding MinHeight}" |
| Background="{TemplateBinding Background}" |
| Margin="{TemplateBinding Margin}" |
| Padding="{TemplateBinding Padding}" |
| BorderThickness="0" |
| BorderBrush="{x:Null}" |
| /> |
| <Rectangle |
| x:Name="BackgroundRectangle" |
| Grid.Column="2" |
| Grid.ColumnSpan="2" |
| Opacity="0" |
| Fill="{StaticResource BzGridViewRowSelectedBackground}" |
| /> |
| <Rectangle |
| x:Name="InvalidBorder" |
| Grid.Column="2" |
| Grid.ColumnSpan="2" |
| Opacity="0" |
| StrokeThickness="0" |
| Stroke="{StaticResource BzGridViewInvalidBorder}" |
| Fill="{StaticResource BzGridViewInvalidBackground}" |
| /> |
| <controls:GridViewToggleButton |
| Grid.Column="2" |
| MinWidth="18" |
| MinHeight="18" |
| BorderBrush="{TemplateBinding VerticalGridLinesBrush}" |
| BorderThickness="{Binding VerticalGridLinesWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BzGridLineWidthToThicknessConverter}, ConverterParameter=Right}" |
| grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" |
| IsHitTestVisible="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}}" |
| Opacity="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BzBooleanToOpacityConverter}}" |
| Visibility="{Binding HasHierarchy, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BzBooleanToVisibilityConverter}}" |
| IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" |
| /> |
| <Border |
| Grid.Column="2" |
| BorderBrush="{TemplateBinding VerticalGridLinesBrush}" |
| BorderThickness="{Binding VerticalGridLinesWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BzGridLineWidthToThicknessConverter}, ConverterParameter=Right}" |
| grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" |
| Visibility="{Binding HasHierarchy, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BzBooleanToVisibilityConverter}}" |
| /> |
| <grid:DataCellsPresenter |
| Grid.Column="3" |
| Style="{StaticResource BzDataCellsPresenterStyle}" |
| x:Name="PART_DataCellsPresenter" |
| /> |
| <grid:DetailsPresenter |
| x:Name="PART_DetailsPresenter" |
| Grid.Column="2" |
| Grid.ColumnSpan="2" |
| Grid.Row="1" |
| Visibility="Collapsed" |
| DetailsProvider="{TemplateBinding DetailsProvider}" |
| Style="{StaticResource BzDetailsPresenterStyle}" |
| /> |
| <ContentPresenter |
| x:Name="PART_HierarchyChildPresenter" |
| Grid.Column="2" |
| Grid.Row="2" |
| Grid.ColumnSpan="2" |
| Visibility="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BzBooleanToVisibilityConverter}}" |
| /> |
| <Border |
| x:Name="PART_IndicatorPresenter" |
| Width="18" |
| VerticalAlignment="Stretch" |
| Grid.Column="0" |
| Visibility="{TemplateBinding RowIndicatorVisibility}" |
| grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" |
| Background="{StaticResource BzGridViewRowIndicatorBackground}" |
| Grid.RowSpan="3" |
| BorderBrush="{TemplateBinding BorderBrush}" |
| BorderThickness="0,0,1,1"> |
| <Path |
| x:Name="NavigatorIndicator" |
| Fill="{StaticResource BzGridViewExpanderForeground}" |
| Stretch="Fill" |
| VerticalAlignment="Center" |
| HorizontalAlignment="Center" |
| Width="5" |
| Height="8" |
| Data="M254.5,183.75 L254.5,193.33333 260.75,188.16682 z" |
| Visibility="Collapsed" |
| /> |
| </Border> |
| <Border |
| x:Name="PART_RowBorder" |
| BorderBrush="{TemplateBinding HorizontalGridLinesBrush}" |
| BorderThickness="{Binding HorizontalGridLinesWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BzGridLineWidthToThicknessConverter}, ConverterParameter=Bottom}" |
| Grid.ColumnSpan="4" |
| Grid.Column="1" |
| Grid.RowSpan="4" |
| VerticalAlignment="Bottom" |
| /> |
| <grid:IndentPresenter |
| x:Name="PART_IndentPresenter" |
| Style="{StaticResource BzIndentPresenterStyle}" |
| IndentLevel="{TemplateBinding IndentLevel}" |
| Grid.Column="1" |
| Background="{TemplateBinding Background}" |
| grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" |
| /> |
| </grid:SelectiveScrollingGrid> |
| </ControlTemplate> |
| <Style x:Key="BzGridViewRowStyle" TargetType="grid:GridViewRow"> |
| <Setter Property="IsTabStop" Value="False" /> |
| <Setter Property="Template" Value="{StaticResource BzGridViewRowTemplate}" /> |
| <Setter Property="Background" Value="{StaticResource BzGridViewBackground}" /> |
| <Setter Property="BorderBrush" Value="{StaticResource BzGridLinesFill}" /> |
| <Setter Property="MinHeight" Value="18" /> |
| <Setter Property="FontWeight" Value="Normal" /> |
| <Setter Property="Foreground" Value="{StaticResource BzGridViewForeground}" /> |
| </Style> |
| <Style x:Key="BzGridViewAlternateRowStyle" BasedOn="{StaticResource BzGridViewRowStyle}" TargetType="grid:GridViewRow"> |
| <Setter Property="Background" Value="{StaticResource BzGridViewRowInnerBorderBackground_Alternate}" /> |
| </Style> |
| <ControlTemplate x:Key="BzGridViewCellTemplate" TargetType="grid:GridViewCell"> |
| <Border |
| x:Name="PART_CellBorder" |
| Background="{TemplateBinding Background}" |
| BorderBrush="{TemplateBinding VerticalGridLinesBrush}" |
| BorderThickness="{Binding VerticalGridLinesWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BzGridLineWidthToThicknessConverter}, ConverterParameter=Right}"> |
| <vsm:VisualStateManager.VisualStateGroups> |
| <vsm:VisualStateGroup x:Name="CommonStates"> |
| <vsm:VisualState x:Name="Normal" /> |
| <vsm:VisualState x:Name="Current"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_CellBorder" Storyboard.TargetProperty="Background"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource BzGridViewRowSelectedCell}" /> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| </vsm:VisualStateGroup> |
| <vsm:VisualStateGroup x:Name="EditingStates"> |
| <vsm:VisualState x:Name="Edited"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentPresenter" Storyboard.TargetProperty="Margin"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="0" /> |
| </ObjectAnimationUsingKeyFrames> |
| <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentPresenter" Storyboard.TargetProperty="VerticalAlignment"> |
| <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch" /> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| <vsm:VisualState x:Name="Display" /> |
| </vsm:VisualStateGroup> |
| <vsm:VisualStateGroup x:Name="DisabledStates"> |
| <vsm:VisualState x:Name="Enabled" /> |
| <vsm:VisualState x:Name="Disabled"> |
| <Storyboard> |
| <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_CellBorder" Storyboard.TargetProperty="Background"> |
| <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BzGridViewDisabledBackground}" /> |
| </ObjectAnimationUsingKeyFrames> |
| <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_CellBorder" Storyboard.TargetProperty="BorderBrush"> |
| <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BzGridViewDisabledBorderBrush}" /> |
| </ObjectAnimationUsingKeyFrames> |
| </Storyboard> |
| </vsm:VisualState> |
| </vsm:VisualStateGroup> |
| </vsm:VisualStateManager.VisualStateGroups> |
| <grid:AlignmentContentPresenter |
| x:Name="PART_ContentPresenter" |
| Margin="{TemplateBinding Padding}" |
| Visibility="Visible" |
| Content="{TemplateBinding Content}" |
| ContentTemplate="{TemplateBinding ContentTemplate}" |
| VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
| HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
| TextAlignment="{TemplateBinding TextAlignment}" |
| TextWrapping="{TemplateBinding TextWrapping}" |
| TextDecorations="{TemplateBinding TextDecorations}" |
| /> |
| </Border> |
| </ControlTemplate> |
| <Style x:Key="BzCellStyle" TargetType="grid:GridViewCell"> |
| <Setter Property="Template" Value="{StaticResource BzGridViewCellTemplate}"/> |
| <Setter Property="Padding" Value="3,0,1,0"/> |
| <Setter Property="BorderBrush" Value="{StaticResource BzGridLinesFill}"/> |
| <Setter Property="BorderThickness" Value="0,0,1,0" /> |
| <Setter Property="VerticalContentAlignment" Value="Center" /> |
| <Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
| <Setter Property="Background" Value="Transparent" /> |
| <Setter Property="FontSize" Value="10"/> |
| </Style> |
| </UserControl.Resources> |
| <Grid x:Name="LayoutRoot"> |
| <controls:RadGridView x:Name="_grid" AutoGenerateColumns="False" IsReadOnly="True" RowStyle="{StaticResource BzGridViewRowStyle}" HeaderRowStyle="{StaticResource BzHeaderRowStyle}"> |
| <controls:RadGridView.Columns> |
| <controls:GridViewDataColumn IsFilterable="False" UniqueName="Test" Header="Test" CellStyle="{StaticResource BzCellStyle}" HeaderCellStyle="{StaticResource BzHeaderCellStyle}"> |
| </controls:GridViewDataColumn> |
| </controls:RadGridView.Columns> |
| </controls:RadGridView> |
| </Grid> |
| </UserControl> |
Here is my code-behind:
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Net; |
| using System.Windows; |
| using System.Windows.Controls; |
| using System.Windows.Documents; |
| using System.Windows.Input; |
| using System.Windows.Media; |
| using System.Windows.Media.Animation; |
| using System.Windows.Shapes; |
| using Telerik.Windows.Controls; |
| namespace RadControlsSilverlightApplication |
| { |
| public partial class MainPage : UserControl |
| { |
| public MainPage() |
| { |
| StyleManager.ApplicationTheme = new VistaTheme(); // When this is commented out everything works |
| InitializeComponent(); |
| this._grid.ItemsSource = new Data[] { |
| new Data() { Test = "Test 1" }, |
| new Data() { Test = "Test 2" }, |
| new Data() { Test = "Test 3" }, |
| new Data() { Test = "Test 4" } |
| }; |
| } |
| } |
| public class Data |
| { |
| public string Test { get; set; } |
| } |
| } |
Thanks,
Chris