<!--
	Copyright (c) Microsoft. All rights reserved.
-->

<UserControl x:Class="MOX.RadialMenu"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:vsm='using:Windows.UI.Xaml'
	xmlns:mox="using:MOX"
	x:Name="RootControl"
	IsTabStop="true"
	TabNavigation="Cycle"
	>
	<UserControl.Resources>
		<Storyboard x:Name="storyboardRootOpen">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="imgBackground">
				<EasingDoubleKeyFrame KeyTime="0" Value="0.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.117" Value="0.75"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.217" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.267" Value="1.01"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="imgBackground">
				<EasingDoubleKeyFrame KeyTime="0" Value="0.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.117" Value="0.75"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.217" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.267" Value="1.01"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="imgBackground">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.117" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="storyboardRootClose">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="imgBackground">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="1.01"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.083" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.183" Value="0.75"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0.5"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="imgBackground">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="1.01"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.083" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.183" Value="0.75"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0.5"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="imgBackground">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.183" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="storyboardRootCloseDefault">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="SubmenuList">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.083" Value="0">
					<EasingDoubleKeyFrame.EasingFunction>
						<CubicEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-13.3382"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-45">
					<EasingDoubleKeyFrame.EasingFunction>
						<CubicEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="SubmenuList">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.083" Value="1">
					<EasingDoubleKeyFrame.EasingFunction>
						<CubicEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0.925899"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0.75">
					<EasingDoubleKeyFrame.EasingFunction>
						<CubicEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="SubmenuList">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.083" Value="1">
					<EasingDoubleKeyFrame.EasingFunction>
						<CubicEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0.925899"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0.75">
					<EasingDoubleKeyFrame.EasingFunction>
						<CubicEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SubmenuList">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</UserControl.Resources>
	<Grid x:Name="LayoutRoot" Height="278" Width="278" FlowDirection="LeftToRight">
		<vsm:VisualStateManager.VisualStateGroups >
			<vsm:VisualStateGroup>
				<vsm:VisualState x:Name="IndicatorRootNormal">
					<Storyboard>
						<DoubleAnimation Duration="0:0:0.15" To="1" Storyboard.TargetName="imgIndicator" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorBack" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="1" Storyboard.TargetName="imgIndicatorBackground" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorBackgroundExpanded" Storyboard.TargetProperty="Opacity" />
					</Storyboard>
				</vsm:VisualState>
				<vsm:VisualState x:Name="IndicatorNormal">
					<Storyboard>
						<DoubleAnimation Duration="0:0:0.15" To="1" Storyboard.TargetName="imgIndicator" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorBack" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorBackground" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="1" Storyboard.TargetName="imgIndicatorBackgroundExpanded" Storyboard.TargetProperty="Opacity" />
					</Storyboard>
				</vsm:VisualState>
				<vsm:VisualState x:Name="IndicatorDisabled">
					<Storyboard>
						<DoubleAnimation Duration="0:0:0.15" To="0.3" Storyboard.TargetName="imgIndicator" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorBack" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorHoverKeyboard" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorHoverPointer" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorBackground" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0.3" Storyboard.TargetName="imgIndicatorBackgroundExpanded" Storyboard.TargetProperty="Opacity" />
					</Storyboard>
				</vsm:VisualState>
				<vsm:VisualState x:Name="IndicatorBack">
					<Storyboard>
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicator" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="1" Storyboard.TargetName="imgIndicatorBack" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorBackground" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="1" Storyboard.TargetName="imgIndicatorBackgroundExpanded" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="inkStrokeColor" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="highlighterStrokeColor" Storyboard.TargetProperty="Opacity" />
					</Storyboard>
				</vsm:VisualState>
				<vsm:VisualState x:Name="IndicatorBackDisabled">
					<Storyboard>
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicator" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0.3" Storyboard.TargetName="imgIndicatorBack" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorHoverKeyboard" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorHoverPointer" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorBackground" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0.3" Storyboard.TargetName="imgIndicatorBackgroundExpanded" Storyboard.TargetProperty="Opacity" />
					</Storyboard>
				</vsm:VisualState>
				<vsm:VisualState x:Name="IndicatorHidden">
					<Storyboard>
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicator" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorBack" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorHoverKeyboard" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorHoverPointer" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorBackground" Storyboard.TargetProperty="Opacity" />
						<DoubleAnimation Duration="0:0:0.15" To="0" Storyboard.TargetName="imgIndicatorBackgroundExpanded" Storyboard.TargetProperty="Opacity" />
					</Storyboard>
				</vsm:VisualState>
			</vsm:VisualStateGroup>
			<vsm:VisualStateGroup>
				<vsm:VisualStateGroup.Transitions>
					<vsm:VisualTransition From="IndicatorHoverPointer" GeneratedDuration="0:0:0.3">
						<Storyboard>
							<DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="imgIndicatorHoverPointer" Storyboard.TargetProperty="Opacity" />
						</Storyboard>
					</vsm:VisualTransition>
					<vsm:VisualTransition From="IndicatorHoverKeyboard" GeneratedDuration="0:0:0.3">
						<Storyboard>
							<DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="imgIndicatorHoverKeyboard" Storyboard.TargetProperty="Opacity" />
						</Storyboard>
					</vsm:VisualTransition>
				</vsm:VisualStateGroup.Transitions>
				<vsm:VisualState x:Name="IndicatorHoverNone" />
				<vsm:VisualState x:Name="IndicatorHoverPointer" >
					<Storyboard>
						<DoubleAnimation To="1" Duration="0" Storyboard.TargetName="imgIndicatorHoverPointer" Storyboard.TargetProperty="Opacity" />
					</Storyboard>
				</vsm:VisualState>
				<vsm:VisualState x:Name="IndicatorHoverKeyboard" >
					<Storyboard>
						<DoubleAnimation To="1" Duration="0" Storyboard.TargetName="imgIndicatorHoverKeyboard" Storyboard.TargetProperty="Opacity" />
					</Storyboard>
				</vsm:VisualState>
			</vsm:VisualStateGroup>
		</vsm:VisualStateManager.VisualStateGroups>
		<Grid Name="SubmenuLayoutRoot" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed" >
			<Image Name="imgBackground"
				Height="265"
				Width="265"
				HorizontalAlignment="Center"
				VerticalAlignment="Center"
				Margin="0,1,3,1"
				Stretch="Fill"
				RenderTransformOrigin="0.5,0.5"
				IsHitTestVisible="false"
				>
				<Image.Source>
					<mox:SmartImageSource SourcePath="\images\OuterBackground.png" />
				</Image.Source>
				<Image.RenderTransform>
					<CompositeTransform />
				</Image.RenderTransform>
			</Image>
			<Grid Name="SubmenuList" RenderTransformOrigin="0.5,0.5">
				<Grid.RenderTransform>
					<CompositeTransform />
				</Grid.RenderTransform>
			</Grid>
		</Grid>
		<Ellipse Name="imgIndicatorBackground" Width="42" Height="42" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{CustomResource :mso_brush:2392}" Stroke="{CustomResource :mso_brush:2394}" StrokeThickness="2" Opacity="1" IsHitTestVisible="false" />
		<Ellipse Name="imgIndicatorBackgroundExpanded" Width="42" Height="42" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{CustomResource :mso_brush:2393}" Stroke="{CustomResource :mso_brush:2396}" StrokeThickness="2" Opacity="0" IsHitTestVisible="false" />
		<Ellipse Name="imgIndicatorHoverPointer" Width="38" Height="38" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{CustomResource :mso_brush:2400}" StrokeThickness="0" Opacity="0" IsHitTestVisible="false" />
		<Ellipse Name="imgIndicatorHoverKeyboard" Width="52" Height="52" HorizontalAlignment="Center" VerticalAlignment="Center" Stroke="{CustomResource :mso_brush:2398}" StrokeThickness="2" Opacity="0" IsHitTestVisible="false" />
		<Image Name="imgIndicator" Height="40" Width="40" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="false" >
			<Image.Source>
				<mox:SmartImageSource IsHighDpiAware="true" IsPathLocalized="true" SourcePath="{Binding IndicatorPath, Mode=OneWay}" />
			</Image.Source>
		</Image>
		<Path Name="inkStrokeColor" Data="M127.27481,130.58459 C125.26576,128.79565 125.31396,125.22603 121.82169,125.36723 C118.13844,125.51616 118.17481,131.55878 114.88599,131.40518 C111.68079,131.25549 111.10716,126.48526 111.10716,126.48526" HorizontalAlignment="Center" Height="6.379" Stretch="Fill" Stroke="{Binding InkStrokeColor, Mode=TwoWay}" UseLayoutRounding="False" VerticalAlignment="Center" Width="17.083" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeThickness="3" Opacity="{Binding InkIndicatorOpacity, Mode=OneWay}"  Margin="124,142,136,129"/>
		<Path Name="highlighterStrokeColor" Data="F1 M 1.99998,5L 18,5" HorizontalAlignment="Center" Height="6" Stretch="Fill" Stroke="{Binding InkStrokeColor, Mode=TwoWay}" UseLayoutRounding="False" VerticalAlignment="Center" Width="16" StrokeStartLineCap="Square" StrokeEndLineCap="Square" StrokeDashCap="Square" StrokeThickness="5" Opacity="{Binding HighlighterIndicatorOpacity, Mode=OneWay}"  Margin="122,140,136,129"/>
		<Image Name="imgIndicatorBack" Height="40" Width="40" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0" IsHitTestVisible="false" FlowDirection="{Binding FlowDirection, ElementName=RootControl}" >
			<Image.Source>
				<mox:SmartImageSource IsHighDpiAware="true" IsHighContrastInverted="true" SourcePath="\images\BackIcon.png" />
			</Image.Source>
		</Image>
		<!-- Keep this in sync with RM_TOUCH_SIZE_COLLAPSED -->
		<Ellipse Name="touchTargetCollapsed" Width="66" Height="66" Fill="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" />
		<!-- Keep this in sync with RM_TOUCH_SIZE_EXPANDED -->
		<Ellipse Name="touchTargetExpanded" Width="278" Height="278" Fill="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" IsHitTestVisible="false" />
	</Grid>
</UserControl>
