Added main structure
This commit is contained in:
73
GifResizer/Views/MainWindow.xaml
Normal file
73
GifResizer/Views/MainWindow.xaml
Normal file
@@ -0,0 +1,73 @@
|
||||
<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"
|
||||
mc:Ignorable="d"
|
||||
Title="Gif resizer" Height="480" Width="640"
|
||||
ResizeMode="NoResize">
|
||||
|
||||
<Border BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5"
|
||||
Padding="5"
|
||||
Margin="20">
|
||||
|
||||
<StackPanel Orientation="Vertical" Margin="20">
|
||||
|
||||
<Border BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5"
|
||||
Padding="5"
|
||||
Margin="20">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock
|
||||
Margin="0,0,0,5"
|
||||
Text="{
|
||||
Binding FilePath,
|
||||
TargetNullValue=No file selected,
|
||||
FallbackValue=Gif filepath...
|
||||
}"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
/>
|
||||
<Button
|
||||
Content="Browse..."
|
||||
Padding="5"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
Click="BrowseButton_Click"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Button
|
||||
Content="Resize"
|
||||
Padding="5"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
Click="ResizeButton_Click"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<!--
|
||||
<TextBlock Grid.Row="3" Text="Options:" Margin="0,0,0,5"/>
|
||||
|
||||
<CheckBox Grid.Row="4"
|
||||
Content="Optimize file size"
|
||||
Margin="0,0,0,15"/>
|
||||
|
||||
<Button Grid.Row="5"
|
||||
Content="Resize GIF"
|
||||
Width="120"
|
||||
Height="35"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"/>
|
||||
-->
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Window>
|
||||
40
GifResizer/Views/MainWindow.xaml.cs
Normal file
40
GifResizer/Views/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Windows;
|
||||
using GifResizer.ViewModels;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace GifResizer.Views;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
|
||||
private readonly MainViewModel _mainViewModel;
|
||||
|
||||
public MainWindow(MainViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
_mainViewModel = viewModel;
|
||||
DataContext = _mainViewModel;
|
||||
|
||||
}
|
||||
|
||||
private void BrowseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog fileDialog = new OpenFileDialog
|
||||
{
|
||||
Filter = "GIF files (*.gif)|*.gif|All files (*.*)|*.*",
|
||||
Title = "Select a GIF file"
|
||||
};
|
||||
|
||||
if (fileDialog.ShowDialog() == true)
|
||||
{
|
||||
_mainViewModel.FilePath = fileDialog.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
private void ResizeButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user