示例#1
0
 protected override void dispose()
 {
     this.MenuItems   = null;
     this.UserInfo    = null;
     this.VersionInfo = null;
     this.SearchInfo  = null;
 }
示例#2
0
 public MenuUserControlViewModel()
 {
     if (DiManager.GetInstance().IsRegistered <INavigationService>())
     {
         this.navigationService = DiManager.GetInstance().Resolve <INavigationService>();  //TODO: clean up, catch exception
     }
     else
     {
         this.navigationService = null;
     }
     this.SearchInfo = new SearchBoxUserControlViewModel()
     {
         DelayingTextInputUserControlViewModel = new DelayingTextInputUserControlViewModel()
         {
             Text = "Something2!", Hint = "Search"
         }
     };
     this.VersionInfo = new VersionInfoUserControlViewModel()
     {
         Version = new VersionModel(new Version(1, 1), new DateTimeOffset(2019, 03, 04, 23, 59, 59, new TimeSpan(-1, 0, 0)))
     };
     this.UserInfo = new UserInfoUserControlViewModel()
     {
         User = new UserModel()
         {
             Firstname = "Nigel", Lastname = "Lotze", Nickname = "Lotzinator", CurrentLevel = new LevelModel()
             {
                 MinExperience = 100, MaxExperience = 102, Title = "Grand Geek"
             }, Experience = 101
         }
     };
     this.MenuItems = new MenuItemsUserControlViewModel(this.navigationService)
     {
         Items = new ObservableCollection <BaseMenuItemUserControlViewModel>()
         {
         }
     };
     this.MenuItems.Items.Add(new BaseMenuItemUserControlViewModel(this.navigationService, this.MenuItems)
     {
         Item = new Apps.UXDemo.Models.MenuItem("Demo1", "DemoPageViewModel")
     });
     this.MenuItems.Items.Add(new BaseMenuItemUserControlViewModel(this.navigationService, this.MenuItems)
     {
         Item = new Apps.UXDemo.Models.MenuItem("Demo2", "DemoPage2ViewModel")
     });
     this.MenuItems.Items.Add(new BaseMenuItemUserControlViewModel(this.navigationService, this.MenuItems)
     {
         Item = new Apps.UXDemo.Models.MenuItem("Demo3", "DemoPage3ViewModel")
     });
 }