コード例 #1
0
        public FirstViewModel(IMvxViewModelLoader viewModelLoader)
        {
            _viewModelLoader = viewModelLoader;

            _okCommand = new MvxCommand
                (() => ShowViewModel<CountryInfoViewModel>(new CountryInfoParameters { Hello = Hello }));
        }
コード例 #2
0
 public void Include(MvxNavigationService service, IMvxViewModelLoader loader, IMvxViewDispatcher viewDispatcher)
 {
     _ = new MvxNavigationService(null, viewDispatcher, MvvmCross.Mvx.IoCProvider);
     _ = new MvxAppStart <MvxNullViewModel>(null, null);
 }
コード例 #3
0
        public RootViewModel(IMvxNavigationService navigationService, IMvxLogProvider logProvider, IMvxViewModelLoader mvxViewModelLoader)
        {
            _navigationService  = navigationService;
            _mvxViewModelLoader = mvxViewModelLoader;

            logProvider.GetLogFor <RootViewModel>().Warn(() => "Testing log");

            ShowChildCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <ChildViewModel, SampleModel>(new SampleModel {
                Message = "Hey", Value = 1.23m
            }));

            ShowModalCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <ModalViewModel>());

            ShowModalNavCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <ModalNavViewModel>());

            ShowTabsCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <TabsRootViewModel>());

            ShowSplitCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <SplitRootViewModel>());

            ShowOverrideAttributeCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <OverrideAttributeViewModel>());

            ShowSheetCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <SheetViewModel>());

            ShowWindowCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <WindowViewModel>());

            ShowMixedNavigationCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <MixedNavFirstViewModel>());

            ShowDictionaryBindingCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <DictionaryBindingViewModel>());

            _counter = 3;
        }
コード例 #4
0
 public void Include(MvxNavigationService service, IMvxViewModelLoader loader, IMvxViewDispatcher viewDispatcher)
 {
     service = new MvxNavigationService(null, viewDispatcher, Mvx.IoCProvider);
 }
コード例 #5
0
 public DialogNavigationService(IPopupNavigation popupNavigationService, IMvxViewModelLoader viewModelLoader)
 {
     _popupNavigationService = popupNavigationService;
     _viewModelLoader        = viewModelLoader;
 }
コード例 #6
0
 public void Include(MvxNavigationService service, IMvxViewModelLoader loader)
 {
     service = new MvxNavigationService(null, loader);
 }
コード例 #7
0
 public BaseActivityViewModel(IMvxViewModelLoader viewModelLoader)
 {
     _viewModelLoader = viewModelLoader;
 }
コード例 #8
0
 public void Include(MvxNavigationService service, MvvmCross.Views.IMvxViewDispatcher dispatcher, IMvxViewModelLoader loader)
 {
     service = new MvxNavigationService(null, dispatcher);
 }
コード例 #9
0
ファイル: Presenter.cs プロジェクト: war-beast/GiHub_MVVM
 public Presenter(IMvxViewModelLoader viewModelLoader, IFragmentTypeLookup fragmentTypeLookup, IEnumerable <Assembly> assembly) : base(assembly)
 {
     _fragmentTypeLookup = fragmentTypeLookup;
     _viewModelLoader    = viewModelLoader;
 }
コード例 #10
0
        public void Include(MvxNavigationService service, IMvxViewModelLoader loader)
        {
            var s = new MvxNavigationServiceAppStart <MainViewModel>(null);

            service = new MvxNavigationService(null, loader);
        }
コード例 #11
0
 // ReSharper disable once RedundantAssignment
 public void Include(MvxNavigationService service, IMvxViewModelLoader loader)
 {
     // ReSharper disable once RedundantAssignment
     service = new MvxNavigationService(null, loader);
 }
