public override void OnApplyTemplate() { base.OnApplyTemplate(); _b = (Border)GetTemplateChild("Border"); if (SelectedObject != null) { var p = new UiElementTypeConverter1().ConvertTo(SelectedObject, typeof(UIElement)); _b.Child = (UIElement)p; } }
private void SelectedObjectChanged(object eOldValue, object eNewValue) { if (_b != null) { if (eNewValue != null) { var p = new UiElementTypeConverter1().ConvertTo(eNewValue, typeof(UIElement)); _b.Child = (UIElement)p; } } }