//https://docs.microsoft.com/en-us/dotnet/api/system.windows.dependencypropertychangedeventargs?view=netcore-3.1 private static void OnGetLastEventDataChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) { uImageControl imageControl = (uImageControl)obj; ROIDescriptor.LastEventData lastEventData = (ROIDescriptor.LastEventData)args.NewValue; ROIDescriptor.LastEventData other = (ROIDescriptor.LastEventData)args.OldValue; if (lastEventData.type == EventType.Draw) { ROIDescriptor lastROIDescriptor = imageControl._lastROIDescriptor; ROIDescriptor previousROIDescriptor = imageControl.GetROIDescriptor(); if (!lastEventData.IsChanged(other) || !previousROIDescriptor.IsChanged(lastROIDescriptor)) { imageControl._lastROIDescriptor = previousROIDescriptor; imageControl.OnROIValueChanged(new ROIValueChangedEventArgs(lastEventData, lastROIDescriptor, previousROIDescriptor)); } } }
private void OnGetLastDrawEventUpdated(object sender, ROIDescriptor.LastEventArgs lastEventArgs) { GetLastEventData = lastEventArgs.data; }
public ROIValueChangedEventArgs(ROIDescriptor.LastEventData lastEventData, ROIDescriptor oldROI, ROIDescriptor newROI) { this.lastEventData = lastEventData; this.ROI = newROI; }