Implemented core logic
This commit is contained in:
@@ -45,6 +45,12 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<CheckBox Content="112x112" Margin="10"/>
|
||||
<CheckBox Content="500x500" Margin="10"/>
|
||||
<CheckBox Content="1000x1000" Margin="10"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button
|
||||
Content="Resize"
|
||||
Padding="5"
|
||||
|
||||
@@ -17,24 +17,44 @@ public partial class MainWindow : Window
|
||||
InitializeComponent();
|
||||
_mainViewModel = viewModel;
|
||||
DataContext = _mainViewModel;
|
||||
|
||||
}
|
||||
|
||||
private void BrowseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog fileDialog = new OpenFileDialog
|
||||
try
|
||||
{
|
||||
Filter = "GIF files (*.gif)|*.gif|All files (*.*)|*.*",
|
||||
Title = "Select a GIF file"
|
||||
};
|
||||
OpenFileDialog fileDialog = new OpenFileDialog
|
||||
{
|
||||
Title = "Select a GIF file",
|
||||
Filter = "GIF files (*.gif)|*.gif|All files (*.*)|*.*"
|
||||
};
|
||||
|
||||
if (fileDialog.ShowDialog() == true)
|
||||
if (fileDialog.ShowDialog() == true)
|
||||
{
|
||||
_mainViewModel.FilePath = fileDialog.FileName;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_mainViewModel.FilePath = fileDialog.FileName;
|
||||
DisplayErrorMessage("An error occured while selecting the GIF file: " + ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ResizeButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_mainViewModel.ResizeGif(128,128);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DisplayErrorMessage("An error occured while resizing the GIF: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void DisplayErrorMessage(string message)
|
||||
{
|
||||
MessageBox.Show(message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user