
Calendar, Slider and ScrollBar Controls
Silverlight provides two controls that allow users to select a day of the month. The Calendar control represents a UI
surface displaying months / years. The DatePicker is similar; however the calendar is only displayed when clicking the
drop down arrow. Both of these controls are in the System.Windows.Controls.Extended.dll assembly, therefore you
must define a custom xmlns/clr-namespace attribute to define them in XAML.
<UserControl x:Class="FunWithSLControls.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ext=
"clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
Width="400" Height="300">
<StackPanel x:Name="LayoutRoot" Background="White">
<!-- Notice the custom XMLNS tag prefix -->
<ext:Calendar x:Name="myCalendar" IsTodayHighlighted="True"
FirstDayOfWeek="Monday"/>
<ext:DatePicker x:Name="myDatePicker" Width="200" />
</StackPanel>
</UserControl>
Silverlight also supports a Slider control and a standard ScrollBar control to define a range. Each control supports
numerous properties (Minimum, Maximum, etc) to establish upper and lower bounds.
<UserControl x:Class="FunWithSLControls.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<StackPanel>
<Slider Minimum="0" Maximum="100" LargeChange="1" SmallChange="1" Value="50"/>
<ScrollBar Minimum="0" Maximum="100" LargeChange="1" SmallChange="1"
Value="50"/>
</StackPanel>
</UserControl>
Calendar, Slider and ScrollBar Controls
Table of Contents
Copyright (c) 2008. Intertech, Inc. All Rights Reserved. This information is to be used exclusively as an
online learning aid. Any attempts to copy, reproduce, or use for training is strictly prohibited.
Courseware
Training Resources
Tutorials
Services