2024-10-14 23:25:35 +02:00
|
|
|
|
using ImageCatalog_2.Commands;
|
|
|
|
|
|
using ImageCatalog_2.Services;
|
2024-10-14 23:05:18 +02:00
|
|
|
|
using System;
|
2024-10-14 22:55:52 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
2024-10-14 23:25:35 +02:00
|
|
|
|
using System.Diagnostics;
|
2024-10-14 22:55:52 +02:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2024-10-14 23:25:35 +02:00
|
|
|
|
using System.Windows.Input;
|
2024-10-14 22:55:52 +02:00
|
|
|
|
|
|
|
|
|
|
namespace ImageCatalog_2
|
|
|
|
|
|
{
|
|
|
|
|
|
public class DataModel : ViewModelBase
|
|
|
|
|
|
{
|
2024-10-14 23:25:35 +02:00
|
|
|
|
|
|
|
|
|
|
public ICommand TestCommand { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public ICommand AsyncTestCommand { get; }
|
2025-07-23 17:16:06 +02:00
|
|
|
|
|
|
|
|
|
|
public ICommand ProcessImagesCommand { get; }
|
2024-10-14 23:25:35 +02:00
|
|
|
|
|
2024-10-14 23:05:18 +02:00
|
|
|
|
private readonly ITestService _service;
|
|
|
|
|
|
public DataModel(ITestService testService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_service = testService;
|
2024-10-14 23:25:35 +02:00
|
|
|
|
|
|
|
|
|
|
TestCommand = new RelayCommand(Test);
|
|
|
|
|
|
AsyncTestCommand = new AsyncCommand(TestAsync);
|
2025-07-23 17:16:06 +02:00
|
|
|
|
|
|
|
|
|
|
ProcessImagesCommand = new AsyncCommand(ProcessImages);
|
2024-10-14 23:05:18 +02:00
|
|
|
|
}
|
2024-10-14 22:55:52 +02:00
|
|
|
|
|
|
|
|
|
|
private string _sourcePath;
|
|
|
|
|
|
|
|
|
|
|
|
public string SourcePath
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _sourcePath;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
_sourcePath = value;
|
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string _destinationPath;
|
|
|
|
|
|
public string DestinationPath
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _destinationPath;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
_destinationPath = value;
|
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-28 09:49:55 +02:00
|
|
|
|
private string _horizontalText;
|
|
|
|
|
|
|
|
|
|
|
|
public string HorizontalText
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _horizontalText;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
_horizontalText = value;
|
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-28 10:34:03 +02:00
|
|
|
|
|
|
|
|
|
|
private string _verticalText;
|
|
|
|
|
|
public string VerticalText
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _verticalText;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
_verticalText = value;
|
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-28 09:49:55 +02:00
|
|
|
|
|
2025-07-28 14:45:03 +02:00
|
|
|
|
private bool _overwriteImages;
|
|
|
|
|
|
|
|
|
|
|
|
public bool OverwriteImages
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _overwriteImages;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
_overwriteImages = value;
|
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-14 23:48:21 +02:00
|
|
|
|
private bool _uiEnabled = true;
|
|
|
|
|
|
|
|
|
|
|
|
public bool UiEnabled
|
|
|
|
|
|
{
|
2025-07-28 10:34:03 +02:00
|
|
|
|
get => _uiEnabled;
|
2024-10-14 23:48:21 +02:00
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
_uiEnabled = value;
|
|
|
|
|
|
NotifyPropertyChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-14 23:25:35 +02:00
|
|
|
|
private void Test(object parameter)
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.WriteLine("Yep");
|
2024-10-14 23:48:21 +02:00
|
|
|
|
this.UiEnabled = !this.UiEnabled;
|
2024-10-14 23:25:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async Task TestAsync()
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.WriteLine("Yep c");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-23 17:16:06 +02:00
|
|
|
|
private async Task ProcessImages()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-14 22:55:52 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|