public BaseViewModel(ICurrentlySelectedFactory currentlySelectedFactory)
 {
     this.currentlySelectedFactory = currentlySelectedFactory;
     LoadedCommand = new Command(async() => {
         await Init();
     });
 }
 public LogoutPageViewModel(ICurrentlySelectedFactory currentlySelectedFactory, IPlatformLogout platformLogout, INavigationService navigationService) : base(currentlySelectedFactory)
 {
     this.navigationService = navigationService;
     this.platformLogout    = platformLogout;
     LogoutCommand          = new Command(Logout);
     CancelCommand          = new Command(Cancel);
 }
 public HomePageViewModel(ICurrentlySelectedFactory currentlySelectedFactory, INavigationService navigationService, IWidgetService widgetService) : base(currentlySelectedFactory)
 {
     Title = "My Home!!!";
     this.navigationService = navigationService;
     this.widgetService     = widgetService;
     AddWidgetCommand       = new Command(() => AddWidget());
     ShowWidgetsCommand     = new Command(() => ShowWidgets());
     Widgets = new ObservableCollection <Widget>();
 }
 public HomePageViewModel(ICurrentlySelectedFactory currentlySelectedFactory, IToastService toastService, INavigationService navigationService) : base(currentlySelectedFactory)
 {
     Title                  = "My Home!!!";
     this.toastService      = toastService;
     this.navigationService = navigationService;
     ShowToastCommand       = new Command(() => this.toastService.CookIt("Something Important", Models.MyToastLength.Long));
     SubPageCommand         = new Command(async() => await NavigateToChild());
     MDNavCommand           = new Command(() => MDDetailPageNavigate());
 }
 public ErrorPageViewModel(ICurrentlySelectedFactory currentlySelectedFactory, IPlatformStuff platformStuff) : base(currentlySelectedFactory)
 {
     Title              = "Error";
     IsBusy             = false;
     HTMLSource         = HTMLSource ?? new HtmlWebViewSource();
     HTMLSource.BaseUrl = platformStuff.GetBaseUrl();
     //HTMLSource.BaseUrl = DependencyService.Get<IPlatformStuff>().GetBaseUrl();
     HTMLSource.Html = currentlySelectedFactory.SelectedUser.Error.issue;
     currentlySelectedFactory.SelectedUser.Error = null;
 }
Beispiel #6
0
 public HelpPageViewModel(ICurrentlySelectedFactory currentlySelectedFactory, ISendEmailService sendEmailService, IPlatformStuff platformStuff) : base(currentlySelectedFactory)
 {
     Title   = "Help";
     IsBusy  = false;
     Version = platformStuff.GetVersion();
     AppName = platformStuff.GetAppName();
     this.sendEmailService = sendEmailService;
     EmailCommand          = new Command(Email);
     AppDetailsCommand     = new Command(LaunchWebsite);
     SelectedUser          = currentlySelectedFactory.SelectedUser;
 }
        protected override void OnAttachedTo(BindableObject bindable)
        {
            ICurrentlySelectedFactory currentlySelectedFactory = ViewModelLocator.Container.Resolve <ICurrentlySelectedFactory>();
            Page pg = (Page)ViewModelLocator.Container.Resolve <IHomePage>();  // default home page if nothing was specified

            if (currentlySelectedFactory.DesiredMasterDetailDetailPage != null)
            {
                pg = (Page)ViewModelLocator.Container.Resolve(currentlySelectedFactory.DesiredMasterDetailDetailPage);
                currentlySelectedFactory.DesiredMasterDetailDetailPage = null;
            }
            ((MasterDetailPage)bindable).Detail = new NavigationPage(pg);
            base.OnAttachedTo(((MasterDetailPage)bindable));
        }
Beispiel #8
0
 public MasterDetailPageMasterViewModel(ICurrentlySelectedFactory currentlySelectedFactory) : base(currentlySelectedFactory)
 {
     Title     = "Master";
     MenuItems = new ObservableCollection <MasterDetailPageMenuItem>(new[]
     {
         new MasterDetailPageMenuItem {
             Id = 0, Title = "Home", TargetType = typeof(Home)
         },
         new MasterDetailPageMenuItem {
             Id = 1, Title = "Logout", TargetType = typeof(LogoutPage)
         },
         new MasterDetailPageMenuItem {
             Id = 1, Title = "Settings", TargetType = typeof(SettingsPage)
         },
         new MasterDetailPageMenuItem {
             Id = 1, Title = "Help", TargetType = typeof(HelpPage)
         }
     });
 }
 public BaseRepository(ICurrentlySelectedFactory currentlySelectedFactory)
 {
     this.currentlySelectedFactory = currentlySelectedFactory;
 }
 public SettingsPageViewModel(ICurrentlySelectedFactory currentlySelectedFactory) : base(currentlySelectedFactory)
 {
     Title = "Settings";
 }
 public NavigationService(ICurrentlySelectedFactory currentlySelectedFactory)
 {
     this.currentlySelectedFactory = currentlySelectedFactory;
 }
Beispiel #12
0
 public LoginService(IAPIFactory aPIFactory, ICurrentlySelectedFactory currentlySelectedFactory)
 {
     this.aPIFactory = aPIFactory;
     this.currentlySelectedFactory = currentlySelectedFactory;
 }
 public GetItemRepository(ICurrentlySelectedFactory currentlySelectedFactory) : base(currentlySelectedFactory)
 {
 }
Beispiel #14
0
 public LoginPageViewModel(ICurrentlySelectedFactory currentlySelectedFactory, ILoginService loginService, INavigationService navigationService) : base(currentlySelectedFactory)
 {
     this.loginService      = loginService;
     this.navigationService = navigationService;
 }
Beispiel #15
0
 public MyMockHelper()
 {
     currentlySelectedFactory = new CurrentlySelectedFactory();
 }