void MethodBodyControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { var data = DataContext as MethodBodyVM; if (data == null) { return; } var ownerWindow = Window.GetWindow(this); localsListHelper = new LocalsListHelper(localsListView, ownerWindow); instructionsListHelper = new InstructionsListHelper(instructionsListView, ownerWindow); exceptionHandlersListHelper = new ExceptionHandlersListHelper(ehListView, ownerWindow); localsListHelper.OnDataContextChanged(data); instructionsListHelper.OnDataContextChanged(data); exceptionHandlersListHelper.OnDataContextChanged(data); }
protected override void CopyItemsAsText(SwitchInstructionVM[] instrs) { Array.Sort(instrs, (a, b) => a.Index.CompareTo(b.Index)); InstructionsListHelper.CopyItemsAsTextToClipboard(instrs.Select(a => a.InstructionVM).ToArray()); }