Ejemplo n.º 1
0
        private void SetActiveView(string view, DateTime?period)
        {
            if (_childVM != null && _childVM.Count > 0)
            {
                GspBaseViewModel selectedView = null;
                if (view.Length > 0)
                {
                    if (view == Constants.VIEW_WORKSCHEDULE)
                    {
                        selectedView = _childVM.SingleOrDefault(x => x.ToString().EndsWith(view + "Model"));
                    }
                    else
                    {
                        selectedView = _childVM.SingleOrDefault(x => x.ToString().Contains(view));
                    }
                }
                SelectedView = selectedView ?? _childVM[0];

                if (period.HasValue && SelectedView != null && SelectedView.GetType() == typeof(WorkScheduleViewModel))
                {
                    var workScheduleView = (WorkScheduleViewModel)SelectedView;
                    ContextService.Current.CommonDataContextService.StartDate = period.Value;
                    workScheduleView.LoadOnActivate = true;
                }
            }
        }
Ejemplo n.º 2
0
 private void SetViewModelState(GspBaseViewModel vm, bool enabled)
 {
     vm.IsTabEnabled = enabled;
 }