66 lines
1.7 KiB
C#
66 lines
1.7 KiB
C#
using Caliburn.Micro;
|
|
using ImageHandlingLibrary.InterFaces;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing.Imaging;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
|
|
namespace ImageHandlingUI.ViewModels
|
|
{
|
|
public class ShellViewModel : Conductor<object>
|
|
{
|
|
private string _rootCatalog;
|
|
private readonly IRegistring _registring;
|
|
private readonly IFiling _filing;
|
|
private string initialFileName;
|
|
ImageSource _selectedImage = null;
|
|
|
|
public ShellViewModel(IRegistring registring, IFiling filing)
|
|
{
|
|
|
|
initialFileName = @"D:\CsharpDevelop\PictureHandlingProject\pictures\AgueroVillage.JPG";
|
|
_selectedImage = filing.ConvertFromDrawImage(System.Drawing.Image.FromFile(InitialFileName));
|
|
_registring = registring;
|
|
_filing = filing;
|
|
}
|
|
|
|
|
|
public ImageSource SelectedImage
|
|
{
|
|
get { return _selectedImage; }
|
|
set
|
|
{
|
|
_selectedImage = value;
|
|
NotifyOfPropertyChange(() => SelectedImage);
|
|
}
|
|
}
|
|
|
|
public string InitialFileName { get => initialFileName; set => initialFileName = value; }
|
|
|
|
|
|
public string RootCatalog
|
|
{
|
|
get {
|
|
_rootCatalog = _registring.GetRegistryRootDir();
|
|
return _rootCatalog;
|
|
}
|
|
set
|
|
{
|
|
if (value != _rootCatalog)
|
|
{
|
|
_registring.SetRegistryValues(value);
|
|
}
|
|
_rootCatalog = value; }
|
|
}
|
|
|
|
|
|
}
|
|
}
|