128 lines
6.3 KiB
XML
128 lines
6.3 KiB
XML
<Window x:Class="GifResizer.Views.MainWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:gif="http://wpfanimatedgif.codeplex.com"
|
|
xmlns:converter="clr-namespace:GifResizer.Views.Converter"
|
|
mc:Ignorable="d"
|
|
Title="Gif resizer" Height="480" Width="640"
|
|
ResizeMode="NoResize">
|
|
|
|
<Window.Resources>
|
|
<converter:VisibleWhenNullConverter x:Key="VisibleWhenNullConverter"/>
|
|
</Window.Resources>
|
|
|
|
<Grid x:Name="MainContainer">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Border Grid.Row="0"
|
|
BorderBrush="Gray"
|
|
BorderThickness="1"
|
|
CornerRadius="5"
|
|
Margin="10 10 10 5">
|
|
|
|
<!-- GIF -->
|
|
<Grid x:Name="GifPreview"
|
|
Style="{StaticResource DarkGrid}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="4*"/>
|
|
<ColumnDefinition Width="2*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Image Grid.Column="0" gif:ImageBehavior.AnimatedSource="{Binding FilePath}"
|
|
Stretch="UniformToFill"
|
|
Visibility="{
|
|
Binding FilePath,
|
|
Converter={StaticResource VisibleWhenNullConverter},
|
|
ConverterParameter=invert
|
|
}"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"/>
|
|
|
|
<Button Grid.Column="0"
|
|
Style="{StaticResource LinkButtonStyle}"
|
|
Click="BrowseButton_Click"
|
|
Visibility="{
|
|
Binding FilePath,
|
|
Converter={StaticResource VisibleWhenNullConverter}
|
|
}"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
<TextBlock
|
|
Text="Browse files..."
|
|
Width="Auto"
|
|
Height="Auto"
|
|
TextDecorations="Underline"/>
|
|
</Button>
|
|
|
|
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch"/>
|
|
|
|
<Grid Grid.Column="1" Margin="10">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="75*"/>
|
|
<RowDefinition Height="25*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel x:Name="GifInfo" Grid.Row="0">
|
|
<StackPanel Margin="0 0 0 15">
|
|
<TextBlock Grid.Row="0" Grid.Column="0">Location</TextBlock>
|
|
<TextBlock Text="{Binding FilePath}"/>
|
|
</StackPanel>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="2*"/>
|
|
<ColumnDefinition Width="1*"/>
|
|
<ColumnDefinition Width="2*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.Row="0" Grid.Column="0">Width</TextBlock>
|
|
<TextBlock Grid.Row="0" Grid.Column="2">Height</TextBlock>
|
|
<TextBox Grid.Row="1" Grid.Column="0" Text="{Binding GifWidth}"></TextBox>
|
|
<TextBox Grid.Row="1" Grid.Column="2" Text="{Binding GifHeight}"></TextBox>
|
|
</Grid>
|
|
</StackPanel>
|
|
|
|
<Rectangle Grid.Row="1"
|
|
Height="1"
|
|
Fill="Gray"
|
|
VerticalAlignment="Top"/>
|
|
|
|
<StackPanel x:Name="Actions" Grid.Row="1" Orientation="Vertical"
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Center">
|
|
|
|
<TextBlock VerticalAlignment="Top" Margin="0 0 0 5">Common formats</TextBlock>
|
|
|
|
<ItemsControl ItemsSource="{Binding CommonFormats}" Margin="0 0 0 5">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel/>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<CheckBox Content="{Binding}"
|
|
IsChecked="{Binding Checked}"
|
|
Margin="0 0 10 5"/>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<Button
|
|
Style="{StaticResource ButtonStyle}"
|
|
Content="Resize"
|
|
Click="ResizeButton_Click"
|
|
VerticalAlignment="Bottom"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</Window>
|