示例#1
0
        public MasterPageViewModel(IPageFactory _page, IAppNavigation _navi)
        {
            PageFac = _page;
            Navi    = _navi;

            MasterPageItems = new List <MenuItem>();

            MasterPageItems.Add(new MenuItem
            {
                Title      = "Home",
                IconSource = "Search.png",
                TargetType = typeof(MainMapPage),
                Id         = "home"
            });

            MasterPageItems.Add(new MenuItem
            {
                Title      = "Profile",
                IconSource = "Search.png",
                TargetType = typeof(RumbleApp.Core.UI.Pages.Profile.MyProfile),
                Id         = "profile"
            });

            MasterPageItems.Add(new MenuItem
            {
                Title      = "Events",
                IconSource = "Search.png",
                TargetType = typeof(RumbleApp.Core.UI.Pages.Events.Events),
                Id         = "events"
            });
        }
示例#2
0
 public ProfileViewModel(IPageFactory _page, IAppNavigation _navi, IProfileService _prof, IEventService _evnt)
 {
     Navi = _navi;
     Page = _page;
     Prof = _prof;
     Evnt = _evnt;
 }
示例#3
0
 public EventsViewModel(IPageFactory _page, IAppNavigation _navi, IEventService _evnt)
 {
     Navi = _navi;
     Page = _page;
     Evnt = _evnt;
     RegisterMessageCenter();
 }
示例#4
0
        public ProductsListViewModel(IAppNavigation navi)
        {
            _navi = navi;
            Title = "Products Page";

            MessagingCenter.Subscribe <Product>(this, Messages.NavigateTo, NavigateToProduct);
        }
        public ProductsListViewModel(IAppNavigation navi)
        {
            _navi = navi;
            Title = "Products Page";

            MessagingCenter.Subscribe<Product>(this, Messages.NavigateTo, NavigateToProduct);
        }
示例#6
0
        public AddEventViewModel(IPageFactory _page, IAppNavigation _navi, IEventService _envt)
        {
            PageFac = _page;
            Navi    = _navi;
            Evnt    = _envt;

            RegisterMessaging();
        }
示例#7
0
 public LoginViewModel(IPageFactory _page, IAppNavigation _navi, IRestService _rest, IAccountService _acc, IProfileService _prof)
 {
     PageFac = _page;
     Navi    = _navi;
     Rest    = _rest;
     Acc     = _acc;
     Prof    = _prof;
 }
        public RegisterPage()
        {
            NavigationPage.SetHasBackButton(this, false);

            InitializeComponent();
            _storage = App.Resolve <IStorage>().SecureStorage;
            _navi    = App.Resolve <IAppNavigation>();
        }
示例#9
0
 public MainMapPageViewModel(IPageFactory _page, IAppNavigation _navi, IEventService _evnt, IProfileService _prof)
 {
     Navi = _navi;
     Page = _page;
     Evnt = _evnt;
     Prof = _prof;
     RegisterMessageCenter();
 }
示例#10
0
 public RegisterViewModel(IPageFactory _page, IAppNavigation _navi, IRestService _rest, IAccountService _acc, IUserService _user)
 {
     PageFac = _page;
     Navi    = _navi;
     Rest    = _rest;
     Acc     = _acc;
     Usr     = _user;
 }
示例#11
0
        public RecipesViewModel(IAppNavigation _navi, IPageFactory _page)
        {
            Title   = "Recipes";
            Navi    = _navi;
            PageFac = _page;

            IsFilterVisible  = false;
            IsResultsVisible = true;
        }
示例#12
0
 public ReadItemViewModel(SelfwinApp app, IAppNavigation navigation, ItemViewModel item)
 {
     this.App = app;
     this.Navigation = navigation;
     if (item != null)
     {
         Parameter = item;
     }
 }
示例#13
0
 public Page2ViewModel(IAppNavigation appNavigation)
 {
     _appNavigation = appNavigation;
     PopCommand     = new Command(async() =>
     {
         // Add the key to the input string.
         await _appNavigation.PopToRootPageAsync();
     });
 }
