diff --git a/Examples/ImageCreationUI/ActionCommand.cs b/Examples/ImageCreationUI/ActionCommand.cs deleted file mode 100644 index 2b87fdb..0000000 --- a/Examples/ImageCreationUI/ActionCommand.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Windows.Input; - -namespace ImageCreationUI; - -public class ActionCommand(Action command, Func? canExecute = null) : ICommand -{ - #region Events - - public event EventHandler? CanExecuteChanged; - - #endregion - - #region Methods - - public bool CanExecute(object? parameter) => canExecute?.Invoke() ?? true; - - public void Execute(object? parameter) => command.Invoke(); - - public void RaiseCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty); - - #endregion -} - -public class ActionCommand(Action command, Func? canExecute = null) : ICommand - where T : class -{ - #region Events - - public event EventHandler? CanExecuteChanged; - - #endregion - - #region Methods - - public bool CanExecute(object? parameter) => canExecute?.Invoke((T)parameter!) ?? true; - - public void Execute(object? parameter) => command.Invoke((T)parameter!); - - public void RaiseCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty); - - #endregion -} \ No newline at end of file diff --git a/Examples/ImageCreationUI/App.xaml b/Examples/ImageCreationUI/App.xaml deleted file mode 100644 index 84ead37..0000000 --- a/Examples/ImageCreationUI/App.xaml +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/Examples/ImageCreationUI/App.xaml.cs b/Examples/ImageCreationUI/App.xaml.cs deleted file mode 100644 index 4095cd8..0000000 --- a/Examples/ImageCreationUI/App.xaml.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System.Windows; - -namespace ImageCreationUI; - -public partial class App : Application; diff --git a/Examples/ImageCreationUI/Converter/ImageToImageSourceConverter.cs b/Examples/ImageCreationUI/Converter/ImageToImageSourceConverter.cs deleted file mode 100644 index c3d8cb6..0000000 --- a/Examples/ImageCreationUI/Converter/ImageToImageSourceConverter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Drawing; -using System.Globalization; -using System.IO; -using System.Windows.Data; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using HPPH; -using HPPH.System.Drawing; - -namespace ImageCreationUI.Converter; - -[ValueConversion(typeof(IImage), typeof(ImageSource))] -public class ImageToImageSourceConverter : IValueConverter -{ - public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) - { - using Bitmap? bitmap = (value as IImage)?.ToBitmap(); - if (bitmap == null) return null; - - using MemoryStream ms = new(); - bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); - ms.Position = 0; - - BitmapImage bitmapImage = new(); - bitmapImage.BeginInit(); - bitmapImage.StreamSource = ms; - bitmapImage.CacheOption = BitmapCacheOption.OnLoad; - bitmapImage.EndInit(); - - return bitmapImage; - } - - public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => throw new NotSupportedException(); -} \ No newline at end of file diff --git a/Examples/ImageCreationUI/ImageCreationUI.csproj b/Examples/ImageCreationUI/ImageCreationUI.csproj deleted file mode 100644 index d1afed9..0000000 --- a/Examples/ImageCreationUI/ImageCreationUI.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - WinExe - net9.0-windows - enable - enable - true - true - - - - - - - - - - - - - - diff --git a/Examples/ImageCreationUI/ImageCreationUI.csproj.DotSettings b/Examples/ImageCreationUI/ImageCreationUI.csproj.DotSettings deleted file mode 100644 index 17962b1..0000000 --- a/Examples/ImageCreationUI/ImageCreationUI.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - True \ No newline at end of file diff --git a/Examples/ImageCreationUI/MainWindow.xaml b/Examples/ImageCreationUI/MainWindow.xaml deleted file mode 100644 index a549ca1..0000000 --- a/Examples/ImageCreationUI/MainWindow.xaml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -