The Tim Sneath Challenge II
August 17, 2006
Roscoe, NY
Here's another single-element XAML file that meets the Tim Sneath challenge. You can run or download ExpandingScrollBar.xaml or gaze upon it here:
-
<!-- ExpandingScrollBar.xaml by Charles Petzold -->
<ScrollBar xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Name="scroll"
Orientation="Horizontal"
Margin="10"
Minimum="20"
Maximum="300"
SmallChange="1"
LargeChange="20"
Height="{Binding ElementName=scroll, Path=Value}" />
The scrollbar's Height property is bound to its own Value property so as you manipulate the scrollbar it expands in size. (Some may shrug, but I'm astounded this works as well as it does.)