void initText(Color c) { _textEnterUC = new TextUC(this); _textEnterUC.txtLabel.Effect = ShapeUtils.ShadowProvider(); _textEnterUC.txtLabel.Foreground = new SolidColorBrush(c); _textEnterUC.DataContext = this; _textEnterUC.Tag = this; _textEnterUC.field.Tag = this; _textEnterUC.handle.Tag = this; _textEnterUC.textChanged += TextChanged; _textEnterUC.MouseWheel += MouseWheel; }
public static IVdShape findVdText(object originalSrc) { DependencyObject findSource = originalSrc as FrameworkElement; TextUC vdText = null; while (vdText == null && findSource != null) { if ((vdText = findSource as TextUC) == null) { findSource = VisualTreeHelper.GetParent(findSource); } } if (vdText == null) { return(null); } else { return(vdText.Tag as IVdShape); } }