public void ConfigByMenu(PenMenuItemChangedArgs ex, bool isNeedClose = true) { if (ex.Command != PenMenuCommand.Close) { this.lastAction = ex; } if (this.lastAction != null && this.lastAction.PenDetail != null) { this.lastPenColor = this.lastAction.PenDetail.PenColor; } if (ex.CommandType == PenMenuCommandType.Highlight) { this.SetPenHighlight(true); this.inkCanvas.EditingMode = SurfaceInkEditingMode.Ink; } if (ex.CommandType == PenMenuCommandType.Marker) { this.SetPenHighlight(false); this.inkCanvas.EditingMode = SurfaceInkEditingMode.Ink; } if (ex.Command == PenMenuCommand.Eraser) { this.inkCanvas.EditingMode = SurfaceInkEditingMode.EraseByStroke; } if (ex.Command == PenMenuCommand.SmoothlyPen) { this.IsSmoothly = true; this.inkCanvas.EditingMode = SurfaceInkEditingMode.Ink; } if (ex.Command == PenMenuCommand.FreeHandPen) { this.IsSmoothly = false; this.inkCanvas.EditingMode = SurfaceInkEditingMode.Ink; } if (ex.Command == PenMenuCommand.Close) { if (this.CloseEvent != null) { this.CloseEvent(this, ex); } return; } this.txtAnimationTip.Visibility = System.Windows.Visibility.Collapsed; if (ex.CommandType == PenMenuCommandType.Tools && ex.Command == PenMenuCommand.LassoSelected) { this.inkCanvas.ReleaseAllTouchCaptures(); this.lasso.IsAnimation = false; this.BeginLasso(); } else if (ex.Command == PenMenuCommand.Animation) { this.inkCanvas.ReleaseAllTouchCaptures(); this.lasso.IsAnimation = true; this.BeginLasso(); ShowAnimationTip(); } else { // this.ctrlWhiteBoard.IsEnabled = true; this.lasso.End(); //(AttachedCollaborateObj as IUIAttachedObject).FocusLayer(true); this.lasso.ReleaseAllTouchCaptures(); } }
private void menu_PenMenuCommandFireEvent(object sender, PenMenuItemChangedArgs ex) { ConfigByMenu(ex); CloseMenu(); }