The team blog of the Expression Blend and Design products.
Hello! In this article, I’d like to provide you with some information and tips that you’ll find useful when styling a Silverlight 3 ScrollViewer.
Visual states. None
Template parts.
HorizontalScrollBar (ScrollBar) ScrollContentPresenter (ScrollContentPresenter) VerticalScrollBar (ScrollBar)
HorizontalScrollBar (ScrollBar)
ScrollContentPresenter (ScrollContentPresenter)
VerticalScrollBar (ScrollBar)
The following tips will help you out a bit:
Here’s some artwork you might want to try turning into a ScrollViewer:
The XAML that resembles the artwork is:
<Grid x:Name="root" Height="146" Width="146"> <Rectangle Fill="#FF333333" RadiusX="3" RadiusY="3" /> <Rectangle x:Name="content" Stroke="Black" Width="200" Height="200">
<Rectangle.Fill> <RadialGradientBrush> <GradientStop Color="White"/> <GradientStop Color="Black" Offset="1"/> </RadialGradientBrush> </Rectangle.Fill> </Rectangle>
<Grid x:Name="verticalscrollbar" Width="17" Height="146" HorizontalAlignment="Right" > <Rectangle x:Name="track" Fill="#FF3D3D3D" StrokeThickness="0" /> <Path x:Name="smalldecrease" Fill="Gray" Stretch="Fill" Width="7" Height="7" Data="M196.89876,311.82065 L204.06047,311.82065 L200.42426,304.87872 z" Margin="0,5,0,0" VerticalAlignment="Top"/> <Rectangle x:Name="thumb" Fill="Gray" RadiusX="3" RadiusY="3" Height="61" Width="7" Margin="0,24,0,0" VerticalAlignment="Top"/> <Path x:Name="smallincrease" Fill="Gray" Stretch="Fill" Width="7" Height="7" Data="M196.89876,304.83246 L200.52762,312.02783 L204.07646,304.83078 z" Margin="0,0,0,5" VerticalAlignment="Bottom" /> </Grid>
To create a real ScrollViewer out of your artwork, perform the following steps:
After you have done this, you should now have a working ScrollViewer!
- Steve
These tips are great for Silverlight apps, but most of the tools are missing for WPF apps - there's no Parts panel, "Make into Part" command, etc.
Are there any plans to post the equivalent steps for WPF apps, or to update Blend to fully support WPF?
Examples you show can be found in MS documentation:
msdn.microsoft.com/.../ee341456(v=expression.40).aspx