コード例 #12
0
        private void Navigate(MvxViewModelRequest request, IMvxViewModelLoader loaderService)
        {
            if (request.ViewModelType == typeof(SetRouteStopViewModel))
            {
                var dialog = new SetRouteStopView();
                dialog.ViewModel = loaderService.LoadViewModel(request, null);
                dialog.Show(this.FragmentManager, null);
            }

            if (request.ViewModelType == typeof(SetRouteViewModel))
            {
                var dialog = new SetRouteView();
                dialog.ViewModel = loaderService.LoadViewModel(request, null);
                dialog.Show(this.FragmentManager, null);
            }

            if (request.ViewModelType == typeof(RouteVehiclesViewModel))
            {
                MvxFragment routeView = new RouteView();
                routeView.ViewModel          = loaderService.LoadViewModel(request, null);
                _frag2tag[typeof(RouteView)] = "route_view";

                this.FragmentManager.BeginTransaction()
                .Replace(Resource.Id.content_frame, routeView, "route_view")
                .AddToBackStack(null)
                .Commit();

                this.DisableDrawer();
            }

            if (request.ViewModelType == typeof(VehicleForecastViewModel))
            {
                if (request.RequestedBy != null)
                {
                    if (request.RequestedBy.AdditionalInfo == "map_tap")
                    {
                        var vehicleForecastView = new RouteVehicleForecastView();
                        vehicleForecastView.ViewModel = loaderService.LoadViewModel(request, null);

                        this.ShowMap();

                        this.ShowInSlidingPanel(vehicleForecastView);

                        this.EnableDrawer();
                    }
                }
            }

            if (request.ViewModelType == typeof(RouteStopViewModel))
            {
                if (request.RequestedBy != null)
                {
                    if (request.RequestedBy.AdditionalInfo == "map_tap")
                    {
                        var routeStopView1 = new MapRouteStopView();
                        routeStopView1.ViewModel = loaderService.LoadViewModel(request, null);

                        this.ShowMap();

                        this.ShowInSlidingPanel(routeStopView1);

                        this.EnableDrawer();
                    }
                }
                else
                {
                    MvxFragment routeStopView = new RouteStopView();
                    routeStopView.ViewModel          = loaderService.LoadViewModel(request, null);
                    _frag2tag[typeof(RouteStopView)] = "route_stop_view";

                    this.FragmentManager.BeginTransaction()
                    .Replace(Resource.Id.content_frame, routeStopView, "route_stop_view")
                    .AddToBackStack(null)
                    .Commit();

                    this.DisableDrawer();
                }
            }

            if (request.ViewModelType == typeof(LicensesViewModel))
            {
                var licensesView = new LicensesView();
                licensesView.ViewModel          = loaderService.LoadViewModel(request, null);
                _frag2tag[typeof(LicensesView)] = "licenses_view";

                this.FragmentManager.BeginTransaction()
                .Replace(Resource.Id.content_frame, licensesView, "licenses_view")
                .AddToBackStack(null)
                .Commit();

                this.DisableDrawer();
            }

            if (request.ViewModelType == typeof(ImageLicensesViewModel))
            {
                var imageLicensesView = new ImageLicensesView();
                imageLicensesView.ViewModel          = loaderService.LoadViewModel(request, null);
                _frag2tag[typeof(ImageLicensesView)] = "image_licenses_view";

                this.FragmentManager.BeginTransaction()
                .Replace(Resource.Id.content_frame, imageLicensesView, "image_licenses_view")
                .AddToBackStack(null)
                .Commit();

                this.DisableDrawer();
            }
        }
コード例 #13
0
ファイル: Presenter.cs プロジェクト: akbuffalo1/colorado
 public Presenter(IMvxViewModelLoader viewModelLoader, IFragmentTypeLookup fragmentTypeLookup)
 {
     _fragmentTypeLookup = fragmentTypeLookup;
     _viewModelLoader    = viewModelLoader;
 }
コード例 #14
0
 public MvxFormsPagePresenter(MvxFormsApplication formsApplication, IMvxViewsContainer viewsContainer = null, IMvxViewModelTypeFinder viewModelTypeFinder = null, IMvxViewModelLoader viewModelLoader = null)
 {
     FormsApplication    = formsApplication;
     ViewsContainer      = viewsContainer;
     ViewModelTypeFinder = viewModelTypeFinder;
     ViewModelLoader     = viewModelLoader;
 }
コード例 #15
0
 public TimelineViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService, IMvxViewModelLoader mvxViewModelLoader, IAccountService accountService)
     : base(logProvider, navigationService)
 {
     this.accountService = accountService;
 }
コード例 #16
0
 public DroidPresenter(IMvxViewModelLoader viewModelLoader)
 {
     _viewModelLoader = viewModelLoader;
 }
コード例 #17
0
        public RootViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService, IMvxViewModelLoader mvxViewModelLoader) : base(logProvider, navigationService)
        {
            _mvxViewModelLoader = mvxViewModelLoader;
            _log = logProvider.GetLogFor <RootViewModel>();
            try
            {
                IMvxMessenger messenger = Mvx.IoCProvider.Resolve <IMvxMessenger>();
                string?       str       = messenger.ToString();
                _log.InfoFormat("Creating the Root View Model via the MVX IOC provider {messenger}", messenger);
            }
            catch (Exception e)
            {
                _log.ErrorException("could not resolve the Messenger", e);
            }

            //ShowChildCommand = new MvxAsyncCommand(async () =>
            //{
            //    var result = await NavigationService.Navigate<ChildViewModel, SampleModel, SampleModel>(new SampleModel
            //    {
            //        Message = "Hey",
            //        Value = 1.23m
            //    });
            //    var testIfReturn = result;
            //});

            //ShowModalCommand = new MvxAsyncCommand(Navigate);

            //ShowModalNavCommand =
            //    new MvxAsyncCommand(async () => await NavigationService.Navigate<ModalNavViewModel>());

            //ShowTabsCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<TabsRootViewModel>());

            //ShowPagesCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<PagesRootViewModel>());

            //ShowSplitCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<SplitRootViewModel>());

            //ShowNativeCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<NativeViewModel>());

            //ShowOverrideAttributeCommand = new MvxAsyncCommand(async () =>
            //    await NavigationService.Navigate<OverrideAttributeViewModel>());

            //ShowSheetCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<SheetViewModel>());

            ShowWindowCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <WindowViewModel>());

            //ShowMixedNavigationCommand =
            //    new MvxAsyncCommand(async () => await NavigationService.Navigate<MixedNavFirstViewModel>());

            //ShowDictionaryBindingCommand = new MvxAsyncCommand(async () =>
            //    await NavigationService.Navigate<DictionaryBindingViewModel>());

            //ShowCollectionViewCommand =
            //    new MvxAsyncCommand(async () => await NavigationService.Navigate<CollectionViewModel>());

            //ShowSharedElementsCommand = new MvxAsyncCommand(async () =>
            //    await NavigationService.Navigate<SharedElementRootChildViewModel>());

            //ShowCustomBindingCommand =
            //    new MvxAsyncCommand(async () => await NavigationService.Navigate<CustomBindingViewModel>());

            //ShowFluentBindingCommand =
            //    new MvxAsyncCommand(async () => await NavigationService.Navigate<FluentBindingViewModel>());

            //RegisterAndResolveWithReflectionCommand = new MvxAsyncCommand(RegisterAndResolveWithReflection);
            //RegisterAndResolveWithNoReflectionCommand = new MvxAsyncCommand(RegisterAndResolveWithNoReflection);

            _counter = 3;

            TriggerVisibilityCommand           =
                new MvxCommand(() => IsVisible = !IsVisible);

            //FragmentCloseCommand = new MvxAsyncCommand(() => NavigationService.Navigate<FragmentCloseViewModel>());

            //ShowLocationCommand = new MvxAsyncCommand(() => NavigationService.Navigate<LocationViewModel>());
        }
