private void FormatOnClick(object sender, RoutedEventArgs e) { StylusToolDialog dlg = new StylusToolDialog(); dlg.Owner = this; dlg.Title = "Format Selection"; StrokeCollection strokes = this.inkcanv.GetSelectedStrokes(); if (strokes.Count > 0) { dlg.DrawingAttributes = strokes[0].DrawingAttributes; //获取选中的首个笔画特征 } else { dlg.DrawingAttributes = this.inkcanv.DefaultDrawingAttributes; } if ((bool)dlg.ShowDialog().GetValueOrDefault()) { foreach (Stroke strk in strokes) { strk.DrawingAttributes = dlg.DrawingAttributes; } } }
private void StylusToolOnClick(object sender, RoutedEventArgs e) { StylusToolDialog dlg = new StylusToolDialog(); dlg.Owner = this; dlg.DrawingAttributes = this.inkcanv.DefaultDrawingAttributes; if ((bool)dlg.ShowDialog().GetValueOrDefault()) { this.inkcanv.DefaultDrawingAttributes = dlg.DrawingAttributes; } }