public GroupDetailViewModel() { //item acions NewItemCommand = new CustomCommand(CreateItem, CanCreate); RemoveItemCommand = new CustomCommand(RemoveItem, CanRemoveItem); //save/cancel actions SaveCommand = new CustomCommand(SaveItem, CanSaveItem); CancelCommand = new CustomCommand(CancelChanges, CanCancel); //add/remove user from group RemoveUserFromGroupCommand = new CustomCommand(DeleteFromGroup, CanDelete); AddUserToGroupCommand = new CustomCommand(AddUsers, CanAdd); //Paste/copy OwnedPermisisons PasteCommand = new CustomCommand(PasteItemDetails, CanPaste); CopyCommand = new CustomCommand(CopyItemDetails, CanCopy); WindowClosingCommand = new CustomCommand(CancelChanges, CanCancel); //copy between group and user, receive a copy Messenger.Default.Register<Memento<PermissionsBase>>(this, CopyReceived); //Check if Userlist has been updated Messenger.Default.Register<UsersUpdated>(this, UpdateUsers); }
public StartWindow() { InitializeComponent(); Command = new CustomCommand(doCommand, (object obj) => { return true; }); createUserItems = new MenuItems(); methods.Add("New", GetMethodInfo(New)); methods.Add("Save", GetMethodInfo(Save)); methods.Add("Delete", GetMethodInfo(Delete)); methods.Add("Cancel", GetMethodInfo(Cancel)); methods.Add("Print", GetMethodInfo(Print)); methods.Add("Find", GetMethodInfo(Find)); methods.Add("Help", GetMethodInfo(Help)); methods.Add("Close", GetMethodInfo(Close)); }
public UserDetailViewModel() { NewItemCommand = new CustomCommand(CreateItem, CanCreate); RemoveItemCommand = new CustomCommand(RemoveItem, CanRemoveItem); CancelCommand = new CustomCommand(CancelChanges, CanCancel); SaveCommand = new CustomCommand(SaveItem, CanSaveItem); RemoveUserFromGroupCommand = new CustomCommand(DeleteUserFromGroup, CanDeleteGroup); AddUserToGroupCommand = new CustomCommand(AddUserToGroup, CanAdd); PasteCommand = new CustomCommand(PasteItemDetails, CanPaste); CopyCommand = new CustomCommand(CopyItemDetails, CanCopy); WindowClosingCommand = new CustomCommand(CancelChanges, CanCancel); Messenger.Default.Register<Memento<PermissionsBase>>(this, CopyReceived); Messenger.Default.Register<GroupChanged>(this, GroupsChanged); }
public CustTreeItems() { _Items = new ObservableCollection<CustTreeItems>(); _Options = new ObservableCollection<Permission>(); Command = new CustomCommand(OpenWindow, CanOpenWindow); }
public Session() { //Messenger.Default.Register<CloseUserDetail>(this, closeUserDetail); Messenger.Default.Register<DetailBase>(this, closewin); //Messenger.Default.Register<DoLogin>(this, doLogin); //Messenger.Default.Register<CloseApplication>(this, closeApplication); UserDetail = new CustomCommand(openUserdetail, (obj) => { return true; }); GroupDetail = new CustomCommand(openGroupDetail, (obj) => { return true; }); LoginCommand = new CustomCommand(doLoginAction, (obj) => { return !string.IsNullOrEmpty(Email) && !string.IsNullOrEmpty(_Password); }); CancelCommand = new CustomCommand(cancel, (obj) => { return true; }); //Messenger.Default.Register<CloseGroupDetail>(this, closeGroupDetail); }