示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZonesViewModel"/> class.
 /// </summary>
 /// <param name="navigationService">The navigation service.</param>
 public ZonesViewModel(NavigationServiceEx navigationService)
 {
     Devices = new ObservableCollection <Device>();
     this.navigationService = navigationService;
     this.logger            = App.ServiceProvider.GetService(typeof(ILogger <ZonesViewModel>)) as ILogger <ZonesViewModel>;
     this.service           = App.ServiceProvider.GetService(typeof(MusicCastService)) as MusicCastService;
 }
示例#2
0
        private NavigationServiceEx InitializeNavigationService()
        {
            NavigationServiceEx navService = new NavigationServiceEx();

            navService.Configure(nameof(MainPage), typeof(MainPage));
            navService.Configure(nameof(SettingsPage), typeof(SettingsPage));
            return(navService);
        }
示例#3
0
        public MainWindow()
        {
            this.InitializeComponent();
            this.navigationServiceEx            = new NavigationServiceEx();
            this.navigationServiceEx.Navigated += this.NavigationServiceEx_OnNavigated;
            this.HamburgerMenuControl.Content   = this.navigationServiceEx.Frame;

            // Navigate to the home page.
            this.Loaded += (sender, args) => this.navigationServiceEx.Navigate(new Uri("Vues/Test.xaml", UriKind.RelativeOrAbsolute));
        }
        private void AttractorLoopPlayer_Interacted(object sender, InteractedEventArgs args)
        {
            // get the locator from app.xaml
            ViewModels.ViewModelLocator Locator = Application.Current.Resources["Locator"] as ViewModels.ViewModelLocator;

            // use it to get the navigation service
            NavigationServiceEx NavigationService = Locator?.NavigationService;

            // navigate
            NavigationService?.Navigate(typeof(FlipViewViewModel).FullName);
        }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DeviceDetailPageViewModel"/> class.
        /// </summary>
        /// <param name="navigationService">The navigation service.</param>
        public DeviceDetailPageViewModel(NavigationServiceEx navigationService)
        {
            this.InputList     = new ObservableCollection <Input>();
            this.FavoritesList = new ObservableCollection <Preset>();

            this.navigationService = navigationService;
            this.service           = App.ServiceProvider.GetService(typeof(MusicCastService)) as MusicCastService;


            navigationService.Navigated += NavigationService_NavigatedAsync;
        }
示例#6
0
        private void ConfigureNavigationService(NavigationServiceEx navigationService)
        {
            navigationService.Configure(NavigationSource.MainView.ToString(), typeof(MainView));

            navigationService.Configure(NavigationSource.PhotoView.ToString(), typeof(PhotoView));

            navigationService.Configure(NavigationSource.DocumentView.ToString(), typeof(DocumentView));

            navigationService.Configure(NavigationSource.CurrentCategoryView.ToString(), typeof(CurrentCategoryView));

            navigationService.Configure(NavigationSource.PostProccesView.ToString(), typeof(PostProccesView));
        }
示例#7
0
 public UserStoriesViewModel(
     IVstsService vstsService,
     NavigationServiceEx navigationService,
     IDialogServiceEx dialogService,
     RecognitionService recognitionService,
     SpeechService speechService)
     : base(vstsService,
            navigationService,
            dialogService,
            recognitionService,
            speechService)
 {
 }
示例#8
0
        private void DeviceTwoButton_Click(object sender, RoutedEventArgs e)
        {
            // navigate to the next page (flipview)

            // get the locator from app.xaml
            ViewModels.ViewModelLocator Locator = Application.Current.Resources["Locator"] as ViewModels.ViewModelLocator;

            // use it to get the navigation service
            NavigationServiceEx NavigationService = Locator?.NavigationService;

            // navigate to the flipview page
            NavigationService?.Navigate(typeof(FlipViewViewModel).FullName);
        }
示例#9
0
 public SearchViewModel(IShopApiService shopService, NavigationServiceEx navigationService, ProgressService progressService)
 {
     _shopService       = shopService;
     _navigationService = navigationService;
     _progressService   = progressService;
     PropertyChanged   += OnPropertyChanged;
     _facetsRequest     = new FacetsRequest {
         Filters = new Dictionary <string, IList <string> > {
             { GenderFilter, new List <string> {
                   GenderKey
               } }
         }
     };
 }
        private void AttractorLoopPlayer_Interacted(object sender, InteractedEventArgs args)
        {
            // get the locator from app.xaml
            ViewModels.ViewModelLocator Locator = Application.Current.Resources["Locator"] as ViewModels.ViewModelLocator;

            // use it to get the navigation service
            NavigationServiceEx NavigationService = Locator?.NavigationService;

            // navigate to the starting page - is choose pah enabled?
            if ((ConfigurationService.Current.IsLoaded) && (ConfigurationService.Current.Configuration.IsChoosePathPageEnabled))
            {
                // go to the choose path page
                NavigationService?.Navigate(typeof(ChoosePathViewModel).FullName);
            }
            else
            {
                // no, so go to the intro hero page
                NavigationService?.Navigate(typeof(FlipViewViewModel).FullName);
            }
        }
示例#11
0
        static ViewModelLocator()
        {
            NavigationServiceEx _navigationService = new NavigationServiceEx();

            void Register <VM, V>(IServiceCollection services) where VM : class
            {
                //services.AddTransient<VM>();
                _navigationService.Configure(typeof(VM).FullName, typeof(V));
            }

            ServiceCollection services = new ServiceCollection();

            services.AddSingleton <IDialogService, DialogService>();
            services.AddSingleton(s => _navigationService);
            services.AddSingleton(s => ResourceHelper.AppSettings);
            services.AddSingleton(s => new NativeInterop(Utils.CanvasDevice));
            services.AddSingleton <UserCollectionsService>();
            services.AddSingleton <MainViewModel>();
            Register <MainViewModel, MainPage>(services);
            Ioc.Default.ConfigureServices(services.BuildServiceProvider());
        }
示例#12
0
 public ArticlesViewModel(NavigationServiceEx navigationService, IShopApiService shopApiService, ProgressService progressService)
 {
     _navigationService = navigationService;
     _shopApiService    = shopApiService;
     _progressService   = progressService;
 }
示例#13
0
 public NavigableViewModelBase()
 {
     this.NavigationService = SimpleIoc.Default.GetInstance <NavigationServiceEx>();
 }
示例#14
0
 public AuthViewModel(NetworkService networkService, NavigationServiceEx navigationService)
 {
     this.networkService             = networkService;
     this.networkService.onSignedIn += SignedIn;
     this.navigationService          = navigationService;
 }
示例#15
0
 public ShellViewModel(NavigationServiceEx navigationService)
 {
     this.navigationService = navigationService;
 }