private void LoadItems() { for (int i = 0; i < App.vimageConfig.CustomActions.Count; i++) { CustomActionItem item = new CustomActionItem(i, CustomActionItems); CustomActionItems.Children.Add(item); } }
private CustomActionItem AddCustomActionItem(string name = "", string func = "", int position = -1) { CustomActionItem item = new CustomActionItem(name, func); panel_CustomActions.Controls.Add(item); panel_CustomActions.Controls.SetChildIndex(item, 0); CustomActionItems.Add(item); item.AddConfigWindowReference(this); return(item); }
private void Add_Click(object sender, RoutedEventArgs e) { int index = CustomActionItems.Children.Count; App.vimageConfig.CustomActions.Add(new { name = "ACTION", func = "" }); App.vimageConfig.CustomActionBindings.Add(new { name = "ACTION", bindings = new List <int>() }); CustomActionItem item = new CustomActionItem(index, CustomActionItems); CustomActionItems.Children.Add(item); // update controls tab (Application.Current.MainWindow as MainWindow).ControlBindings.AddCustomActionBinding(index); // update context menu function list (Application.Current.MainWindow as MainWindow).ContextMenuEditor.UpdateCustomActions(); }
private CustomActionItem AddCustomActionItem(string name = "", string func = "", int position = -1) { CustomActionItem item = new CustomActionItem(name, func); panel_CustomActions.Controls.Add(item); panel_CustomActions.Controls.SetChildIndex(item, 0); CustomActionItems.Add(item); item.AddConfigWindowReference(this); return item; }