I ran into a small issue while using the expander control in a window without a border. The issue is that when the expand button is clicked the control seems to jump to the expanded state, then jump back to the collapsed state and then play the expand animation. This only occurs with the following window properties:
- "WindowStyle="None""
- "AllowsTransparency="True""
My question is this; has anyone come across this and found a good way around? We could probably create another animation and/or control, but it would be great if we can stay as close to the stock standard Telerik controls as possible.
Thanks in advance.
The code below is from the example here but with a removed window border
<Window x:Class="ExpanderSample.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" WindowStyle="None" AllowsTransparency="True" SizeToContent="WidthAndHeight" Height="350" Width="525"> <Window.Resources> <Style TargetType="telerik:RadExpander"> <Setter Property="telerik:AnimationManager.AnimationSelector"> <Setter.Value> <telerik:AnimationSelector> <telerik:ExpanderExpandCollapseAnimation AnimationName="Expand" Direction="In" TargetElementName="Content" SpeedRatio="0.3" /> <telerik:ExpanderExpandCollapseAnimation AnimationName="Collapse" Direction="Out" TargetElementName="Content" SpeedRatio="0.3" /> </telerik:AnimationSelector> </Setter.Value> </Setter> </Style> </Window.Resources> <Grid> <Grid.RowDefinitions> <RowDefinition Height="150"/> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="20" /> </Grid.RowDefinitions> <telerik:RadExpander Header="MyHeader" Grid.Row="1" IsExpanded="False" VerticalContentAlignment="Top" HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch" > <telerik:RadExpander.Content > <Grid Name="ContentGrid" Height="Auto"> <Grid.RowDefinitions> <RowDefinition Height="20"/> <RowDefinition Height="20" /> <RowDefinition Height="20" /> <RowDefinition Height="20" /> </Grid.RowDefinitions> <TextBox Grid.Row="0" >my content</TextBox> <TextBox Grid.Row="1" >my content</TextBox> <TextBox Grid.Row="2" >my content</TextBox> </Grid> </telerik:RadExpander.Content> </telerik:RadExpander> </Grid></Window>