/// <summary>
        /// Initializes a new instance of the <see cref="DepartmentsViewModel"/> class. 
        /// </summary>
        public DepartmentsViewModel(IMessageMediator messageMediator, IDepartmentRepository departmentRepository, 
            IUIVisualizerService uiVisualizerService, IUICompositionService uiCompositionService)
            : base(messageMediator)
        {
            _uiVisualizerService = uiVisualizerService;
            _uiCompositionService = uiCompositionService;

            Departments = new FastObservableCollection<IDepartment>(departmentRepository.GetAllDepartments());
            if (Departments.Count > 0)
            {
                SelectedDepartment = Departments[0];
            }

            Select = new Command(OnSelectExecute);
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DepartmentsViewModel"/> class.
        /// </summary>
        public DepartmentsViewModel(IMessageMediator messageMediator, IDepartmentRepository departmentRepository,
                                    IUIVisualizerService uiVisualizerService, IUICompositionService uiCompositionService)
            : base(messageMediator)
        {
            _uiVisualizerService  = uiVisualizerService;
            _uiCompositionService = uiCompositionService;

            Departments = new FastObservableCollection <IDepartment>(departmentRepository.GetAllDepartments());
            if (Departments.Count > 0)
            {
                SelectedDepartment = Departments[0];
            }

            Select = new Command(OnSelectExecute);
        }
示例#3
0
 /// <summary>
 /// Tries to activate an existing view model in the specified region name. If there is no view model alive, it will create one
 /// and navigate to that view model.
 /// </summary>
 /// <typeparam name="TViewModel">The type of the view model.</typeparam>
 /// <param name="uiCompositionService">The UI composition service.</param>
 /// <param name="regionName">Name of the region.</param>
 public static void Activate <TViewModel>(this IUICompositionService uiCompositionService, string regionName)
     where TViewModel : IViewModel
 {
     uiCompositionService.Activate(typeof(TViewModel), regionName);
 }