I have a sample application I am using to highlight this issue.
In essence, I want to create a button that will automatically scroll the content when the content is too large to fit in the button, in this case text. To achieve this, I am trying to add a content element that is too large to fit in the container, and then using a StoryBoard to animate a TranslateTransform, as illustrated in this code:
<Button VerticalAlignment="Center" HorizontalAlignment="Center" Width="75">
<TextBlock HorizontalAlignment="Left" Text="LOTS OF TEXT IN A LONG STRING">
<TextBlock.RenderTransform>
<TranslateTransform x:Name="MyTransform"/>
</TextBlock.RenderTransform>
<TextBlock.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever">
<DoubleAnimation From="0" To="-180" Storyboard.TargetName="MyTransform" Storyboard.TargetProperty="X" Duration="0:0:5"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>
</Button>
If you run this in a blank project, you would only see the first 3 words being scrolled, with the rest of the text missing. As well, you would see the text outside of the element, and not hidden when it leaves the parent container's bounds.
How do I get the rest of the text to show, and to hide the text not in the bounds of the parent container?