示例#14
0
        public SettingsPageRootViewModel(IAppNavigation appNavigation)
        {
            _appNavigation = appNavigation;

            GoPage3Command = new Command(async() =>
            {
                // Add the key to the input string.
                await _appNavigation.GotoPage3();
            });
        }
示例#15
0
        public ListPageRootViewModel(IAppNavigation appNavigation)
        {
            _appNavigation = appNavigation;

            TestCommand = new Command(async() =>
            {
                // Add the key to the input string.
                await _appNavigation.GotoPage2();
            });
        }
示例#16
0
        public GuideViewModel(IAppNavigation navi, IPageFactory page)
        {
            App.PageOpenedDateTime = DateTime.UtcNow;
            _navi = navi;
            _page = page;

            SetPageVisibility();

            Skipped     = false;
            Adults      = 0;
            Children    = 0;
            OtherOutfit = string.Empty;
        }
示例#17
0
        public MainPageViewModel(IAppNavigation appNavigation)
        {
            _appNavigation = appNavigation;


            this.AddCharCommand = new Command <string>((key) =>
            {
                // Add the key to the input string.
                WelcomeText = "Changed";
            });

            GoPage2Command = new Command(async() =>
            {
                //_appNavigation.RootPage = App.RootPage;
                await _appNavigation.GotoPage2();
            });
        }
示例#18
0
        public CategoriesListViewModel(IProductService service, IAppNavigation navi, IScanner scanner, LogOutCommand logOut)
        {
            _service = service;
            _navi    = navi;
            _scanner = scanner;
            _logOut  = logOut;

            MessagingCenter.Subscribe <Category>(this, Messages.NavigateTo, NavigateToCategory);

            _searchCommand = new RelayCommand(Search, () => !string.IsNullOrWhiteSpace(SearchTerm));
            ScanCommand    = new RelayCommand(async() =>
            {
                var result = await _scanner.Scan();

                SearchTerm = result.Text;
                Search();
            });

            Categories = new NotifyTaskCompletion <List <CategoryViewModel> >(GetCategories());
        }
        public CategoriesListViewModel(IProductService service, IAppNavigation navi, IScanner scanner, LogOutCommand logOut)
        {
            _service = service;
            _navi = navi;
            _scanner = scanner;
            _logOut = logOut;

            MessagingCenter.Subscribe<Category>(this, Messages.NavigateTo, NavigateToCategory);

            _searchCommand = new Command(Search, () => !string.IsNullOrWhiteSpace(SearchTerm));
            ScanCommand = new Command(async () =>
            {
                var result = await _scanner.Scan();

                SearchTerm = result.Text;
                Search();
            });

            AboutCommand = new Command(async () => await _navi.ShowAbout());

            Categories = new NotifyTaskCompletion<List<CategoryViewModel>>(GetCategories());
        }
示例#20
0
        public MainPageViewModel(IAppNavigation appNav)
        {
            _appNav = appNav;

            LoadListCommand    = ReactiveCommand.CreateFromTask <List <StationInfoModel> >(execute: () => LoadListAsync(), outputScheduler: RxApp.MainThreadScheduler);
            LoadSensorsCommand = ReactiveCommand.CreateFromTask <StationInfoModel, List <SensorInfoModel> >(station => LoadStationSensorsAsync(station), outputScheduler: RxApp.MainThreadScheduler);
            LoadDataCommand    = ReactiveCommand.CreateFromTask <SensorInfoModel, SensorDataEntry>(sensor => LoadSensorDataAsync(sensor), outputScheduler: RxApp.MainThreadScheduler);

            _stationsInfoList = LoadListCommand.ToProperty(this, x => x.StationsList, new List <StationInfoModel>());
            _sensorInfoModels = LoadSensorsCommand.ToProperty(this, x => x.SensorsList, new List <SensorInfoModel>());
            _sensorData       = LoadDataCommand.ToProperty(this, x => x.SensorData, new SensorDataEntry());

            this.ObservableForProperty(x => x.IsBeingNavigated)
            .Select(e => new Unit())
            .InvokeCommand(LoadListCommand);

            this.ObservableForProperty(x => x.SelectedStation)
            .Select(e => e.Value)
            .InvokeCommand(LoadSensorsCommand);

            this.ObservableForProperty(x => x.SensorsList)
            .Select(e => e.Value)
            .Subscribe(x => SelectedSensor = x?.FirstOrDefault());

            this.ObservableForProperty(x => x.SelectedSensor)
            .Select(e => e.Value)
            .InvokeCommand(LoadDataCommand);


            _filteredStationsInfoList = this.WhenAnyValue(
                x => x.Filter,
                x => x.StationsList,
                (f, l) => l.CreateDerivedCollection(x => x,
                                                    x => x.StationName.Contains(string.IsNullOrEmpty(f) ? "" : f)
                                                    ).ToList()
                )
                                        .ToProperty(this, x => x.FilteredStationsList, new List <StationInfoModel>());
        }
