public object ConvertBack(object value, Type type, object parameter, CultureInfo culture) { UIElement control = value as UIElement; if (control == null) { return(""); } CanvasView cv = CanvasView.GetCanvasView(control); return(cv.ElementFromControl(control).GetStringAttribute("Id")); }
/// <summary> /// Convert given <seealso cref="UIElement"/> reference from <seealso cref="CanvasView"/> /// into shapeID of type <seealso cref="string"/>. /// </summary> /// <param name="value"></param> /// <param name="type"></param> /// <param name="parameter"></param> /// <param name="culture"></param> /// <returns></returns> public object ConvertBack(object value, Type type, object parameter, CultureInfo culture) { UIElement control = value as UIElement; if (control == null) { return(string.Empty); } CanvasView cv = CanvasView.GetCanvasView(control); return(cv.ElementFromControl(control).ID); }