Implemented core logic
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using GifResizer.Models;
|
||||
using GifResizer.Service;
|
||||
|
||||
namespace GifResizer.ViewModels;
|
||||
|
||||
public class MainViewModel : INotifyPropertyChanged
|
||||
{
|
||||
|
||||
|
||||
private readonly ResizeService _resizeService;
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
public MainViewModel()
|
||||
public MainViewModel(ResizeService service)
|
||||
{
|
||||
_resizeService = service;
|
||||
FilePath = Directory.GetCurrentDirectory();
|
||||
}
|
||||
|
||||
@@ -21,6 +24,11 @@ public class MainViewModel : INotifyPropertyChanged
|
||||
get;
|
||||
set => SetField(ref field, value);
|
||||
}
|
||||
|
||||
public void ResizeGif(int width, int height)
|
||||
{
|
||||
_resizeService.ResizeGif(FilePath, width, height);
|
||||
}
|
||||
|
||||
private bool SetField<T>(ref T field, T value, [CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user