private void ContentTakeOver_Click(object sender, RoutedEventArgs e) { var x = DisplayElements.SelectedItem; if (x != null && x is VisualElementGeneric) { x.RefreshFromMainData(); } DisplayElements.Refresh(); ContentTakeOver.IsEnabled = false; }
public void RedrawAllAasxElements() { var t = "AASX Package Explorer"; if (thePackageEnv != null) { t += " - " + System.IO.Path.GetFileName(thePackageEnv.Filename); } if (thePackageAux != null) { t += " (auxiliary AASX: " + System.IO.Path.GetFileName(thePackageAux.Filename) + ")"; } this.Title = t; // clear the right section, first (might be rebuild by callback from below) DispEditEntityPanel.DisplayClear(); ContentTakeOver.IsEnabled = false; // rebuild middle section DisplayElements.RebuildAasxElements(this.thePackageEnv.AasEnv, this.thePackageEnv, null, MenuItemWorkspaceEdit.IsChecked); DisplayElements.Refresh(); }
private void dispatcherTimer_Tick(object sender, EventArgs e) { // check for Stored Prints in Log if (Log.StoredPrints.Count > 0) { var sp = Log.StoredPrints.Last(); Message.Content = "" + sp.msg; if (sp.color == Log.ColorBlack) { Message.Background = Brushes.White; } if (sp.color == Log.ColorBlue) { Message.Background = Brushes.LightBlue; } if (sp.color == Log.ColorRed) { Message.Background = Brushes.Red; } } // check if Display/ Edit Control has some work to do .. try { if (DispEditEntityPanel != null && DispEditEntityPanel.WishForOutsideAction != null) { while (DispEditEntityPanel.WishForOutsideAction.Count > 0) { var temp = DispEditEntityPanel.WishForOutsideAction[0]; DispEditEntityPanel.WishForOutsideAction.RemoveAt(0); // what to do? if (temp is ModifyRepo.LambdaActionRedrawAllElements) { var wish = temp as ModifyRepo.LambdaActionRedrawAllElements; // edit mode affects the total element view RedrawAllAasxElements(); // the selection will be shifted .. if (wish.NextFocus != null) { var si = DisplayElements.SearchVisualElementOnMainDataObject(wish.NextFocus); if (si != null) { si.IsSelected = true; if (wish.IsExpanded == true) { // go upward the tree in order to expand, as well var sii = si; while (sii != null) { sii.IsExpanded = wish.IsExpanded == true; sii = sii.Parent; } } if (wish.IsExpanded == false) { si.IsExpanded = wish.IsExpanded == true; } DisplayElements.Woodoo(si); } } // fake selection RedrawElementView(); DisplayElements.Refresh(); ContentTakeOver.IsEnabled = false; } if (temp is ModifyRepo.LambdaActionContentsChanged) { // enable button ContentTakeOver.IsEnabled = true; } if (temp is ModifyRepo.LambdaActionContentsTakeOver) { // rework list ContentTakeOver_Click(null, null); } } } } catch (Exception ex) { Log.Error(ex, "While responding to a user interaction"); } }