예제 #1
0
        public MainViewModel(
            IBusyStateRegistry busyStateManager,
            INavigationService navigationService,
            MvvmDialogs.IDialogService dialogService)
        {
            // This long route to the assembly name is to ensure tests also work
            Title = Assembly.GetExecutingAssembly().GetCustomAttributes(
                typeof(AssemblyProductAttribute))
                    .OfType <AssemblyProductAttribute>()
                    .FirstOrDefault()
                    .Product;

            BusyStateManager     = busyStateManager;
            _navigationService   = navigationService;
            SelectedIndexManager = _navigationService;
            SelectedIndexManager.SelectedIndex = (int)HamburgerNavItemsIndex.Login;

            DialogService = dialogService;

            StoryFilterCmd      = new RelayCommand(OnStoryFilter, () => CanExecuteStoryFilter);
            ClearStoryFilterCmd = new RelayCommand(OnClearStoryFilter, () => CanExecuteStoryFilter);
            FullScreenCmd       = new RelayCommand(OnFullScreen, () => CanExecuteFullScreenToggle);
            TinkerCmd           = new RelayCommand(() => Tinker.Run(), () => true);
            ExitCmd             = new RelayCommand(OnExit);

            MessengerInstance.Register <AuthenticatedMessage>(this, OnAuthenticated);
        }
예제 #2
0
        public MainViewModel(
            BusyStateManager busyStateManager,
            INavigationService navigationService,
            MvvmDialogs.IDialogService dialogService)
        {
            Title = Assembly.GetEntryAssembly().GetName().Name;

            BusyStateManager     = busyStateManager;
            _navigationService   = navigationService;
            SelectedIndexManager = _navigationService;
            SelectedIndexManager.SelectedIndex = (int)HamburgerNavItemsIndex.Login;

            DialogService = dialogService;

            StoryFilterCmd      = new RelayCommand(OnStoryFilter, () => CanExecuteStoryFilter);
            ClearStoryFilterCmd = new RelayCommand(OnClearStoryFilter, () => CanExecuteStoryFilter);
            FullScreenCmd       = new RelayCommand(OnFullScreen, () => CanExecuteFullScreenToggle);
            ExitCmd             = new RelayCommand(OnExit);

            MessengerInstance.Register <AuthenticatedMessage>(this, OnAuthenticated);
        }