RichTextBox UI elements animating??
-
I have a RichTextBox in my app, which is inside a control that is composed of a grid with 2 columnds, i.e.
<Grid x:Name="LayoutRoot"
VerticalAlignment="Top" Height="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border x:Name="bdrLeft" Height="Auto"
Background="{DynamicResource SplitRichTextBoxRightSideBGBrush}"
BorderBrush="{DynamicResource SplitRichTextBoxRightSideBorderBrush}"
BorderThickness="1,1,0,1"
CornerRadius="3,0,0,3"
VerticalAlignment="Stretch">
<ContentPresenter x:Name="cpRightSide"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Margin="0,0,0,0"
Width="Auto"
Height="Auto"
TextElement.Foreground="{DynamicResource SplitRichTextBoxLeftSideForegroundBrush}"/>
</Border>
<Border x:Name="bdrRight"
Height="Auto"
Grid.Column="1"
Background="{DynamicResource TextBoxBGBrush}"
BorderBrush="{DynamicResource TextBoxBorderBrush}"
BorderThickness="1,1,1,1"
CornerRadius="0,3,3,0"/>
<RichTextBox x:Name="rtbMain"
HorizontalAlignment="Center"
FontSize="{DynamicResource DefaultFontSize}"
Height="Auto"
BorderBrush="Transparent"
Background="Transparent"
Foreground="{DynamicResource DEFAULT_Font_Dark}"
VerticalAlignment="Center"
AcceptsReturn="False"
AcceptsTab="False"
Style="{DynamicResource ClearRichTextBoxStyle}"
Grid.Column="1"
Margin="0,3,0,3">
<localControl:EnabledFlowDocument x:Name="efdMainDocument" PageWidth="{Binding ElementName=rtbMain, Path=ActualWidth}"/>
</RichTextBox>
</Grid>All the animations in the code are set to 00:00:00.00 However, when I add a UIElement or even text to the FlowDocument on startup, the text/uielement appear in the center of the flowdocument, then animate over to the left side where they should be. Is this a bug in WPF? I can't find anything in my code that would cause this.
-
I have a RichTextBox in my app, which is inside a control that is composed of a grid with 2 columnds, i.e.
<Grid x:Name="LayoutRoot"
VerticalAlignment="Top" Height="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border x:Name="bdrLeft" Height="Auto"
Background="{DynamicResource SplitRichTextBoxRightSideBGBrush}"
BorderBrush="{DynamicResource SplitRichTextBoxRightSideBorderBrush}"
BorderThickness="1,1,0,1"
CornerRadius="3,0,0,3"
VerticalAlignment="Stretch">
<ContentPresenter x:Name="cpRightSide"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Margin="0,0,0,0"
Width="Auto"
Height="Auto"
TextElement.Foreground="{DynamicResource SplitRichTextBoxLeftSideForegroundBrush}"/>
</Border>
<Border x:Name="bdrRight"
Height="Auto"
Grid.Column="1"
Background="{DynamicResource TextBoxBGBrush}"
BorderBrush="{DynamicResource TextBoxBorderBrush}"
BorderThickness="1,1,1,1"
CornerRadius="0,3,3,0"/>
<RichTextBox x:Name="rtbMain"
HorizontalAlignment="Center"
FontSize="{DynamicResource DefaultFontSize}"
Height="Auto"
BorderBrush="Transparent"
Background="Transparent"
Foreground="{DynamicResource DEFAULT_Font_Dark}"
VerticalAlignment="Center"
AcceptsReturn="False"
AcceptsTab="False"
Style="{DynamicResource ClearRichTextBoxStyle}"
Grid.Column="1"
Margin="0,3,0,3">
<localControl:EnabledFlowDocument x:Name="efdMainDocument" PageWidth="{Binding ElementName=rtbMain, Path=ActualWidth}"/>
</RichTextBox>
</Grid>All the animations in the code are set to 00:00:00.00 However, when I add a UIElement or even text to the FlowDocument on startup, the text/uielement appear in the center of the flowdocument, then animate over to the left side where they should be. Is this a bug in WPF? I can't find anything in my code that would cause this.