private void ResetPosition(Object arg) { ImagePosition = new Thickness(0, 0, 0, 0); SendDisplayedImage sdi = new SendDisplayedImage(); sdi.IsSynchronized = IsSynchronized; sdi.PresenterID = ViewModelID; sdi.Image = DisplayedImage; sdi.DoReset = true; _aggregator.GetEvent <SendDisplayedImage>().Publish(sdi); }
public void AffectImage(Dictionary <String, Object> args) { try { Image image = (Image)args["DisplayedImage"]; int mouseX = (int)((int)args["MouseX"]); int mouseY = (int)((int)args["MouseY"]); int mouseXDelta = (int)((int)args["MouseXDelta"]); int mouseYDelta = (int)((int)args["MouseYDelta"]); int mouseClickX = (int)((System.Windows.Point)args["MouseClickPosition"]).X; int mouseClickY = (int)((System.Windows.Point)args["MouseClickPosition"]).Y; int presenterID = (int)args["PresenterID"]; Thickness imagePosition = (Thickness)args["Position"]; int offsetX = mouseX - mouseClickX; int offsetY = mouseY - mouseClickY; imagePosition.Left = imagePosition.Left + offsetX - mouseXDelta; imagePosition.Right = -imagePosition.Left; imagePosition.Top = imagePosition.Top + offsetY - mouseYDelta; imagePosition.Bottom = -imagePosition.Top; image.Position = imagePosition; IEventAggregator aggregator = GlobalEvent.GetEventAggregator(); SendDisplayedImage sdi = new SendDisplayedImage(); sdi.Image = image; sdi.PresenterID = presenterID; sdi.IsSynchronized = (bool)args["IsSynchronized"]; sdi.DoProcessing = (bool)args["DoProcessing"]; sdi.OffsetX = offsetX - mouseXDelta; sdi.OffsetY = offsetY - mouseYDelta; sdi.DoReset = false; aggregator.GetEvent <SendDisplayedImage>().Publish(sdi); } catch (Exception) { return; } }