public EventTreeViewModel(RelayCommand editCmd) { _dbs = new GXEventService(); InitEvents(); Messenger.Base.Register <UpdateTreeViewMsg>(this, OnUpdateTreeViewReceived); LoadEventsCommand = new RelayCommand( (object q) => LoadEvents(q), (object q) => CanLoadEvents(q) ); EditEventCommand = editCmd; DoWorkCommand = AsyncCommand.Create(DoWork); }
public EventEditViewModel() { _dbs = new GXEventService(); ColorIdHex colors = new ColorIdHex(); ColorList = colors.GetColors(); InitModel(); // Init messenger and command Messenger.Base.Register <GXEvent>(this, OnEventToEditReceived); Messenger.Base.Register <ModifyEventStatusMsg>(this, OnModifyStatusReceived); CheckEventModifiedCommand = new RelayCommand( (object q) => EventModified = !Event.Equals(_originalEvent), (object q) => { return(true); } ); CloseWindowCommand = new RelayCommand( (object q) => { ((Window)q).Close(); }, (object q) => { return(true); } ); DoWorkCommand = AsyncCommand.Create(DoWork); DeleteEventCommand = AsyncCommand.Create(DeleteEvent); }
public EventsViewModel(Window[] views) { _dbs = new GXEventService(); _cachedEvents = null; _lastFilterQuery = ""; FilterQuery = ""; RefreshEvents(viewableEventsNum); // Init commands and messenger Messenger.Base.Register <ModifyEventMsg>(this, OnModifyEventReceived); EditEventCommand = new RelayCommand( (object q) => EditEvent(q), (object q) => { return(true); } ); DoWorkCommand = AsyncCommand.Create(DoWork); FilterCommand = AsyncCommand.Create(Filter); SwitchAccountCommand = AsyncCommand.Create(SwitchAccount); TreeViewCommand = AsyncCommand.Create(TreeView); // Views for edit and wide view functions _editViewService = new ViewService(views[0]); _treeViewService = new ViewService(views[1]); }
public void DbInit() { _db = new EventTestContext(); _service = new GXEventService(_db); }