Telerik Forums
UI for WPF Forum
1 answer
241 views
First I created a dummy control on the stage.
I have edited a copy and have a Pane Header Style in a resource dictionary.
All I want to do is change the background of the pane header as in the attached image shows.

How do I apply it to the Pane Header?


Here is the style I created

<Style x:Key="PaneHeaderStyle1" TargetType="{x:Type telerik:PaneHeader}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:PaneHeader}">
<Border x:Name="Root" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1,1,0,0">
<Border.Background>
<ImageBrush ImageSource="/APLPromoter.UI.Wpf;component/Resources/Images/BlankButtons/BlankMessageCenterHeader.png"/>
</Border.Background>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommandsMenuStates">
<VisualState x:Name="CommandsMenuNormalState"/>
<VisualState x:Name="CommandsMenuHiddenState">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HeaderDropDownMenu">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="PinnedStates">
<VisualState x:Name="Unpinned">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HeaderUnPinButton">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="HeaderPinButton">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pinned"/>
</VisualStateGroup>
<VisualStateGroup x:Name="HighlightStates">
<VisualState x:Name="NotHighlighted"/>
<VisualState x:Name="Highlighted">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Content">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Color="#FFABABAB" Offset="0"/>
<GradientStop Color="#FFF2F2F2" Offset="1"/>
</LinearGradientBrush>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="Content">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentControl x:Name="TitleElement" ContentTemplate="{Binding SelectedPane.TitleTemplate, RelativeSource={RelativeSource TemplatedParent}}" Content="{Binding SelectedPane.Title, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" HorizontalContentAlignment="Stretch" Margin="{TemplateBinding Padding}" VerticalAlignment="Center" VerticalContentAlignment="Center"/>
<telerik:RadToggleButton x:Name="HeaderDropDownMenu" Grid.Column="1" CommandParameter="{Binding SelectedPane, RelativeSource={RelativeSource TemplatedParent}}" Command="telerik:RadDockingCommands.ContextMenuOpen" IsThreeState="True" InnerCornerRadius="0">
<telerik:RadToggleButton.Style>
<Style TargetType="{x:Type telerik:RadToggleButton}">
<Setter Property="Width" Value="17"/>
<Setter Property="Height" Value="17"/>
<Setter Property="Margin" Value="0,2,2,1"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="#FF8D8D8D"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="Black"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="Black"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Chromes:ButtonChrome x:Name="ButtonChrome" RenderNormal="False" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderChecked="{TemplateBinding IsChecked}">
<telerik:StyleManager.Theme>
<telerik:Office_BlackTheme/>
</telerik:StyleManager.Theme>
</Chromes:ButtonChrome>
<Path x:Name="BackgroundIcon" Data="M0,0L7,0 7,1 6,1 6,2 5,2 5,3 4,3 4,4 3,4 3,3 2,3 2,2 1,2 1,1 0,1z" Fill="White" Height="4" Margin="0,2,0,0" Width="7"/>
<Path x:Name="ForegroundIcon" Data="M0,0L7,0 7,1 6,1 6,2 5,2 5,3 4,3 4,4 3,4 3,3 2,3 2,2 1,2 1,1 0,1z" Fill="Black" Height="4" Margin="0,1" Width="7"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:RadToggleButton.Style>
</telerik:RadToggleButton>
<Grid Grid.Column="2" Visibility="{Binding SelectedPane.PinButtonVisibility, RelativeSource={RelativeSource TemplatedParent}}">
<telerik:RadButton x:Name="HeaderPinButton" CommandParameter="{Binding SelectedPane, RelativeSource={RelativeSource TemplatedParent}}" Command="telerik:RadDockingCommands.Pin" InnerCornerRadius="0">
<telerik:RadButton.Style>
<Style TargetType="{x:Type telerik:RadButton}">
<Setter Property="Width" Value="17"/>
<Setter Property="Height" Value="17"/>
<Setter Property="Margin" Value="0,2,2,1"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:RadButton}">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="#FF8D8D8D"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="Black"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="Black"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Chromes:ButtonChrome RenderNormal="False" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}">
<telerik:StyleManager.Theme>
<telerik:Office_BlackTheme/>
</telerik:StyleManager.Theme>
</Chromes:ButtonChrome>
<Path x:Name="BackgroundIcon" Data="M0,6.5L7,6.5 M1.5,6.5L1.5,1.5 2.5,0.5 4.5,0.5 5.5,1.5 5.5,6.5 M3.5,6.5L3.5,10 M4.5,6.5L4.5,0.5" Height="10" Margin="0,2,0,0" Stroke="White" StrokeThickness="1" Width="7"/>
<Path x:Name="ForegroundIcon" Data="M0,6.5L7,6.5 M1.5,6.5L1.5,1.5 2.5,0.5 4.5,0.5 5.5,1.5 5.5,6.5 M3.5,6.5L3.5,10 M4.5,6.5L4.5,0.5" Height="10" Margin="0,1" Stroke="Black" StrokeThickness="1" Width="7"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:RadButton.Style>
</telerik:RadButton>
<telerik:RadButton x:Name="HeaderUnPinButton" CommandParameter="{Binding SelectedPane, RelativeSource={RelativeSource TemplatedParent}}" Command="telerik:RadDockingCommands.Pin" InnerCornerRadius="0" Visibility="Collapsed">
<telerik:RadButton.Style>
<Style TargetType="{x:Type telerik:RadButton}">
<Setter Property="Width" Value="17"/>
<Setter Property="Height" Value="17"/>
<Setter Property="Margin" Value="0,2,2,1"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:RadButton}">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="#FF8D8D8D"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="Black"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="Black"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Chromes:ButtonChrome RenderNormal="False" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}">
<telerik:StyleManager.Theme>
<telerik:Office_BlackTheme/>
</telerik:StyleManager.Theme>
</Chromes:ButtonChrome>
<Path x:Name="BackgroundIcon" Data="M3.5,0L3.5,7 M3.5,1.5L8.5,1.5 9.5,2.5 9.5,4.5 8.5,5.5 3.5,5.5 M3.5,3.5L0,3.5 M3.5,4.5L9.5,4.5" Height="7" Margin="0,2,0,0" Stroke="White" StrokeThickness="1" Width="10"/>
<Path x:Name="ForegroundIcon" Data="M3.5,0L3.5,7 M3.5,1.5L8.5,1.5 9.5,2.5 9.5,4.5 8.5,5.5 3.5,5.5 M3.5,3.5L0,3.5 M3.5,4.5L9.5,4.5" Height="7" Margin="0,1" Stroke="Black" StrokeThickness="1" Width="10"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:RadButton.Style>
</telerik:RadButton>
</Grid>
<telerik:RadButton x:Name="HeaderCloseButton" Grid.Column="3" CommandParameter="{Binding SelectedPane, RelativeSource={RelativeSource TemplatedParent}}" Command="telerik:RadDockingCommands.Close" InnerCornerRadius="0">
<telerik:RadButton.Style>
<Style TargetType="{x:Type telerik:RadButton}">
<Setter Property="Width" Value="17"/>
<Setter Property="Height" Value="17"/>
<Setter Property="Margin" Value="0,2,2,1"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:RadButton}">
<Grid x:Name="LayoutRoot">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="#FF8D8D8D"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="Black"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ForegroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="Black"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="BackgroundIcon">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<SolidColorBrush Color="White"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Chromes:ButtonChrome RenderNormal="False" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}">
<telerik:StyleManager.Theme>
<telerik:Office_BlackTheme/>
</telerik:StyleManager.Theme>
</Chromes:ButtonChrome>
<Path x:Name="BackgroundIcon" Data="M0,0L2,0 2,1 3,1 3,2 5,2 5,1 6,1 6,0 8,0 8,1 7,1 7,2 6,2 6,3 5,3 5,4 6,4 6,5 6,5 7,5 7,6 8,6 8,7 6,7 6,6 5,6 5,5 3,5 3,6 2,6 2,7 0,7 0,6 1,6 1,5 2,5 2,4 3,4 3,3 2,3 2,2 1,2 1,1 0,1z" Fill="White" Height="7" Margin="0,2,0,0" Width="8"/>
<Path x:Name="ForegroundIcon" Data="M0,0L2,0 2,1 3,1 3,2 5,2 5,1 6,1 6,0 8,0 8,1 7,1 7,2 6,2 6,3 5,3 5,4 6,4 6,5 6,5 7,5 7,6 8,6 8,7 6,7 6,6 5,6 5,5 3,5 3,6 2,6 2,7 0,7 0,6 1,6 1,5 2,5 2,4 3,4 3,3 2,3 2,2 1,2 1,1 0,1z" Fill="Black" Height="7" Margin="0,1" Width="8"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:RadButton.Style>
</telerik:RadButton>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="BorderThickness" Value="0,0,0,1"/>
<Setter Property="BorderBrush" Value="#FFA0A0A0"/>
<Setter Property="Background" Value="#FFF2F2F2"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="telerik:InputBindingsManager.InputBindings">
<Setter.Value>
<InputBindingCollection>
<MouseBinding Command="telerik:RadDockingCommands.PaneHeaderMenuOpen" MouseAction="RightClick">
<MouseBinding.Gesture>
<MouseGesture MouseAction="RightClick" Modifiers=""/>
</MouseBinding.Gesture>
</MouseBinding>
</InputBindingCollection>
</Setter.Value>
</Setter>
</Style>


