public void createShadow(Point fromInkableScene) { InkableScene inkableScene = MainViewController.Instance.InkableScene; if (inkableScene != null) { _shadow = new CreateLinkMenuItemView(); _shadow.DataContext = new CreateLinkMenuItemViewModel(); _shadow.Width = this.ActualWidth; _shadow.Height = this.ActualHeight; _shadow.RenderTransform = new TranslateTransform() { X = fromInkableScene.X - _shadow.Width / 2.0, Y = fromInkableScene.Y - _shadow.Height }; inkableScene.Add(_shadow); _shadow.SendToFront(); } }
void mainPointerManager_Removed(object sender, PointerManagerEvent e) { if (_shadow != null) { InkableScene inkableScene = MainViewController.Instance.InkableScene; Rct bounds = _shadow.GetBounds(inkableScene); /*model.AttributeTransformationViewModel.FireDropped(bounds, * new AttributeTransformationModel(model.AttributeTransformationViewModel.AttributeTransformationModel.AttributeModel) * { * AggregateFunction = model.AttributeTransformationViewModel.AttributeTransformationModel.AggregateFunction * }); */ inkableScene.Remove(_shadow); _shadow = null; var model = ((MenuItemViewModel)this.DataContext).MenuItemComponentViewModel as CreateLinkMenuItemViewModel; if (model != null) { model.FireCreateLinkEvent(bounds); } } }