示例#21
0
 public LogOutCommand(ILoginService login, IAppNavigation navi)
 {
     _login      = login;
     _navi       = navi;
     _canExecute = true;
 }
示例#22
0
 public LogOutCommand(ILoginService login, IAppNavigation navi)
 {
     _login = login;
     _navi = navi;
     _canExecute = true;
 }
示例#23
0
 public MainViewModel(IAppNavigation navigation, IWeatherService weatherService)
 {
     _navigation     = navigation;
     _weatherService = weatherService;
 }
示例#24
0
 public ProfilePage()
 {
     InitializeComponent();
     _storage = App.Resolve <IStorage>().SecureStorage;
     _navi    = App.Resolve <IAppNavigation>();
 }
示例#25
0
 public DiscoveryViewModel(IProductService productService, IAppNavigation navi)
 {
     _productService = productService;
     _navi           = navi;
     getProductList();
 }
示例#26
0
 public DemoViewModel(IAppNavigation navigation)
 {
     _navigation = navigation;
 }
示例#27
0
 public MainViewModel(IAppNavigation navigation, IWeatherService weatherService)
 {
     _navigation = navigation;
     _weatherService = weatherService;
 }
示例#28
0
 public LoginViewModel(ILoginService loginService, IAppNavigation navigationService)
 {
     _loginService = loginService;
     _navigationService = navigationService;
 }
示例#29
0
 public AddRecipeViewModel(IAppNavigation _navi)
 {
     Navi = _navi;
 }
示例#30
0
 public LoginViewModel(IAuthenticationService authService, IAppNavigation navigationService)
 {
     _authService       = authService;
     _navigationService = navigationService;
 }
示例#31
0
文件: App.cs 项目: wawoohdavid7/App1
 public App(IAppNavigation appNavigation)
 {
     _appNavigation = appNavigation;
 }
示例#32
0
 public LoginViewModel(ILoginService loginService, IAppNavigation navigationService)
 {
     _loginService      = loginService;
     _navigationService = navigationService;
 }
示例#33
0
 public WelcomeViewModel(IAppNavigation navi)
 {
     _navi = navi;
     _slim = new SemaphoreSlim(0, 1);
     IsBusy = new NotifyTaskCompletion<int>(GoToFirstPage());
 }
示例#34
0
 public ItemDetailViewModel(IAppNavigation _navi, IPageFactory _page)
 {
     Navi    = _navi;
     PageFac = _page;
 }
 public WelcomeViewModel(IAppNavigation navi)
 {
     _navi  = navi;
     _slim  = new SemaphoreSlim(0, 1);
     IsBusy = new NotifyTaskCompletion <int>(GoToFirstPage());
 }
示例#36
0
 public MainPageViewModel(IPageFactory _page, IAppNavigation _navi)
 {
     PageFac = _page;
     Navi    = _navi;
 }
示例#37
0
 public AllItemsViewModel(IAppNavigation navigation, SelfwinApp app)
 {
     this.App = app;
     this.Navigation = navigation;
 }
示例#38
0
 public DemoViewModel(IAppNavigation navigation)
 {
     _navigation = navigation;
 }
示例#39
0
 public EditRecipeViewModel(IAppNavigation _navi, IPageFactory _page)
 {
     Navi    = _navi;
     PageFac = _page;
 }