Kalin
Telerik team
 answered on 18 Mar 2014
3 answers
220 views
Hello,
I'm trying to put a list of recent items in the backstage, using the Office2013 theme.
The problem is, when the list is too long for the window, a vertical scroll bar is displayed to scroll all the backstage.It seems that the backstage is inside a ScrollViewer and so its size is infinite, so the ListBox containing the recent items has never a change to display its own scroll bar.
Is there something to do to avoid this problem?
Patrick
Kiril Vandov
Telerik team
 answered on 18 Mar 2014
1 answer
161 views
I can't figure out what the exact cause of this is. I have a wpf project which uses the RadPdfViewer. To Print I'm using the PrintPdfDocumentCommand. Running the project from visual studio (in debug or release) the pdf's print without a problem. When I publish the project and install it on my local machine I get an exception when trying to print. I click the "print" icon on the toolbar and the dialog window opens. I select my printer and click "print" on the dialog window, that is the program crashes from an exception (see stack trace below). The strange thing is, if the pdf file that is failing to print is in the same location as the programs executable it will print fine. This crash only happens when the pdf file's location is outside the directory of where the programs executable lives.  

StackTrace: System.ObjectDisposedException: Cannot access a closed file.
   at System.IO.__Error.FileNotOpen()
   at System.IO.FileStream.get_Position()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.Readers.PdfReaderBase.get_Position()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.Parsers.PdfParser.ReadIndirectObject(Int64 offset, Boolean isEncrypted)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.PdfContentManager.ReadIndirectObject(IndirectReference fromRef, Boolean isEncrypted)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.PdfContentManager.ReadData(IndirectReference reference)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.PdfContentManager.ReadDataFromAsyncCall(IndirectReference reference)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.PdfResourceManager.GetGlobalImageSource(ResourceKey key)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.PdfResourceManager.GetImageSource(ResourceKey key)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.GetImageSource(ResourceKey key)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.GetImageSource(Image image)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawImage(DrawingContext drawingContext, ContentElementsPainterInitializeContext context, Image image)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawImage(DrawingContext drawingContext, Image image)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawContentElement(DrawingContext drawingContext, IContentElement contentElement)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawContainer(DrawingContext drawingContext, Container container)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawContentElement(DrawingContext drawingContext, IContentElement contentElement)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawContainer(DrawingContext drawingContext, Container container)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawContentElement(DrawingContext drawingContext, IContentElement contentElement)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.OnRender(DrawingContext dc)
   at System.Windows.UIElement.Arrange(Rect finalRect)
