public JournalWindowViewModel(Token token, IMessageService messageService, IPleaseWaitService pleaseWaitService, ActType?filter = null)
 {
     _token             = token;
     _messageService    = messageService;
     _pleaseWaitService = pleaseWaitService;
     DisplayingActs     = new ObservableCollection <DisplayingJournalAct>();
     IsCentral          = token.UserRegion == Region.All;
     ActTypes           = new ObservableCollection <string>();
     Regions            = new ObservableCollection <string>();
     for (int i = 0; i < Enum.GetNames(typeof(ActType)).Length; i++)
     {
         if (i == 0)
         {
             continue;
         }
         ActTypes.Add(DlrStaticMethods.GetFullActName((ActType)i));
     }
     for (int i = 0; i < Enum.GetNames(typeof(Region)).Length; i++)
     {
         if (i == 0)
         {
             continue;
         }
         Regions.Add(DlrStaticMethods.GetRegionName((Region)i));
     }
     Regions.Add("Все");
     SelectedRegionIndex = Regions.IndexOf("Все");
     ActTypes.Add("Все");
     SelectedActTypeIndex = ActTypes.IndexOf("Все");
 }
Example #2
0
 private async void Authenticate()
 {
     var authVm = new AuthWindowViewModel(_messageService);
     await _uiVisualizerService.ShowDialogAsync(authVm, (o, e) =>
     {
         if (e.Result.HasValue && authVm.Token != null)
         {
             _token        = authVm.Token;
             UserRegion    = DlrStaticMethods.GetRegionName(_token.UserRegion);
             Authenticated = true;
         }
     });
 }