<!--
	Copyright (c) Microsoft. All rights reserved.
-->

<UserControl x:Class="MOX.CustomDialogUI"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mox="using:MOX"
	xmlns:core="using:Office.UI.Xaml.Core"
	xmlns:o="http://schemas.microsoft.com/office/xaml/2013"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
	mc:Ignorable="o">
  <o:Includes>
	<o:Include Name="/xaml/flux/controls/winrt/DialogButtonsLayout.h"/>
  </o:Includes>
  <UserControl.Resources>
		<ResourceDictionary Source="/xaml/view/styles/MsoCustomDialogStyles.xaml" /> 
	</UserControl.Resources>
	<!-- semitransparent background -->
	<Grid x:Name="gridDialogBackground" Background="{CustomResource :mso_brush:2932}" >
		<VisualStateManager.VisualStateGroups>
			<VisualStateGroup x:Name="BackgroundOpacityGroup">
				<VisualState x:Name="Normal" />
				<VisualState x:Name="OpaqueBackground" >
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="gridDialogBackground" Storyboard.TargetProperty="Fill">
							<DiscreteObjectKeyFrame KeyTime="0" Value="{CustomResource :mso_brush:2931}" />
						</ObjectAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
			<VisualStateGroup x:Name="OrientationStates">
				<VisualState x:Name="FullScreenLandscape" />
				<VisualState x:Name="Filled" />
				<VisualState x:Name="FullScreenPortrait">
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="leftCol" Storyboard.TargetProperty="Width">
							<DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
						</ObjectAnimationUsingKeyFrames>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="rightCol" Storyboard.TargetProperty="Width">
							<DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
						</ObjectAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
				<VisualState x:Name="Snapped">
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="buttonPanel" Storyboard.TargetProperty="Orientation">
							<DiscreteObjectKeyFrame KeyTime="0" Value="Vertical"/>
						</ObjectAnimationUsingKeyFrames>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="centerCol" Storyboard.TargetProperty="Width">
							<DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
						</ObjectAnimationUsingKeyFrames>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="leftCol" Storyboard.TargetProperty="Width">
							<DiscreteObjectKeyFrame KeyTime="0" Value="20"/>
						</ObjectAnimationUsingKeyFrames>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="rightCol" Storyboard.TargetProperty="Width">
							<DiscreteObjectKeyFrame KeyTime="0" Value="20"/>
						</ObjectAnimationUsingKeyFrames>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="button0" Storyboard.TargetProperty="Margin">
							<DiscreteObjectKeyFrame KeyTime="0" Value="0,0,0,10"/>
						</ObjectAnimationUsingKeyFrames>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="button1" Storyboard.TargetProperty="Margin">
							<DiscreteObjectKeyFrame KeyTime="0" Value="0,0,0,10"/>
						</ObjectAnimationUsingKeyFrames>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="button2" Storyboard.TargetProperty="Margin">
							<DiscreteObjectKeyFrame KeyTime="0" Value="0,0,0,10"/>
						</ObjectAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>
		<Grid x:Name="innerDialogGrid" VerticalAlignment="Center" Background="{CustomResource :mso_brush:2931}">
			<Grid.ColumnDefinitions>
				<ColumnDefinition x:Name="leftCol" Width="2*" />
				<ColumnDefinition x:Name="centerCol" Width="3*" />
				<ColumnDefinition x:Name="rightCol" Width="2*" />
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition/>
				<RowDefinition Height="Auto"/>
			</Grid.RowDefinitions>
			<ScrollViewer VerticalScrollBarVisibility="Auto" ZoomMode="Disabled" HorizontalScrollMode="Disabled" Grid.Column="1" Grid.Row="0">
				<StackPanel VerticalAlignment="Top" HorizontalAlignment="Stretch"  Orientation="Vertical">
					<TextBlock x:Name="lblTitle"
						Style="{StaticResource HeaderTextStyle}" Margin="0,20,0,0" HorizontalAlignment="Left"
						TextWrapping="Wrap" Text="Some Title" />
					<Border x:Name="rootCustomContent" Margin="0,10,0,10"/>
				</StackPanel>
			</ScrollViewer>
			<core:Panel x:Name="buttonPanel" HorizontalAlignment="Right" Grid.Column="1" Grid.Row="1" Margin="0,10,0,10">
				<core:Panel.Layout>
					<core:DialogButtonsLayout />
				</core:Panel.Layout>
				<Button Name="button0" Style="{StaticResource TextButtonStyle}" HorizontalAlignment="Right" Margin="0,10,10,0">OK</Button>
				<Button Name="button1" Style="{StaticResource TextButtonStyle}" HorizontalAlignment="Right" Visibility="Collapsed"
					Margin="0,10,10,0">Cancel</Button>
				<Button Name="button2" Style="{StaticResource TextButtonStyle}" HorizontalAlignment="Right" Visibility="Collapsed"
					Margin="0,10,10,0">Other</Button>
			</core:Panel>
		</Grid>
	</Grid>
</UserControl>
