/// <summary> /// Initialises the panel object. /// </summary> /// <param name="comm">Messenger object to communicate with other view models.</param> /// <param name="svc">The bug tracker web service.</param> /// <param name="activeProj">The currently active project.</param> public BugAddPanelViewModel(IMessenger comm, ITrackerService svc, ProjectViewModel activeProj, IGrowlNotifiactions notifier) : base(comm, svc, activeProj) { InitialiseBugViewModel(); _Notifier = notifier; }
/// <summary> /// Stores dependencies and initialises selected bug list. Also /// sets up a message listener to recieve incoming messages. /// </summary> /// <param name="comm">The mediator for communicatin with other view models.</param> /// <param name="svc">The bug tracker web service.</param> /// <param name="activeProj">The currently active project</param> public BugTableViewModel(IMessenger comm, ITrackerService svc, IGrowlNotifiactions notifier, IControlFactory ctrlfactory, ProjectViewModel activeProj) { _Messenger = comm; _Service = svc; _ControlFactory = ctrlfactory; if (activeProj != null && activeProj.Id != 0) { _ActiveProject = activeProj; ProjectTitle = activeProj.Name; } _Notifier = notifier; _SearchText = ""; _PageSize = GetPageSizeFromSettings(); _DefaultTableSortOrder = new SortDescription("Id", ListSortDirection.Descending); _BugListViewSource.Source = _BugList; InitSortingAndPaging(); if (_ActiveProject != null) { UpdateTableData(); } ListenForMessages(); }
public ProjectAddPanelViewModel(ITrackerService svc, IMessenger mess, IGrowlNotifiactions notifier) : base(svc, mess) { _Notifier = notifier; ButtonName = "Add & Close"; PanelTitle = "Add Project"; }
/// <summary> /// Registers singleton instances of dependency objects. When resolved, /// these objects are returned in their persistent state. /// </summary> /// <param name="container">Unity container to add instances to.</param> /// <returns>The new unity container.</returns> private IUnityContainer RegisterInstances(IUnityContainer container) { IMessenger mess = container.Resolve <IMessenger>(); IGrowlNotifiactions notifs = container.Resolve <IGrowlNotifiactions>(); container.RegisterInstance <IMessenger>(mess); container.RegisterInstance <IGrowlNotifiactions>(notifs); return(container); }
public ProjectViewPanelViewModel(ITrackerService svc, IMessenger mess, ProjectViewModel selectedProj, IGrowlNotifiactions notifier) : base(svc, mess) { Project = selectedProj.Clone(); _Notifier = notifier; ButtonName = "Save & Close"; PanelTitle = "Edit Project"; }
public ManagedProjectsPanelViewModel(ITrackerService svc, IMessenger mess, IControlFactory ctrlFactory, User currentUser, IGrowlNotifiactions notifier) { _Service = svc; _Messenger = mess; _Factory = ctrlFactory; _CurrentUser = currentUser; _Notifier = notifier; ListenForMessages(); }
/// <summary> /// Initialises the bug view panel and de-references the selected bug to /// ensure updates to the edited bug do not reflect in the bug table. /// Also initialises a message listener to monitor changes in selected bug. /// </summary> /// <param name="comm">The mediator object for communication between view models.</param> /// <param name="svc">The bug tracker web service.</param> /// <param name="activeProj">The currently active project.</param> /// <param name="selectedBug">The currently selected bug</param> public BugViewPanelViewModel(IMessenger comm, ITrackerService svc, ProjectViewModel activeProj, BugViewModel selectedBug, IGrowlNotifiactions notifier) : base(comm, svc, activeProj) { if (selectedBug == null) throw new ArgumentNullException("The selected bug cannot be null."); _Notifier = notifier; UpdateBugView(selectedBug); ListenForMessages(); }
/// <summary> /// Stores references to dependencies and initialses object fields. /// </summary> /// <param name="loader">The window loader.</param> /// <param name="svc">The registration web service.</param> public AccountSettingsViewModel(ITrackerService svc, IMessenger mess, IGrowlNotifiactions notifier) { _Service = svc; _Messenger = mess; _Notifier = notifier; User myUser = _Service.GetMyUser(); _FirstName = myUser.FirstName; _LastName = myUser.Surname; _FirstAndLastName = _FirstName + " " + _LastName; _Email = myUser.Username; _Password = myUser.Password; }
/// <summary> /// Initialises the bug view panel and de-references the selected bug to /// ensure updates to the edited bug do not reflect in the bug table. /// Also initialises a message listener to monitor changes in selected bug. /// </summary> /// <param name="comm">The mediator object for communication between view models.</param> /// <param name="svc">The bug tracker web service.</param> /// <param name="activeProj">The currently active project.</param> /// <param name="selectedBug">The currently selected bug</param> public BugViewPanelViewModel(IMessenger comm, ITrackerService svc, ProjectViewModel activeProj, BugViewModel selectedBug, IGrowlNotifiactions notifier) : base(comm, svc, activeProj) { if (selectedBug == null) { throw new ArgumentNullException("The selected bug cannot be null."); } _Notifier = notifier; UpdateBugView(selectedBug); ListenForMessages(); }
public MainWindow(IMainWindowViewModel viewModel, IGrowlNotifiactions notify) { if (viewModel == null) throw new ArgumentNullException("View model cannot be null."); _Notifications = notify; this.DataContext = viewModel; viewModel.RequestClose += delegate { _IsShuttingDown = false; this.Close(); }; InitializeComponent(); this.LocationChanged += new EventHandler(OnWindowMoved); this.Closing += new CancelEventHandler(OnWindowClose); this.Closed += OnClosed; this.SizeChanged += new SizeChangedEventHandler(OnWindowResized); this.WindowStartupLocation = WindowStartupLocation.CenterScreen; }
public MainWindow(IMainWindowViewModel viewModel, IGrowlNotifiactions notify) { if (viewModel == null) { throw new ArgumentNullException("View model cannot be null."); } _Notifications = notify; this.DataContext = viewModel; viewModel.RequestClose += delegate { _IsShuttingDown = false; this.Close(); }; InitializeComponent(); this.LocationChanged += new EventHandler(OnWindowMoved); this.Closing += new CancelEventHandler(OnWindowClose); this.Closed += OnClosed; this.SizeChanged += new SizeChangedEventHandler(OnWindowResized); this.WindowStartupLocation = WindowStartupLocation.CenterScreen; }
public JoinProjectPanelViewModel(ITrackerService svc, IGrowlNotifiactions notifier) { _Service = svc; _Notifier = notifier; _User = svc.GetMyUser(); }