protected void IsNotEditingAndAdding() { ToolBarItems.ChangeToolBarItemStatus("Add", true); ToolBarItems.ChangeToolBarItemStatus("Save", false); ToolBarItems.ChangeToolBarItemStatus("Delete", false); OnNotEditingAndAdding(); }
protected void IsEditing() { ToolBarItems.ChangeToolBarItemStatus("Add", true); ToolBarItems.ChangeToolBarItemStatus("Save", true); ToolBarItems.ChangeToolBarItemStatus("Delete", true); OnEditing(); }
private void CategoryTreeListControl_OnSelectedItemChanged(object sender, SelectedItemChangedEventArgs e) { if (e.NewItem is Category category) { ToolBarItems.ChangeToolBarItemStatus("Edit", true); ToolBarItems.ChangeToolBarItemStatus("Delete", true); } else { ToolBarItems.ChangeToolBarItemStatus("Edit", false); ToolBarItems.ChangeToolBarItemStatus("Delete", false); } }
protected sealed override void SetToolBarItems() { var addButton = new FmAddBarButtonItem(); addButton.ItemClick += AddButtonOnToolBarItemClick; var editButton = new FmEditBarButtonItem(); editButton.ItemClick += EditButtonOnToolBarItemClick; var deleteButton = new FmDeleteBarButtonItem(); deleteButton.ItemClick += DeleteButtonOnToolBarItemClick; ToolBarItems.Add(addButton.Name, addButton); ToolBarItems.Add(editButton.Name, editButton); ToolBarItems.Add(deleteButton.Name, deleteButton); ToolBarItems.ChangeToolBarItemStatus("Edit", false); ToolBarItems.ChangeToolBarItemStatus("Delete", false); }