/// <summary> /// Initializes a new instance of the <see cref="UcIOHandle"/> class. /// </summary> public UcIOHandle() { this.InitializeComponent(); ((LambdaConverter)this.FindResource("ToolTipConverter")).ConvertMethod = (value, targetType, parameter, culture) => { string typeName = (string)value; return(typeName != null?typeName.Split('.').Last() : null); }; this.customDragDropHelper = new CustomDragDropHelper(this, this.OnCustomDragDrop); DataContextChanged += OnDataContextChanged; this.LayoutUpdated += UcIOHandle_LayoutUpdated; }
/// <summary> /// Handles the Loaded event of this control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void UcNodeViewer_Loaded(object sender, RoutedEventArgs e) { if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) { List <UcIOHandle> ioHandles = LayoutHelper.FindAllLogicalChildren <UcIOHandle>(this); if (this is UcTransformationViewer) { ioHandles.AddRange(LayoutHelper.FindAllVisualChildren <UcIOHandle>((ItemsControl)this.FindName("icInputHandles"))); } this.IoHandles = ioHandles.ToArray(); this.customDragDropHelper = new CustomDragDropHelper(this, this.OnCustomDragDrop); } checkCompletelyLoaded(); }