using ImageMagick;
using System.Windows;
using System.Windows.Controls;

namespace Ocr.Gui.Controls;

/// <summary>
/// Interaction logic for ImageControl.xaml
/// </summary>
public partial class ImageControl : UserControl
{
  /// <inheritdoc cref="Image"/>
  public static readonly DependencyProperty ImageProperty = DependencyProperty.Register(
    nameof(Image), typeof(MagickImage), typeof(ImageControl), new PropertyMetadata(default(MagickImage)));

  /// <summary>
  /// The <see cref="MagickImage"/> displayed in this <see cref="ImageControl"/>
  /// </summary>
  public MagickImage Image
  {
    get => (MagickImage)GetValue(ImageProperty);
    set => SetValue(ImageProperty, value);
  }

  /// <inheritdoc cref="ImageName"/>
  public static readonly DependencyProperty ImageNameProperty = DependencyProperty.Register(
    nameof(ImageName), typeof(object), typeof(ImageControl),
    new PropertyMetadata(default(object)));

  /// <summary>
  /// The name of the loaded image
  /// </summary>
  public object ImageName
  {
    get => (object)GetValue(ImageNameProperty);
    set => SetValue(ImageNameProperty, value);
  }

  /// <inheritdoc />
  public ImageControl()
  {
    InitializeComponent();
  }
}