private void PackageContainerListControl_ButtonClick( Control senderList, PackageContainerListBase fr, PackageContainerListControl.CustomButton btn, Button sender) { if (btn == PackageContainerListControl.CustomButton.Context) { var cm = DynamicContextMenu.CreateNew(); cm.Add(new DynamicContextItem("FileRepoClose", "\u274c", "Close")); if (!(fr is PackageContainerListLastRecentlyUsed)) { cm.Add(new DynamicContextItem("item-up", "\u25b2", "Move Up")); cm.Add(new DynamicContextItem("item-down", "\u25bc", "Move Down")); } cm.Add(new DynamicContextItem("", new Separator())); cm.Add(new DynamicContextItem("FileRepoSaveAs", "\U0001f4be", "Save as ..")); cm.Add(new DynamicContextItem("", new Separator())); if (!(fr is PackageContainerListLastRecentlyUsed)) { if (fr is PackageContainerListLocal) { cm.Add(new DynamicContextItem( "FileRepoMakeRelative", "\u2699", "Make AASX filenames relative ..")); } cm.Add(new DynamicContextItem("FileRepoAddCurrent", "\u2699", "Add current AAS")); cm.Add(new DynamicContextItem("FileRepoMultiAdd", "\u2699", "Add multiple AASX files ..")); cm.Add(new DynamicContextItem("FileRepoAddFromServer", "\u2699", "Add from REST server ..")); cm.Add(new DynamicContextItem("FileRepoPrint", "\u2699", "Print 2D code sheet ..")); } cm.Start(sender, (tag) => { CommandBinding_FileRepoAll(senderList, fr, tag); }); } if (btn == PackageContainerListControl.CustomButton.Query) { CommandBinding_FileRepoAll(senderList, fr, "FileRepoQuery"); } }
private void Button_Click(object sender, RoutedEventArgs e) { if (sender == ButtonDetailsBack) { TabControlDetail.SelectedItem = TabItemMsgEnvelope; } if (sender == ButtonOptions) { var cm = DynamicContextMenu.CreateNew(); cm.Add(new DynamicContextItem("ClearList", "\u2205", "Clear list")); cm.Add(new DynamicContextItem("CopyJson", "\u29c9", "Copy JSON")); cm.Add(new DynamicContextItem("SaveJson", "\U0001f4be", "Save JSON ..")); cm.Start(sender as Button, (tag) => { CommandBinding_ContextMenu(tag); }); } }