<Window x:Class="Rebex.Samples.MainWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:sample="clr-namespace:Rebex.Samples"
		Title="File encryption tool"
		MinWidth="500"
		Padding="5"
		SizeToContent="WidthAndHeight"
		SnapsToDevicePixels="True"
		Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
	<Grid>
		<Grid.Resources>
			<Style TargetType="TextBox">
				<Setter Property="Margin" Value="3"/>
				<Style.Triggers>
					<Trigger Property="TextBoxBase.IsReadOnly" Value="True">
						<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlDarkColorKey}}"/>
					</Trigger>
				</Style.Triggers>
			</Style>
			<Style TargetType="PasswordBox">
				<Setter Property="Margin" Value="3"/>
			</Style>
			<Style TargetType="ButtonBase" x:Key="ButtonStyle">
				<Setter Property="Margin" Value="3"/>
				<Setter Property="Padding" Value="3,1"/>
			</Style>
			<Style TargetType="Button" BasedOn="{StaticResource ButtonStyle}"></Style>
			<Style TargetType="CheckBox" BasedOn="{StaticResource ButtonStyle}"></Style>
			<Style TargetType="TextBlock">
				<Setter Property="VerticalAlignment" Value="Center"/>
			</Style>
		</Grid.Resources>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition Width="*"/>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition Width="Auto"/>
		</Grid.ColumnDefinitions>
		<Image Source="pack://application:,,,/Resources/securityLogo.png" Grid.RowSpan="4" Grid.Column="0" Margin="3">
			<Image.OpacityMask>
				<RadialGradientBrush>
					<GradientStop Color="White" Offset="0" />
					<GradientStop Color="White" Offset="0.692" />
					<GradientStop Color="#00000000" Offset="1" />
				</RadialGradientBrush>
			</Image.OpacityMask>
		</Image>
		<TextBlock Text="Source File:" Grid.Column="1" Grid.Row="0"/>		
		<TextBlock Text="Destination File:" Grid.Column="1" Grid.Row="1"/>
		<TextBlock Text="Password:" Grid.Column="1" Grid.Row="2"/>

		<TextBox Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="3" Text="{Binding SourceFilePath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"  />
		<TextBox IsReadOnly="True" Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="4" Text="{Binding DestinationFilePath, Mode=OneWay}"/>
		<PasswordBox x:Name="pbxPassword" PasswordChar="*" Grid.Column="2" Grid.Row="2" Grid.ColumnSpan="4" PasswordChanged="PasswordBox_PasswordChanged"/>
		

		<CheckBox Content="Overwrite existing files" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" VerticalContentAlignment="Center"
				  IsChecked="{Binding OverwriteExistingFiles}"/>

		<Button Content="..." Grid.Column="5" Grid.Row="0" Command="{Binding OpenCommand}"/>
		<Button Content="Encrypt" Grid.Column="3" Grid.Row="3" Command="{Binding EncryptCommand}"/>
		<Button Content="Decrypt" Grid.Column="4" Grid.Row="3" Grid.ColumnSpan="2" Command="{Binding DecryptCommand}"/>
	</Grid>
</Window>
