using System.Windows.Media.Imaging; namespace QuikDawEditor.MiscClasses; public class MovableImage : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged([CallerMemberName] string propertyName = "") { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } public string RelRes() { ReleaseResources(); return "Resources released"; } public MovableImage() { } internal double mousedownY = 0; private bool _IsVisible = false; public bool IsVisible { get { return _IsVisible; } set { _IsVisible = value; NotifyPropertyChanged(nameof(ImageVisibility)); } } public Visibility ImageVisibility { get { return IsVisible ? Visibility.Visible : Visibility.Hidden; } } private double _Width = 100; public double Width { get { return _Width; } set { _Width = value; NotifyPropertyChanged(nameof(Width)); } } private double _Height = 40; public double Height { get { return _Height; } set { _Height = value; NotifyPropertyChanged(nameof(Height)); } } public Thickness imgMargin { get { return new Thickness(Left, Top, 0, 0); } } public Point offsetPoint = new Point(0, 0); private double _Left = 100; public double Left { get { return _Left - offsetPoint.X / editingProject.ViewXZoomFac; } set { _Left = value; NotifyPropertyChanged(nameof(imgMargin)); } } private double _Top = 300; public double Top { get { return _Top; } set { _Top = value; NotifyPropertyChanged(nameof(imgMargin)); } } private BitmapSource _imgSource = null; public BitmapSource imgSource { get { return _imgSource; } set { _imgSource = value; NotifyPropertyChanged(nameof(imgSource)); } } private double _scaleTransformX = 1; public double scaleTransformX { get { return _scaleTransformX; } set { _scaleTransformX = value; NotifyPropertyChanged(nameof(scaleTransformX)); } } internal Track SourceTrack = null; public Clip sourceClip; private double _translateX = 0; public double translateX { get { return _translateX; } set { _translateX = value; NotifyPropertyChanged(nameof(translateX)); } } private double _translateY = 0; public double translateY { get { return _translateY; } set { _translateY = value; NotifyPropertyChanged(nameof(translateY)); } } }