Hi,
We recently upgraded to the latest version on 2011 RAD Controls for Silverlight.
Code:
<telerik:RadExpander Name="Expander" Style="{StaticResource DefaultRadExpanderStyleNew}"
In the Dictionary.xaml file, we have
<Style x:Key="DefaultRadExpanderStyleNew" TargetType="telerik:RadExpander">
<Setter Property="ExpandDirection" Value="Down"/>
<Setter Property="IsExpanded" Value="True"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="HeaderControlTemplate" Value="{StaticResource DefaultradExpanderHeaderControlTemplate}"/>
</Style>
<ControlTemplate x:Key="DefaultradExpanderHeaderControlTemplate" TargetType="telerik:RadExpanderHeader">
<Grid >
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#D8D8D9" Offset="0" />
<GradientStop Color="#F4F5F5" Offset="1" />
</LinearGradientBrush>
</Grid.Background>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Expanded"/>
<VisualState x:Name="Collapsed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
Storyboard.TargetName="expandedImage">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
Storyboard.TargetName="collapsedImage">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<TextBlock Height="15" Margin="8,0,0,0" FontSize="11" FontFamily="Verdana" FontWeight="Bold" Foreground="#444444" Text="{TemplateBinding Content}" />
<Image x:Name="expandedImage" HorizontalAlignment="Right" Margin="0,0,5,0" Source="/Common;component/Images/DOWN.png" Stretch="Fill" Height="10" Width="10"/>
<Image x:Name="collapsedImage" HorizontalAlignment="Right" Margin="0,0,5,0" Source="/Common;component/Images/UP.png" Height="10" Width="10" Stretch="Fill" Visibility="Collapsed" />
</Grid>
</ControlTemplate>
This does not seem to work. I read that the HeaderControl is obsolete but I'm not able to find the correct implementation.
Could you please help?
Thanks
Rajinder
We recently upgraded to the latest version on 2011 RAD Controls for Silverlight.
Code:
<telerik:RadExpander Name="Expander" Style="{StaticResource DefaultRadExpanderStyleNew}"
In the Dictionary.xaml file, we have
<Style x:Key="DefaultRadExpanderStyleNew" TargetType="telerik:RadExpander">
<Setter Property="ExpandDirection" Value="Down"/>
<Setter Property="IsExpanded" Value="True"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="HeaderControlTemplate" Value="{StaticResource DefaultradExpanderHeaderControlTemplate}"/>
</Style>
<ControlTemplate x:Key="DefaultradExpanderHeaderControlTemplate" TargetType="telerik:RadExpanderHeader">
<Grid >
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#D8D8D9" Offset="0" />
<GradientStop Color="#F4F5F5" Offset="1" />
</LinearGradientBrush>
</Grid.Background>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Expanded"/>
<VisualState x:Name="Collapsed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
Storyboard.TargetName="expandedImage">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
Storyboard.TargetName="collapsedImage">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<TextBlock Height="15" Margin="8,0,0,0" FontSize="11" FontFamily="Verdana" FontWeight="Bold" Foreground="#444444" Text="{TemplateBinding Content}" />
<Image x:Name="expandedImage" HorizontalAlignment="Right" Margin="0,0,5,0" Source="/Common;component/Images/DOWN.png" Stretch="Fill" Height="10" Width="10"/>
<Image x:Name="collapsedImage" HorizontalAlignment="Right" Margin="0,0,5,0" Source="/Common;component/Images/UP.png" Height="10" Width="10" Stretch="Fill" Visibility="Collapsed" />
</Grid>
</ControlTemplate>
This does not seem to work. I read that the HeaderControl is obsolete but I'm not able to find the correct implementation.
Could you please help?
Thanks
Rajinder