コード例 #18
0
 public LoginViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService, IMvxViewModelLoader mvxViewModelLoader, ILoginService loginService, IAccountService accountService)
     : base(logProvider, navigationService)
 {
     this.loginService = loginService;
 }
コード例 #19
0
ファイル: DroidPresenter.cs プロジェクト: susch19/Fildo
 public DroidPresenter(IMvxViewModelLoader viewModelLoader, IFragmentTypeLookup fragmentTypeLookup)
 {
     this.fragmentTypeLookup = fragmentTypeLookup;
     this.viewModelLoader    = viewModelLoader;
 }
コード例 #20
0
        public RootViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService, IMvxViewModelLoader mvxViewModelLoader) : base(logProvider, navigationService)
        {
            _mvxViewModelLoader = mvxViewModelLoader;
            try
            {
                //var messenger = Mvx.IoCProvider.Resolve<IMvxMessenger>();
                //var str = messenger.ToString();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }

            ShowChildCommand = new MvxAsyncCommand(async() =>
            {
                var result = await NavigationService.Navigate <ChildViewModel, SampleModel, SampleModel>(new SampleModel
                {
                    Message = "Hey",
                    Value   = 1.23m
                });
                var testIfReturn = result;
            });

            ShowModalCommand = new MvxAsyncCommand(Navigate);

            //ShowModalNavCommand =
            //new MvxAsyncCommand(async () => await NavigationService.Navigate<ModalNavViewModel>());

            ShowTabsCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <TabsRootViewModel>());

            ShowSplitCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <SplitRootViewModel>());

            //ShowNativeCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<NativeViewModel>());

            //ShowOverrideAttributeCommand = new MvxAsyncCommand(async () =>
            //    await NavigationService.Navigate<OverrideAttributeViewModel>());

            //ShowSheetCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<SheetViewModel>());

            //ShowWindowCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<WindowViewModel>());

            //ShowMixedNavigationCommand =
            //new MvxAsyncCommand(async () => await NavigationService.Navigate<MixedNavFirstViewModel>());

            //ShowDictionaryBindingCommand = new MvxAsyncCommand(async () =>
            //    await NavigationService.Navigate<DictionaryBindingViewModel>());

            //ShowCollectionViewCommand =
            //    new MvxAsyncCommand(async () => await NavigationService.Navigate<CollectionViewModel>());

            //ShowSharedElementsCommand = new MvxAsyncCommand(async () =>
            //    await NavigationService.Navigate<SharedElementRootChildViewModel>());

            //ShowCustomBindingCommand =
            //    new MvxAsyncCommand(async () => await NavigationService.Navigate<CustomBindingViewModel>());

            //ShowFluentBindingCommand =
            //new MvxAsyncCommand(async () => await NavigationService.Navigate<FluentBindingViewModel>());

            _counter = 3;

            TriggerVisibilityCommand           =
                new MvxCommand(() => IsVisible = !IsVisible);
        }
コード例 #21
0
ファイル: StartupViewModel.cs プロジェクト: alexschott/mwf
 public StartupViewModel(IMvxViewModelLoader viewModelLoader, IRepositories repositories)
     : base(viewModelLoader)
 {
     _repositories = repositories;
 }
コード例 #22
0
 public void Include(MvxNavigationService service, IMvxViewModelLoader loader)
 {
     _ = new MvxNavigationService(null, loader);
     _ = new MvxAppStart <MvxNullViewModel>(null, null);
 }
コード例 #23
0
 public RestlyNavigationService(
     IMvxNavigationCache navigationCache,
     IMvxViewModelLoader viewModelLoader)
     : base(navigationCache, viewModelLoader)
 {
 }