Click here to Skip to main content
15,879,474 members
Articles / Programming Languages / C#

An Introduction to the Silverlight samples in the All-In-One Framework

Rate me:
Please Sign up or sign in to vote.
5.00/5 (26 votes)
12 Dec 2009Ms-PL5 min read 55.1K   2.2K   56  
This article introduces several Silverlight samples in the All-In-One Framework.
<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" xmlns:local="clr-namespace:VBSL3DeepZoom" x:Class="VBSL3DeepZoom.Page"
    d:DesignHeight="291" d:DesignWidth="579">
	<UserControl.Resources>
		<ControlTemplate x:Key="zoomInTemplate" TargetType="Button">
			<Grid>
				<VisualStateManager.VisualStateGroups>
					<VisualStateGroup x:Name="FocusStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="00:00:00.1000000"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="Unfocused"/>
						<VisualState x:Name="Focused"/>
					</VisualStateGroup>
					<VisualStateGroup x:Name="CommonStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="00:00:00.1000000"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="MouseOver">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="normal" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="down" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="hover" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Normal"/>
						<VisualState x:Name="Pressed">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="normal" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="hover" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="down" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Disabled"/>
					</VisualStateGroup>
				</VisualStateManager.VisualStateGroups>
				<Image Height="26" x:Name="normal" Width="26" Stretch="Fill" Source="images/zoomin_rest.png"/>
				<Image Height="26" x:Name="down" Width="26" Opacity="0" Stretch="Fill" Source="images/zoomin_pressed.png"/>
				<Image Height="26" x:Name="hover" Width="26" Opacity="0" Stretch="Fill" Source="images/zoomin_hover.png"/>
			</Grid>
		</ControlTemplate>
		<ControlTemplate x:Key="zoomOutTemplate" TargetType="Button">
			<Grid>
				<VisualStateManager.VisualStateGroups>
					<VisualStateGroup x:Name="FocusStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="00:00:00.1000000"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="Unfocused"/>
						<VisualState x:Name="Focused"/>
					</VisualStateGroup>
					<VisualStateGroup x:Name="CommonStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="00:00:00.1000000"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="MouseOver">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="normal" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="down" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="hover" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Normal"/>
						<VisualState x:Name="Pressed">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="normal" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="hover" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="down" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Disabled"/>
					</VisualStateGroup>
				</VisualStateManager.VisualStateGroups>
				<Image Height="26" x:Name="normal" Width="26" Stretch="Fill" Source="images/zoomout_rest.png"/>
				<Image Height="26" x:Name="down" Width="26" Opacity="0" Stretch="Fill" Source="images/zoomout_pressed.png"/>
				<Image Height="26" x:Name="hover" Width="26" Opacity="0" Stretch="Fill" Source="images/zoomout_hover.png"/>
			</Grid>
		</ControlTemplate>
		<ControlTemplate x:Key="homeTemplate" TargetType="Button">
			<Grid>
				<VisualStateManager.VisualStateGroups>
					<VisualStateGroup x:Name="FocusStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="00:00:00.1000000"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="Unfocused"/>
						<VisualState x:Name="Focused"/>
					</VisualStateGroup>
					<VisualStateGroup x:Name="CommonStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="00:00:00.1000000"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="MouseOver">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="normal" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="down" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="hover" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Normal"/>
						<VisualState x:Name="Pressed">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="normal" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="hover" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="down" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Disabled"/>
					</VisualStateGroup>
				</VisualStateManager.VisualStateGroups>
				<Image Height="26" x:Name="normal" Width="26" Stretch="Fill" Source="images/home_rest.png"/>
				<Image Height="26" x:Name="down" Width="26" Opacity="0" Stretch="Fill" Source="images/home_pressed.png"/>
				<Image Height="26" x:Name="hover" Width="26" Opacity="0" Stretch="Fill" Source="images/home_hover.png"/>
			</Grid>
		</ControlTemplate>
		<ControlTemplate x:Key="fullScreenTemplate" TargetType="Button">
			<Grid>
				<VisualStateManager.VisualStateGroups>
					<VisualStateGroup x:Name="FocusStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="00:00:00.1000000"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="Unfocused"/>
						<VisualState x:Name="Focused"/>
					</VisualStateGroup>
					<VisualStateGroup x:Name="CommonStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="00:00:00.1000000"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="MouseOver">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="normal" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="down" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="hover" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Normal"/>
						<VisualState x:Name="Pressed">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="normal" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="hover" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="down" Storyboard.TargetProperty="(UIElement.Opacity)">
									<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Disabled"/>
					</VisualStateGroup>
				</VisualStateManager.VisualStateGroups>
				<Image Height="26" x:Name="normal" Width="26" Stretch="Fill" Source="images/fullscreen_rest.png"/>
				<Image Height="26" x:Name="down" Width="26" Opacity="0" Stretch="Fill" Source="images/fullscreen_pressed.png"/>
				<Image Height="26" x:Name="hover" Width="26" Opacity="0" Stretch="Fill" Source="images/fullscreen_hover.png"/>
			</Grid>
		</ControlTemplate>
		<Style x:Key="ProgressBarStyle1" TargetType="ProgressBar">
			<Setter Property="Foreground" Value="#FF027DB8"/>
			<Setter Property="Background" Value="#FFD2D5D8"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Maximum" Value="100"/>
			<Setter Property="IsTabStop" Value="False"/>
			<Setter Property="BorderBrush">
				<Setter.Value>
					<LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
						<GradientStop Color="#FFAEB7BF" Offset="0"/>
						<GradientStop Color="#FF919EA7" Offset="0.35"/>
						<GradientStop Color="#FF7A8A99" Offset="0.35"/>
						<GradientStop Color="#FF647480" Offset="1"/>
					</LinearGradientBrush>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ProgressBar">
						<Grid x:Name="Root">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Determinate">
										<Storyboard RepeatBehavior="Forever">
											<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Indicator" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
												<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
												<EasingDoubleKeyFrame KeyTime="00:00:02" Value="1"/>
											</DoubleAnimationUsingKeyFrames>
											<PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Indicator" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.EndPoint)">
												<EasingPointKeyFrame KeyTime="00:00:00" Value="-0.122,0.545"/>
												<EasingPointKeyFrame KeyTime="00:00:02" Value="1.413,0.545"/>
											</PointAnimationUsingKeyFrames>
											<PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Indicator" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.StartPoint)">
												<EasingPointKeyFrame KeyTime="00:00:00" Value="-0.491,0.545"/>
												<EasingPointKeyFrame KeyTime="00:00:02" Value="1.102,0.545"/>
											</PointAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Indeterminate"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="ProgressBarTrack" Margin="1" CornerRadius="3"/>
							<Border x:Name="IndeterminateRoot" Margin="1" Background="#FFFFCFCF" CornerRadius="2">
								<Border CornerRadius="2">
									<Border.Background>
										<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
											<GradientStop Color="Transparent" Offset="0"/>
											<GradientStop Color="Transparent" Offset="1"/>
											<GradientStop Color="White" Offset="0.497"/>
										</LinearGradientBrush>
									</Border.Background>
									<Border.Effect>
										<BlurEffect Radius="19"/>
									</Border.Effect>
									<Rectangle x:Name="Indicator">
										<Rectangle.Fill>
											<LinearGradientBrush EndPoint="0.192,0.545" StartPoint="-0.026,0.545">
												<GradientStop Color="#0000B0FF" Offset="0"/>
												<GradientStop Color="#0000B0FF" Offset="1"/>
												<GradientStop Color="#FF00B0FF" Offset="0.496"/>
											</LinearGradientBrush>
										</Rectangle.Fill>
									</Rectangle>
								</Border>
							</Border>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ToggleButtonStyle1" TargetType="ToggleButton">
			<Setter Property="Background" Value="#FF1F3B53"/>
			<Setter Property="Foreground" Value="#FFFFE800"/>
			<Setter Property="Padding" Value="3"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="BorderBrush">
				<Setter.Value>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="#FFA3AEB9" Offset="0"/>
						<GradientStop Color="#FF8399A9" Offset="0.375"/>
						<GradientStop Color="#FF718597" Offset="0.375"/>
						<GradientStop Color="#FF617584" Offset="1"/>
					</LinearGradientBrush>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ToggleButton">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver">
										<Storyboard>
											<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
												<EasingColorKeyFrame KeyTime="00:00:00" Value="#B2868686"/>
											</ColorAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(FrameworkElement.Margin)" Duration="00:00:00.0010000">
												<DiscreteObjectKeyFrame KeyTime="00:00:00">
													<DiscreteObjectKeyFrame.Value>
														<Thickness>5</Thickness>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
											<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
												<EasingColorKeyFrame KeyTime="00:00:00" Value="#FF868686"/>
												<EasingColorKeyFrame KeyTime="00:00:00.2000000" Value="#B2868686">
													<EasingColorKeyFrame.EasingFunction>
														<CircleEase EasingMode="EaseOut"/>
													</EasingColorKeyFrame.EasingFunction>
												</EasingColorKeyFrame>
											</ColorAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="CheckStates">
									<VisualState x:Name="Checked">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(FrameworkElement.Margin)">
												<DiscreteObjectKeyFrame KeyTime="00:00:00">
													<DiscreteObjectKeyFrame.Value>
														<Thickness>3</Thickness>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
											<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
												<EasingColorKeyFrame KeyTime="00:00:00" Value="#33003AFF"/>
											</ColorAnimationUsingKeyFrames>
											<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
												<EasingColorKeyFrame KeyTime="00:00:00" Value="#FF003AFF"/>
											</ColorAnimationUsingKeyFrames>
											<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
												<EasingColorKeyFrame KeyTime="00:00:00" Value="#FF003AFF"/>
											</ColorAnimationUsingKeyFrames>
											<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
												<EasingColorKeyFrame KeyTime="00:00:00" Value="#FF414141"/>
											</ColorAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Unchecked"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
									<VisualState x:Name="Unfocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="Background" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" Background="#FF868686">
								<Rectangle x:Name="rectangle" Margin="2" RadiusX="5" RadiusY="5">
									<Rectangle.Fill>
										<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
											<GradientStop Color="#B2FFFFFF" Offset="0"/>
											<GradientStop Color="#B2FFFFFF" Offset="1"/>
											<GradientStop Color="#FF003AFF" Offset="0.504"/>
										</LinearGradientBrush>
									</Rectangle.Fill>
								</Rectangle>
							</Border>
							<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="10,5"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
	<Grid x:Name="LayoutRoot" Background="#FFB1B1B1" Width="Auto" Height="Auto" MouseEnter="EnterMovie" MouseLeave="LeaveMovie">
		<VisualStateManager.VisualStateGroups>
			<VisualStateGroup x:Name="FadeButtons">
				<VisualStateGroup.Transitions>
					<VisualTransition GeneratedDuration="00:00:00.2000000"/>
				</VisualStateGroup.Transitions>
				<VisualState x:Name="FadeIn">
					<Storyboard>
						<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="buttonCanvas" Storyboard.TargetProperty="(UIElement.Opacity)">
							<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
						</DoubleAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
				<VisualState x:Name="FadeOut"/>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>

		<MultiScaleImage x:Name="msi" ViewportChanged="msi_ViewportChanged" UseSprings="False" Visibility="Collapsed"/>

		<Ellipse x:Name="ball" Width="30" Height="30" Margin="70,-86,0,0">
			<Ellipse.Fill>
				<RadialGradientBrush Center="0.311,0.544" GradientOrigin="0.258,0.04" RadiusX="0.69" RadiusY="0.498">
					<RadialGradientBrush.RelativeTransform>
						<TransformGroup>
							<ScaleTransform CenterX="0.31099998950958252" CenterY="0.54400002956390381"/>
							<SkewTransform AngleX="0" AngleY="0" CenterX="0.31099998950958252" CenterY="0.54400002956390381"/>
							<RotateTransform Angle="-13.253" CenterX="0.31099998950958252" CenterY="0.54400002956390381"/>
							<TranslateTransform/>
						</TransformGroup>
					</RadialGradientBrush.RelativeTransform>
					<GradientStop Color="White"/>
					<GradientStop Color="#FFFF7E00" Offset="1"/>
					<GradientStop Color="#FFFFA233" Offset="0.819"/>
				</RadialGradientBrush>
			</Ellipse.Fill>
			<Ellipse.RenderTransform>
				<TransformGroup>
					<MatrixTransform x:Name="ballTransform"/>
				</TransformGroup>
			</Ellipse.RenderTransform>
		</Ellipse>

		<Canvas Height="37" HorizontalAlignment="Right" Margin="0,0,8,8" x:Name="buttonCanvas" VerticalAlignment="Bottom" Width="348" Opacity="0" Background="{x:Null}">
			<Button Height="30" x:Name="goHome" Width="42" Template="{StaticResource homeTemplate}" Content="Button" Canvas.Left="257" Canvas.Top="4" Click="GoHomeClick"/>
		</Canvas>

		<ToggleButton x:Name="moveBallToggleButton" Content="Move the ball. (And watch the sub image follow.)" HorizontalAlignment="Right" VerticalAlignment="Top" Style="{StaticResource ToggleButtonStyle1}" Margin="0,3,3,0"/>
		<TextBlock x:Name="moveBallTextBlock" Text="Click the scene to move the ball to the new position." Visibility="Collapsed"/>
		<TextBlock x:Name="informationTextBlock" Text="Generating Deep Zoom content. Please wait..." TextWrapping="Wrap" Margin="192,88,181,0" Width="206"/>
		<ProgressBar x:Name="informationProgressBar" Margin="192,127,181,129" Value="50" Style="{StaticResource ProgressBarStyle1}" Width="206" Height="35"/>
	</Grid>
</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
China China
Microsoft All-In-One Code Framework delineates the framework and skeleton of Microsoft development techniques through typical sample codes in three popular programming languages (Visual C#, VB.NET, Visual C++). Each sample is elaborately selected, composed, and documented to demonstrate one frequently-asked, tested or used coding scenario based on our support experience in MSDN newsgroups and forums. If you are a software developer, you can fill the skeleton with blood, muscle and soul. If you are a software tester or a support engineer like us, you may extend the sample codes a little to fit your specific test scenario or refer your customer to this project if the customer's question coincides with what we collected.
http://cfx.codeplex.com/

Comments and Discussions