<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:VSConverter.WPF"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        x:Class="VSConverter.WPF.MainWindow"
        Title="MainWindow" Height="400" Width="400" MouseDown="Window_MouseDown" Background="Black" WindowStartupLocation="CenterScreen" Style="{StaticResource NoneWindowStyle}">
    <Window.DataContext>
        <local:MainWindowViewModel/>
    </Window.DataContext>
	<Grid>
		<Grid Margin="20">
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
				<RowDefinition Height="*"/>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>

            <Button Style="{StaticResource EmptyButtonStyle}" Background="#FFC80000" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Margin="4">
                <Grid>
                    <Image Source="Resources/home.png" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    <TextBlock Text="VS Version Converter" Foreground="White" Margin="5" VerticalAlignment="Bottom"/>
                </Grid>
            </Button>

            <Button Style="{StaticResource EmptyButtonStyle}"
				Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="1" Background="Red" Margin="4" Click="ShowChooseDialog">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="Click">
						<i:InvokeCommandAction Command="{Binding InitCommand, Mode=OneWay}"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
				<Grid>
					<Image Source="Resources/solutions.png" Stretch="None" />
					<TextBlock Text="Convert" Foreground="White" Margin="5" VerticalAlignment="Bottom"/>
				</Grid>
			</Button>

            <!--选择对话框-->            
			<Grid x:Name="chooseDialog" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" Background="#FFC80000" Margin="4" Visibility="Hidden">
				<Grid.Resources>
                    <Style TargetType="{x:Type Grid}">
                        <Style.Triggers>
                            <Trigger Property="Visibility" Value="Visible">
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0.5"
												From="0" To="1"
												Storyboard.TargetProperty="Opacity"/>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                            </Trigger>							                            
						</Style.Triggers>
					</Style>
				</Grid.Resources>
				<Grid VerticalAlignment="Center" Margin="10,0">
					<Grid.RowDefinitions>
						<RowDefinition/>
						<RowDefinition/>
						<RowDefinition/>
					</Grid.RowDefinitions>
					<Grid.ColumnDefinitions>
						<ColumnDefinition/>
						<ColumnDefinition Width="75"/>
					</Grid.ColumnDefinitions>
					<Label Grid.Column="0" Grid.Row="0" Content="转换源" Foreground="White"/>
					<TextBox x:Name="solutionPath" Grid.Column="0" Grid.Row="1" IsEnabled="False" Text="{Binding SolutionPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ToolTip="{Binding SolutionPath}"/>
                    <Button Grid.Column="1" Grid.Row="1" Content="浏览" Width="55" Margin="10,0" Click="OpenSolutionPath">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <i:InvokeCommandAction Command="{Binding LoadSolutionCommand, Mode=OneWay}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>
                    <Button Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" Content="下一步" Width="55" Margin="0,6" Click="ChooseDialogNext"/>
					<Button Grid.Column="1" Grid.Row="2" Content="取消" Width="55" Margin="0,6" Click="CloseChooseDialog">
						<i:Interaction.Triggers>
							<i:EventTrigger EventName="Click">
								<i:InvokeCommandAction Command="{Binding InitCommand, Mode=OneWay}"/>
							</i:EventTrigger>
						</i:Interaction.Triggers>
					</Button>
				</Grid>
			</Grid>

            <!--转换对话框-->
			<Grid x:Name="convertDialog" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" Background="#FFC80000" Margin="4" Visibility="Hidden">
				<Grid.Resources>
					<Style TargetType="{x:Type Grid}">						
						<Style.Triggers>
                            <Trigger Property="Visibility" Value="Visible">
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0.5"
												From="0" To="1"
												Storyboard.TargetProperty="Opacity"/>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                            </Trigger>
						</Style.Triggers>
					</Style>
				</Grid.Resources>
				<Grid VerticalAlignment="Center" Margin="10,0">
					<Grid.RowDefinitions>
						<RowDefinition/>
						<RowDefinition/>
						<RowDefinition/>
					</Grid.RowDefinitions>
					<Grid.ColumnDefinitions>
						<ColumnDefinition/>
						<ColumnDefinition Width="75"/>
					</Grid.ColumnDefinitions>
					<Label Grid.Column="0" Grid.Row="0" Content="转换目标" Foreground="White"/>
					<Grid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="1.3*"/>
							<ColumnDefinition Width="*"/>
						</Grid.ColumnDefinitions>
						<Grid Grid.Column="0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
							</Grid.ColumnDefinitions>
							<TextBlock Grid.Column="0" Grid.Row="0" Text="VS版本：" Foreground="White" VerticalAlignment="Center"/>
							<ComboBox Grid.Column="1" Grid.Row="0" ItemsSource="{Binding ConvertToVSSource}" SelectedItem="{Binding ConvertToVS}"/>
						</Grid>
						<Grid Grid.Column="1" Margin="6,0,0,0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
							</Grid.ColumnDefinitions>
							<TextBlock Grid.Column="0" Grid.Row="0" Text="IDE：" Foreground="White" VerticalAlignment="Center"/>
							<ComboBox Grid.Column="1" Grid.Row="0" ItemsSource="{Binding ConvertToIDESource}" SelectedItem="{Binding ConvertToIDE}"/>
						</Grid>
					</Grid> 
					<CheckBox Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left" Content="另存" Margin="0,6" VerticalAlignment="Center" Foreground="White" IsChecked="{Binding IsSaveAs}"/>
                    <Button Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" Content="转换" Width="55" Margin="0,6" Click="CloseConvertDialog">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <i:InvokeCommandAction Command="{Binding ConvertToCommand, Mode=OneWay}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>
					<Button Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" Content="上一步" Width="55" Margin="65,6" Click="ConvertDialogPrev"/>
                    <Button Grid.Column="1" Grid.Row="2" Content="取消" Width="55" Margin="0,6" Click="CloseConvertDialog">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <i:InvokeCommandAction Command="{Binding InitCommand, Mode=OneWay}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>
				</Grid>
			</Grid>
            
			<Button Style="{StaticResource EmptyButtonStyle}"
				Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Background="#FFC80000" Margin="4">
				<Grid>
					<Image Source="Resources/chilun.png" Stretch="None" HorizontalAlignment="Right" Margin="20,0"/>
					<TextBlock Text="{Binding ConvertResult}" Foreground="White" Margin="5" VerticalAlignment="Center"/>
				</Grid>
			</Button>

			<Button Style="{StaticResource EmptyButtonStyle}"
				Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="1" Background="#FFC80000" Margin="4" Click="OpenSourceCode">
				<Grid>
					<Image Source="Resources/git.png" Stretch="None"/>
					<TextBlock Text="Source Code" Foreground="White" Margin="5" VerticalAlignment="Bottom"/>
				</Grid>
			</Button>

			<Button Style="{StaticResource EmptyButtonStyle}"
				Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="1" Background="#FFC80000" Margin="4" Click="OpenAboutAuthor">
				<Grid>
					<Image Source="Resources/author.png" Stretch="None" />
					<TextBlock Text="Author" Foreground="White" Margin="5" VerticalAlignment="Bottom"/>
				</Grid>
			</Button>

			<Button Click="CloseWindow" Style="{StaticResource EmptyButtonStyle}"
				Grid.Column="2" Grid.Row="2" Grid.ColumnSpan="1" Background="#FFC80000" Margin="4">
				<Grid>
					<Image Source="Resources/Exit.png" Stretch="None" />
					<TextBlock Text="Exit" Foreground="White" Margin="5" VerticalAlignment="Bottom"/>
				</Grid>
			</Button>
		</Grid>
	</Grid>
</Window>