(cont...)

Alexander
Telerik team
 answered on 18 Mar 2014
1 answer
139 views
Hi,

I want to create a feature similar to Office where showing a context menu will also create a small context-specific floating toolbar nearby. I could start to hand-craft this but wanted to ask here first and see if my RadControls for WPF already has this capability. Basically I want control.ContextMenu = myMenuObj; control.ContextToolbar = myToolbarObj; and the two are tied together such that closing the context menu also hides the context toolbar.

Any suggestions?

John
Petar Mladenov
Telerik team
 answered on 18 Mar 2014
1 answer
140 views
Hello,
I'me using Windows and WPF controls and sometimes get this exception in VS XAML designer

System.Reflection.Adds.UnresolvedAssemblyException
Type universe cannot resolve assembly: Telerik.WinControls.GridView, Version=2013.3.1016.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e.

I can't find this assembly in my Telerik install. What am I missing?
Thanks.
Yana
Telerik team
 answered on 18 Mar 2014
1 answer
124 views
Hi,

I saw this text on a Tips and Tricks page (http://www.telerik.com/help/silverlight/radgridview-performance-tips-tricks.html):

Try not to place RadGridView in controls/panels which will measure it with infinity. For example, ScrollViewer, StackPanel and Grid with Row.Height=Auto or Column.Width=Auto will measure with infinity. If RadGridView is measured with infinity the virtualization turns off. Also setting RadGridView.ColumnWidth to a specific width (like 100) will increase both horizontal & vertical scrolling performance. Auto is a little bit slower and Star is the slowest (most noticeable when you have a lot of columns).

What I normally do, is this:

<Grid>
  <Grid.RowDefinitions>
            <RowDefinition Height="Auto " />
            <RowDefinition Height="*" />
          <RowDefinition Height="Auto " />
          </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

 
<Custom ToolBar Grid.Row="0" />
  <RadGridView Grid.Row="1"  />
 <StatusBar Grid.Row="2" />
</Grid>

But it seems that the tip-and-trick above tells me that this is a bad idea when it comes to performance.
But I am bit at a loss on what to do, then. I want the GridView how have only the available space. If I cannot use the stackpanel or grid, then how? Dockpanel?

I've googled a lot of answers to problems with infinity, but has been unable to spot a solution without Auto or Star.. Seems like everyone knows how to fix it without having it spelled out..  like me :-) ... Help will be appreciated!
Hristo
Telerik team
 answered on 17 Mar 2014
3 answers
336 views
I have a two columns with buttons in them:
public class GridViewButtonColumn : Telerik.Windows.Controls.GridViewColumn

Based on the data in the row, I need to enable or disable one of those two buttons.  So, I have a Boolean value on the row but I haven't figured out how to use that value to bind the IsEnabled property of the button. 

Appreciate your help,
Joel

PS.  A code example is always welcome.

public class GridViewButtonColumn : Telerik.Windows.Controls.GridViewColumn
    {
        public event ActionRequest ActionRequestEvent;
 
        private System.Drawing.Bitmap _image = null;
 
        public System.Drawing.Bitmap Image
        {
            get
            {
                return _image;
            }
            set
            {
                if (_image != value)
                {
                    _image = value;
                }
            }
        }
         
        public GridViewButtonColumn()
        {
        }
 
        public GridViewButtonColumn(
            System.Drawing.Bitmap image)
        {
            Image = image;
        }
        /// <summary>
        /// WPF RadGridView Custom Column - Capture & Set Control Properties
        /// </summary>
        /// <param name="cell"></param>
        /// <param name="dataItem"></param>
        /// <returns></returns>
        public override FrameworkElement CreateCellElement(
            GridViewCell cell,
            object dataItem)
        {
            RadButton btn = new RadButton()
            {
                Content = new Image()
                {
                    Source = ImageHelper.LoadBitmap(Image)
                }
            };
            btn.Click += btn_Click;
            return btn;
        }
 
        void btn_Click(
            object sender,
            RoutedEventArgs e)
        {
            try
            {
                ExceptionHelper.TestNull(ActionRequestEvent, "Button Click Event Handler");
 
                Button btn = sender as Button;
                RadGridView grid = btn.ParentOfType<RadGridView>();
                 
                ActionRequestEvent(sender,
                    new ActionRequestEventArgs(
                        new ContextItem()
                        {
                            Control = grid.GetType(),
                            Action = ProcessAction.Start,
                        })
                    {
                        Data = btn.DataContext,
                        Sender = grid
                    });
            }
            catch (Exception ex)
            {
                exceptionHandler(ex);
            }
        }

Nick
Telerik team
 answered on 17 Mar 2014
1 answer
462 views
I would like to highlight items in my charts when a user moves the mouse over them. For example, placing a border around a bar on a bar series or changing the color of a data point on a line series. When the user moves the mouse off of the item then it would return to it's normal appearance. Does anyone know how I can achieve this?
Martin Ivanov
Telerik team
 answered on 17 Mar 2014
4 answers
135 views
Hi,

I have a RadMap with many ellipse (created from EllipseData) and I would like to display text beside the left border of these ellipse.
I have been able to do something like this with a MapEllipseGeometry (that have a CaptionLocation) in an InformationLayer, but I wonder if it's possible to do this with ShapeData in VisualizationLayer.

Thank you!

Andrey
Telerik team
 answered on 17 Mar 2014
1 answer
209 views
When using the RadRibbonWindow in combination with RadRibbonView, I have an odd problem with the position of the quick access toolbar, and the title/application name. For some reason they become positioned below the title bar. See attached screen shots.

From my tests it appears, that the problem is only present when the property IsBackstageOpen is binded, and the property CollapseThresholdSize is
set. Removing CollapseThresholdSize solves the problem?

I can recreate the problem using this XAML:

<telerik:RadRibbonWindow x:Class="TelerikRibbon.MainWindow"
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.RibbonView"
        xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
       Title="Window title should not be displayed"
>
    <Grid>
        <telerik:RadRibbonView Title="RibbonView Title" ApplicationName="My Application" IsBackstageOpen="{Binding ShowBackStage}" CollapseThresholdSize="100,100" VerticalAlignment="Top"  ApplicationButtonContent="Fil" >
 
 
            <telerik:RadRibbonView.QuickAccessToolBar>
                <telerik:QuickAccessToolBar CustomizationMenuVisibility="Collapsed">
                    <telerik:RadRibbonButton Text="Open" SmallImage="/Images/Icons/open.png" Size="Small" />
                </telerik:QuickAccessToolBar>
            </telerik:RadRibbonView.QuickAccessToolBar>
 
            <!-- Backstage section-->
            <telerik:RadRibbonView.Backstage>
                <telerik:RadRibbonBackstage>
                    <!-- Save-->
                    <telerik:RadRibbonBackstageItem Header="Click here to save" Icon="/Images/Icons/save.png" CloseOnClick="True" IsSelectable="true" />
                </telerik:RadRibbonBackstage>
            </telerik:RadRibbonView.Backstage>
 
            <telerik:RadRibbonTab Header="Home">
                <telerik:RadRibbonGroup Header="Clipboard">
                    <telerik:RadRibbonSplitButton
                                                  Size="Large"
                                                  Text="Paste"
                                                  telerik:ScreenTip.Description="Paste the contents the Clipboard."
                                                  telerik:ScreenTip.Title="Paste(Ctrl+V)">
                        <telerik:RadRibbonSplitButton.DropDownContent>
                            <controls:RadContextMenu BorderThickness="0">
                                <controls:RadMenuItem Header="Paste" />
                                <controls:RadMenuItem Header="Paste Form" />
                            </controls:RadContextMenu>
                        </telerik:RadRibbonSplitButton.DropDownContent>
                    </telerik:RadRibbonSplitButton>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="View" />
        </telerik:RadRibbonView>
    </Grid>
</telerik:RadRibbonWindow>


Tina Stancheva
Telerik team
 answered on 17 Mar 2014
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?