public AddIncidentDetailViewModel(INetworkService networkService, IUserDialogs userDialogs, IAzureService azureService, IMvxMessenger messenger)
            : base(networkService, userDialogs)
        {
            _azureService = azureService;
            _messenger = messenger;

        }
 public CreateStoreViewModel(IAddressLocationService addressLocationService,
     IUserDialogs dialogsService,
     IStoresService storesService)
 {
     _addressLocationService = addressLocationService;
     _dialogsService = dialogsService;
     _storesService = storesService;
 }
 public WorkerQueueItemViewModel(INetworkService networkService, IUserDialogs userDialogs, Incident incident, string fullName) : base(networkService, userDialogs)
 {
     DateOpened = incident.DateOpened;
     Id = incident.Id;
     ImageLink = incident.ImageLink;
     Subject = incident.Subject;
     UserId = incident.AssignedToId;
     FullName = fullName;
 }
        public DisplayIncidentDetailViewModel(INetworkService networkService, IUserDialogs userDialogs, IncidentDetail model, string fullName, DisplayIncidentViewModel parent)
            : base(networkService, userDialogs)
        {
            DetailText = model.DetailText;
            ImageLink = model.ImageLink;
            AudioRecordingLink = model.AudioLink;
            DateOpened = model.DateEntered;
            FullName = fullName;

            _parent = new WeakReference(parent);
        }
Пример #5
0
        public AddGeofenceViewModel(IGeofenceManager geofences,
                                    IUserDialogs dialogs,
                                    IViewModelManager viewModelMgr,
                                    IGeolocator geolocator)
        {
            this.Add = ReactiveCommand.CreateAsyncTask(
                this.WhenAny(
                    x => x.RadiusMeters,
                    x => x.Latitude,
                    x => x.Longitude,
                    x => x.Identifer,
                    (radius, lat, lng, id) =>
                    {
                        if (radius.Value < 100)
                            return false;

                        if (lat.Value < -90 || lat.Value > 90)
                            return false;

                        if (lng.Value < -180 || lng.Value > 180)
                            return false;

                        if (id.Value.IsEmpty())
                            return false;

                        return true;
                    }
                ),
                async x =>
                {
                    geofences.StartMonitoring(new GeofenceRegion
                    {
                        Identifier = this.Identifer,
                        Center = new Position(this.Latitude, this.Longitude),
                        Radius = Distance.FromMeters(this.RadiusMeters)
                    });
                    await viewModelMgr.PopNav();
                }
            );
            this.UseCurrentLocation = ReactiveCommand.CreateAsyncTask(async x =>
            {
                try
                {
                    var current = await geolocator.GetPositionAsync(5000);
                    this.Latitude = current.Latitude;
                    this.Longitude = current.Longitude;
                }
                catch
                {
                }
            });
        }
        public void Init()
        {
            ClearAll(); //Sets Up the IOC Framework

            _mockDispatcher = new MockDispatcher();
            Ioc.RegisterSingleton<IMvxViewDispatcher>(_mockDispatcher);
            Ioc.RegisterSingleton<IMvxMainThreadDispatcher>(_mockDispatcher);

            _authService = Mock.Of<IAuthenticationService>();
            _dialogsService = Mock.Of<IUserDialogs>();

            _viewModel = new LoginViewModel(_authService, _dialogsService);
        }
Пример #7
0
        public ToastsViewModel(IUserDialogs dialogs)
            : base(dialogs)
        {
            this.SecondsDuration = 3;

            this.ActionText = "Ok";
            this.ActionTextColor = Color.White.ToString();
            this.Message = "This is a test of the emergency toast system";
            this.MessageTextColor = Color.White.ToString ();

            this.Open = new Command(() => dialogs
                .Toast(new ToastConfig(this.Message)
                    //.SetMessageTextColor(System.Drawing.Color.FromHex(this.MessageTextColor))
                    .SetDuration(TimeSpan.FromSeconds(this.SecondsDuration))
                    .SetAction(x => x
                        .SetText(this.ActionText)
                        //.SetTextColor(new System.Drawing.Color.FromHex(this.ActionTextColor))
                        .SetAction(() => dialogs.Alert("You clicked the primary button"))
                    )
                )
            );
        }
Пример #8
0
        public HistoryViewModel(SampleDbConnection conn,
                                IGeofenceManager geofences,
                                IUserDialogs dialogs,
                                IMessaging messaging)
        {
            this.conn = conn;
            this.geofences = geofences;
            this.Reload = new Command(this.Load);

            this.Clear = ReactiveCommand.CreateAsyncTask(async x =>
            {
                var result = await dialogs.ConfirmAsync(new ConfirmConfig()
                   .UseYesNo()
                   .SetMessage("Are you sure you want to delete all of your history?"));

                if (result)
                {
                    this.conn.DeleteAll<GeofenceEvent>();
                    this.Load();
                }
            });

            this.SendDatabase = new Command(() =>
            {
                var backupLocation = conn.CreateDatabaseBackup(conn.Platform);

                var mail = new EmailMessageBuilder()
                    .Subject("Geofence Database")
                    //.WithAttachment(conn.DatabasePath, "application/octet-stream")
                    .WithAttachment(backupLocation, "application/octet-stream")
                    .Body("--")
                    .Build();

                messaging.EmailMessenger.SendEmail(mail);
            });
        }
 public CharacteristicDetailViewModel(IAdapter adapter, IUserDialogs userDialogs) : base(adapter)
 {
     _userDialogs = userDialogs;
 }
Пример #10
0
        public RoutePointActiveListViewModel(IRoutesService routesService, ICarrierOrdersService ordersService, IMvxNavigationService navigationService, IUserDialogs dialogsService, IMvxPhoneCallTask phoneCallService)
        {
            this.routesService     = routesService;
            this.navigationService = navigationService;
            this.ordersService     = ordersService;
            this.phoneCallService  = phoneCallService;
            this.dialogsService    = dialogsService;

            this.passPointDialogConfig            = new ConfirmConfig();
            this.passPointDialogConfig.OkText     = "Tak";
            this.passPointDialogConfig.CancelText = "Nie";
            this.passPointDialogConfig.Title      = "Zakończ punkt";
            this.passPointDialogConfig.Message    = "Czy na pewno chcesz zakończyć ten punkt?";
            this.passPointDialogConfig.OnAction  += x => PassPoint(x);
        }
Пример #11
0
        public CreateViewModel(INavigationService navigator,
                               IGeofenceManager geofenceManager,
                               IGpsManager gpsManager,
                               IUserDialogs dialogs)
        {
            this.navigator       = navigator;
            this.geofenceManager = geofenceManager;
            this.gpsManager      = gpsManager;
            this.dialogs         = dialogs;

            var hasEventType = this.WhenAny(
                x => x.NotifyOnEntry,
                x => x.NotifyOnExit,
                (entry, exit) => entry.GetValue() || exit.GetValue()
                );

            geofenceManager
            .WhenAccessStatusChanged()
            .ToPropertyEx(this, x => x.AccessStatus);

            this.SetCurrentLocation = ReactiveCommand.CreateFromTask(async ct =>
            {
                var loc              = await this.gpsManager.GetLastReading().ToTask(ct);
                this.CenterLatitude  = loc?.Position?.Latitude ?? 0;
                this.CenterLongitude = loc?.Position?.Longitude ?? 0;
            });
            this.BindBusyCommand(this.SetCurrentLocation);

            //this.RequestAccess = ReactiveCommand.CreateFromTask(
            //    async () => await geofenceManager.RequestAccess()
            //);

            this.AddCnTower = ReactiveCommand.CreateFromTask(
                _ => this.AddGeofence(
                    "CNTowerToronto",
                    43.6425662,
                    -79.3892508,
                    DEFAULT_DISTANCE_METERS
                    ),
                hasEventType
                );

            this.AddAppleHQ = ReactiveCommand.CreateFromTask(
                _ => this.AddGeofence(
                    "AppleHQ",
                    37.3320045,
                    -122.0329699,
                    DEFAULT_DISTANCE_METERS
                    ),
                hasEventType
                );

            this.CreateGeofence = ReactiveCommand.CreateFromTask(
                _ => this.AddGeofence
                (
                    this.Identifier,
                    this.CenterLatitude,
                    this.CenterLongitude,
                    this.RadiusMeters
                ),
                this.WhenAny(
                    //x => x.AccessStatus,
                    x => x.Identifier,
                    x => x.RadiusMeters,
                    x => x.CenterLatitude,
                    x => x.CenterLongitude,
                    x => x.NotifyOnEntry,
                    x => x.NotifyOnExit,
                    //(access, id, rad, lat, lng, entry, exit) =>
                    (id, rad, lat, lng, entry, exit) =>
            {
                //if (access.GetValue() != AccessState.Available)
                //    return false;

                if (id.GetValue().IsEmpty())
                {
                    return(false);
                }

                var radius = rad.GetValue();
                if (radius < 200 || radius > 5000)
                {
                    return(false);
                }

                var latv = lat.GetValue();
                if (latv >= 89.9 || latv <= -89.9)
                {
                    return(false);
                }

                var lngv = lng.GetValue();
                if (lngv >= 179.9 || lngv <= -179.9)
                {
                    return(false);
                }

                if (!entry.GetValue() && !exit.GetValue())
                {
                    return(false);
                }

                return(true);
            }
                    )
                );
        }
Пример #12
0
 public LoginViewModel(IAuthenticationService authService, IUserDialogs dialogsService)
 {
     _authService = authService;
     _dialogsService = dialogsService;
 }
Пример #13
0
 public AddToPlaylistViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService, IUserDialogs userDialogs, IMediaManager mediaManager) : base(logProvider, navigationService)
 {
     _userDialogs  = userDialogs ?? throw new ArgumentNullException(nameof(userDialogs));
     _mediaManager = mediaManager ?? throw new ArgumentNullException(nameof(mediaManager));
 }
Пример #14
0
        public SpecificCasesViewModel(IUserDialogs dialogs)
            : base(dialogs)
        {
            this.Commands = new List<CommandViewModel>
            {
                new CommandViewModel
                {
                    Text = "Loading Task to Alert",
                    Command = new Command(() =>
                    {
                        this.Dialogs.ShowLoading("You really shouldn't use ShowLoading");
                        Task.Delay(TimeSpan.FromSeconds(2))
                            .ContinueWith(x => this.Dialogs.Alert("Do you see me?"));
                    })
                },
                new CommandViewModel
                {
                    Text = "Two Date Pickers",
                    Command = new Command(async () =>
                    {
                        var v1 = await this.Dialogs.DatePromptAsync("Date 1 (Past -1 Day)", DateTime.Now.AddDays(-1));
                        if (!v1.Ok)
                            return;

                        var v2 = await this.Dialogs.DatePromptAsync("Date 2 (Future +1 Day)", DateTime.Now.AddDays(1));
                        if (!v2.Ok)
                            return;

                        this.Dialogs.Alert($"Date 1: {v1.SelectedDate} - Date 2: {v2.SelectedDate}");
                    })
                },
                new CommandViewModel
                {
                    Text = "Start Loading Twice",
                    Command = new Command(async () =>
                    {
                        this.Dialogs.ShowLoading("Loading 1");
                        await Task.Delay(1000);
                        this.Dialogs.ShowLoading("Loading 2");
                        await Task.Delay(1000);
                        this.Dialogs.HideLoading();
                    })
                },
                new CommandViewModel
                {
                    Text = "Async & OnAction Fail!",
                    Command = new Command(async () =>
                    {
                        try
                        {
                            await this.Dialogs.AlertAsync(new AlertConfig
                            {
                                OnAction = () => { }
                            });
                        }
                        catch
                        {
                            this.Dialogs.Alert("It failed... GOOOD");
                        }
                    })
                },
                new CommandViewModel
                {
                    Text = "Toast from Background Thread",
                    Command = new Command(() =>
                        Task.Factory.StartNew(() =>
                            this.Dialogs.Toast("Test From Background"),
                            TaskCreationOptions.LongRunning
                        )
                    )
                },
                new CommandViewModel
                {
                    Text = "Alert from Background Thread",
                    Command = new Command(() =>
                        Task.Factory.StartNew(() =>
                            this.Dialogs.Alert("Test From Background"),
                            TaskCreationOptions.LongRunning
                        )
                    )
                },
                new CommandViewModel
                {
                    Text = "Two alerts with one Cancellation Token Source",
                    Command = new Command(async () =>
                    {
                        try
                        {
                            var cts = new CancellationTokenSource();

                            await this.Dialogs.AlertAsync("Press ok and then wait", "Hi", null, cts.Token);
                            cts.CancelAfter(TimeSpan.FromSeconds(3));
                            await this.Dialogs.AlertAsync("I'll close soon, just wait", "Hi", null, cts.Token);
                        }
                        catch(OperationCanceledException)
                        {
                        }
                    })
                },
                new CommandViewModel
                {
                    Text = "Large Toast Text",
                    Command = new Command(() =>
                        this.Dialogs.Toast(
                            "This is a really long message to test text wrapping and other such things that are painful for toast dialogs to render fully in two line labels")
                    )
                },
                new CommandViewModel
                {
                    Text = "Toast (no action)",
                    Command = new Command(() => this.Dialogs.Toast("TEST"))
                }
            };
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DashboardViewModel"/> class.
 /// </summary>
 /// <param name="networkService">The network service.</param>
 /// <param name="userDialogs">The user dialogs.</param>
 /// <param name="mobileService">Service for accessing Azure.</param>
 public DashboardViewModel(INetworkService networkService, IUserDialogs userDialogs, IAzureService mobileService) : base(networkService, userDialogs)
 {
     _azureService = mobileService;
 }
 public DescriptorDetailViewModel(Adapter adapter, IUserDialogs userDialogs) : base(adapter)
 {
     _userDialogs = userDialogs;
 }
Пример #17
0
        public MainPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IFirebasePushNotification firebasePushNotification,
                                 IDeviceService deviceService, IBarcodeScannerService barcodeScannerService, IUserDialogs userDialogs, SyncServerConnection syncServer, TronConnection tronConnection, WalletManager walletManager, TokenMessagesQueueService tokenMessagesQueueService, ConverseDatabase converseDatabase)
            : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServer, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase)
        {
            Title = AppResources.MainPageTitle;
            this.barcodeScannerService = barcodeScannerService;

            OpenWelcomePageCommand = new Command(async() => await _navigationService.NavigateAsync("MainPage"));
        }
Пример #18
0
 public MainViewModel(INavigation navigation, IUserDialogs userDialogs)
 {
     this.navigation  = navigation;
     this.userDialogs = userDialogs;
 }
Пример #19
0
 public AuthHandler(IUserDialogs userDialog)
 {
     this.userDialog = userDialog;
 }
 public ProfileViewModel(IMvxNavigationService navigationService, IUserDialogs userDialogs)
 {
     _navigationService = navigationService;
     _userDialogs       = userDialogs;
     _api = new UserApi <UserModel, UserModel, int>("user");
 }
 public LightsPageModel(IDeviceTwin deviceTwin, IAzureIoTHub azureIoTHub, IUserDialogs dialogs)
 {
     DeviceTwin   = deviceTwin;
     _azureIoTHub = azureIoTHub;
     _dialogs     = dialogs;
 }
 public QuotePageModel (IDatabaseService databaseService, IUserDialogs userDialogs)
 {
     _databaseService = databaseService;
     _userDialogs = userDialogs;
 }
 public AudioRecorderViewModel(INetworkService networkService, IUserDialogs userDialogs) : this(networkService, userDialogs, null)
 {
 }
Пример #24
0
 public PlaylistOverviewViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService, IUserDialogs userDialogs, IMediaManager mediaManager, IPlaylistService playlistService) : base(logProvider, navigationService)
 {
     _userDialogs     = userDialogs ?? throw new ArgumentNullException(nameof(userDialogs));
     _playlistService = playlistService ?? throw new ArgumentNullException(nameof(playlistService));
 }
Пример #25
0
 public DialogsService(IUserDialogs userDialogs)
 {
     UserDialogs = userDialogs;
 }
Пример #26
0
        public MainViewModel(INavigationService navigationService, ServoDriveService servoDriveService, IUserDialogs dialogs, IContainerRegistry containerRegistry)
        {
            this.navigationService           = navigationService;
            this.dialogs                     = dialogs;
            this.containerRegistry           = containerRegistry;
            ServoDriveService                = servoDriveService;
            servoDriveService.IsOpenChanged += (sender, e) =>
            {
                if (servoDriveService.IsOpen)
                {
                    this.dialogs.Toast("Bluetooth is Connected");
                }
                else
                {
                    this.dialogs.Toast("Bluetooth is Disconnected");
                }
            };

            Task.Run(async() => {
                await Task.Delay(300);
            });
        }
Пример #27
0
 public WelcomeViewModel(IUserDialogs userDialogs, IMvxMessenger mvxMessenger, AppHelper appHelper) : base(userDialogs, mvxMessenger, appHelper)
 {
 }
 public GattCharacteristicViewModel(IUserDialogs dialogs, IGattCharacteristic characteristic)
 {
     this.dialogs        = dialogs;
     this.Characteristic = characteristic;
 }
Пример #29
0
     public TodoItemDetailViewModel(INavigationService navigationService, IPageDialogService pageDialogService,
 #if (UseAcrDialogs)
                                    IDeviceService deviceService, IUserDialogs userDialogs)
Пример #30
0
        public MainViewModel(IPeripheralManager peripheral, IUserDialogs dialogs)
        {
            this.dialogs = dialogs;

            this.ToggleServer = ReactiveCommand.CreateFromTask(async _ =>
            {
                if (peripheral.IsAdvertising)
                {
                    this.timer?.Dispose();
                    this.IsRunning = false;
                    peripheral.ClearServices();
                    peripheral.StopAdvertising();
                    this.Write("GATT Server Stopped");
                }
                else
                {
                    await peripheral.AddService
                    (
                        ServiceUuid,
                        true,
                        sb =>
                    {
                        this.notifications = sb.AddCharacteristic
                                             (
                            NotifyCharacteristicUuid,
                            cb => cb.SetNotification(cs =>
                        {
                            var subs = cs.Characteristic.SubscribedCentrals.Count;

                            var @event = cs.IsSubscribing ? "Subscribed" : "Unsubcribed";
                            this.Write($"Device {cs.Peripheral.Uuid} {@event}");
                            this.Write($"Charcteristic Subcribers: {subs}");

                            if (subs == 0)
                            {
                                this.StopTimer();
                            }
                            else
                            {
                                this.StartTimer();
                            }
                        })
                                             );

                        sb.AddCharacteristic
                        (
                            ReadWriteCharacteristicUuid,
                            cb => cb
                            .SetRead(req =>
                        {
                            var value = this.CharacteristicValue ?? "Test";
                            var bytes = Encoding.UTF8.GetBytes(value);
                            this.Write($"Characteristic Read Received - Sent {value}");
                            return(ReadResult.Success(bytes));
                        })
                            .SetWrite(req =>
                        {
                            var write = Encoding.UTF8.GetString(req.Data, 0, req.Data.Length);
                            this.Write($"Characteristic Write Received - {write}");
                            return(GattState.Success);
                        })
                        );
                    }
                    );
                    await peripheral.StartAdvertising(new AdvertisementData
                    {
                        LocalName = "My GATT"
                    });
                    this.Write("GATT Server Started with Name: My GATT");
                    this.IsRunning = true;
                }
            });

            this.Clear = ReactiveCommand.Create(() => this.Output = String.Empty);
        }
Пример #31
0
        public GattServerSetupPageViewModel(INavigationService navigationService, IAdapter adapter, IDialogService dialogService, IUserDialogs userDialogs, IDeviceInfo deviceInfoUtil, IGeolocator geolocatorUtil, ILocationManager locationManager) : base(navigationService)
        {
            _adapter         = adapter;
            _dialogService   = dialogService;
            _userDialogs     = userDialogs;
            _deviceInfoUtil  = deviceInfoUtil;
            _geolocatorUtil  = geolocatorUtil;
            _locationManager = locationManager;

            this.BackCommand             = new DelegateCommand(async() => await OnBackCommandAsync());
            this.SelectInfoCommand       = new DelegateCommand(async() => await ExecuteSelectInfoCommand());
            this.BroadcastCommand        = new DelegateCommand(async() => await OnBroadcastCommandAsync(), () => !string.IsNullOrWhiteSpace(this.ServerName)).ObservesProperty(() => this.ServerName);
            this.ServiceSelectionCommand = new DelegateCommand <GattServiceItemModel>(async(item) => await OnServiceSelectionCommand(item));

            this.DeactivateCharacteristicWith = new CompositeDisposable();
        }
Пример #32
0
 public static void AlertNoConnection(this IUserDialogs dialogs)
 {
     UserDialogs.Instance.HideLoading();
     dialogs.Alert("Fehler beim Verbinden mit dem Server!", "Verbindung fehlgeschlagen");
 }
Пример #33
0
 public LogInPageViewModel(
     INavigationService navigationService,
     IUserDialogs userDialogsService) : base(navigationService, userDialogsService)
 {
 }
Пример #34
0
 public CustomerPageViewModel()
 {
     userDialogs = DependencyService.Get <IUserDialogs>();
     SubscribeMessages();
 }
Пример #35
0
        public EmulationService(IUserDialogs dialogsService, ILocalizationService localizationService, IPlatformService platformService, ICryptographyService cryptographyService, IInputManager inputManager)
        {
            LocalizationService = localizationService;
            PlatformService     = platformService;
            InputManager        = inputManager;

            RootFrame.Navigated += OnNavigated;

            Task.Run(() =>
            {
                var CDImageExtensions = new HashSet <string> {
                    ".bin", ".cue", ".iso", ".mds", ".mdf"
                };

                systems = new ViewModels.GameSystemVM[]
                {
                    new ViewModels.GameSystemVM(FCEUMMRT.FCEUMMCore.Instance, LocalizationService, "SystemNameNES", "ManufacturerNameNintendo", "\uf118"),
                    new ViewModels.GameSystemVM(Snes9XRT.Snes9XCore.Instance, LocalizationService, "SystemNameSNES", "ManufacturerNameNintendo", "\uf119"),
                    //new ViewModels.GameSystemVM(ParallelN64RT.ParallelN64Core.Instance, LocalizationService, "SystemNameNintendo64", "ManufacturerNameNintendo", "\uf116"),
                    new ViewModels.GameSystemVM(GambatteRT.GambatteCore.Instance, LocalizationService, "SystemNameGameBoy", "ManufacturerNameNintendo", "\uf11b"),
                    new ViewModels.GameSystemVM(VBAMRT.VBAMCore.Instance, LocalizationService, "SystemNameGameBoyAdvance", "ManufacturerNameNintendo", "\uf115"),
                    new ViewModels.GameSystemVM(MelonDSRT.MelonDSCore.Instance, LocalizationService, "SystemNameDS", "ManufacturerNameNintendo", "\uf117"),
                    new ViewModels.GameSystemVM(GPGXRT.GPGXCore.Instance, LocalizationService, "SystemNameSG1000", "ManufacturerNameSega", "\uf102", true, new HashSet <string> {
                        ".sg"
                    }),
                    new ViewModels.GameSystemVM(GPGXRT.GPGXCore.Instance, LocalizationService, "SystemNameMasterSystem", "ManufacturerNameSega", "\uf118", true, new HashSet <string> {
                        ".sms"
                    }),
                    new ViewModels.GameSystemVM(GPGXRT.GPGXCore.Instance, LocalizationService, "SystemNameGameGear", "ManufacturerNameSega", "\uf129", true, new HashSet <string> {
                        ".gg"
                    }),
                    new ViewModels.GameSystemVM(GPGXRT.GPGXCore.Instance, LocalizationService, "SystemNameMegaDrive", "ManufacturerNameSega", "\uf124", true, new HashSet <string> {
                        ".mds", ".md", ".smd", ".gen"
                    }),
                    new ViewModels.GameSystemVM(GPGXRT.GPGXCore.Instance, LocalizationService, "SystemNameMegaCD", "ManufacturerNameSega", "\uf124", false, new HashSet <string> {
                        ".bin", ".cue", ".iso"
                    }, CDImageExtensions),
                    //new ViewModels.GameSystemVM(BeetleSaturnRT.BeetleSaturnCore.Instance, LocalizationService, "SystemNameSaturn", "ManufacturerNameSega", "\uf124", false, null, CDImageExtensions),
                    new ViewModels.GameSystemVM(BeetlePSXRT.BeetlePSXCore.Instance, LocalizationService, "SystemNamePlayStation", "ManufacturerNameSony", "\uf128", false, null, CDImageExtensions),
                    new ViewModels.GameSystemVM(BeetlePCEFastRT.BeetlePCEFastCore.Instance, LocalizationService, "SystemNamePCEngine", "ManufacturerNameNEC", "\uf124", true, new HashSet <string> {
                        ".pce"
                    }),
                    new ViewModels.GameSystemVM(BeetlePCEFastRT.BeetlePCEFastCore.Instance, LocalizationService, "SystemNamePCEngineCD", "ManufacturerNameNEC", "\uf124", false, new HashSet <string> {
                        ".cue", ".ccd"
                    }, CDImageExtensions),
                    new ViewModels.GameSystemVM(BeetlePCFXRT.BeetlePCFXCore.Instance, LocalizationService, "SystemNamePCFX", "ManufacturerNameNEC", "\uf124", false, new HashSet <string> {
                        ".cue", ".ccd", ".toc"
                    }, CDImageExtensions),
                    new ViewModels.GameSystemVM(BeetleWswanRT.BeetleWswanCore.Instance, LocalizationService, "SystemNameWonderSwan", "ManufacturerNameBandai", "\uf129"),
                    new ViewModels.GameSystemVM(FBAlphaRT.FBAlphaCore.Instance, LocalizationService, "SystemNameNeoGeo", "ManufacturerNameSNK", "\uf102", false),
                    new ViewModels.GameSystemVM(BeetleNGPRT.BeetleNGPCore.Instance, LocalizationService, "SystemNameNeoGeoPocket", "ManufacturerNameSNK", "\uf129"),
                    new ViewModels.GameSystemVM(FBAlphaRT.FBAlphaCore.Instance, LocalizationService, "SystemNameArcade", "ManufacturerNameFBAlpha", "\uf102", true),
                };

                var allCores            = systems.Select(d => d.Core).Distinct().ToArray();
                fileDependencyImporters = allCores.Where(d => d.FileDependencies.Any()).SelectMany(d => d.FileDependencies.Select(e => new { core = d, deps = e }))
                                          .Select(d => new FileImporterVM(dialogsService, localizationService, platformService, cryptographyService,
                                                                          new WinRTFolder(d.core.SystemFolder), d.deps.Name, d.deps.Description, d.deps.MD5)).ToArray();
            }).ContinueWith(d =>
            {
                InitializationComplete = true;
                PlatformService.RunOnUIThreadAsync(() => CoresInitialized(this));
            });
        }
Пример #36
0
 public TransactionPageModel(IRestService service, IUserDialogs userDialog)
 {
     this.service    = service;
     this.userDialog = userDialog;
 }
Пример #37
0
 public UserDialogService(IUserDialogs acrUserDialogs)
 {
     this.acrUserDialogs = acrUserDialogs;
 }
 public DialogExceptionHandler(IUserDialogs userDialogs) => _userDialogs = userDialogs;
Пример #39
0
        public SettingsViewModel(IUserDialogs dialogs)
            : base(dialogs)
        {
            this.StandardSettings = new Command(() =>
            {
                // CANCEL
                ActionSheetConfig.DefaultCancelText = ConfirmConfig.DefaultCancelText = LoginConfig.DefaultCancelText = PromptConfig.DefaultCancelText = ProgressDialogConfig.DefaultCancelText = "Cancel";

                // OK
                AlertConfig.DefaultOkText = ConfirmConfig.DefaultOkText = LoginConfig.DefaultOkText = PromptConfig.DefaultOkText = "Ok";

                // CUSTOM
                ActionSheetConfig.DefaultDestructiveText = "Remove";
                ConfirmConfig.DefaultYes = "Yes";
                ConfirmConfig.DefaultNo = "No";
                DatePromptConfig.DefaultCancelText = "Cancel";
                DatePromptConfig.DefaultOkText = "Ok";
                TimePromptConfig.DefaultMinuteInterval = 1;
                TimePromptConfig.DefaultCancelText = "Cancel";
                TimePromptConfig.DefaultOkText = "Ok";
                LoginConfig.DefaultTitle = "Login";
                LoginConfig.DefaultLoginPlaceholder = "User Name";
                LoginConfig.DefaultPasswordPlaceholder = "Password";
                ProgressDialogConfig.DefaultTitle = "Loading";

                ToastConfig.DefaultDuration = TimeSpan.FromSeconds(3);

                this.Result("Default Settings Loading - Now run samples");
            });

            this.LoadAbnormalSettings = new Command(() =>
            {
                ActionSheetConfig.DefaultCancelText = ConfirmConfig.DefaultCancelText = LoginConfig.DefaultCancelText = PromptConfig.DefaultCancelText = ProgressDialogConfig.DefaultCancelText = "NO WAY";

                // OK
                AlertConfig.DefaultOkText = ConfirmConfig.DefaultOkText = LoginConfig.DefaultOkText = PromptConfig.DefaultOkText = "Sure";

                // CUSTOM
                ActionSheetConfig.DefaultDestructiveText = "BOOM!";
                ConfirmConfig.DefaultYes = "SIGN LIFE AWAY";
                ConfirmConfig.DefaultNo = "NO WAY";

                DatePromptConfig.DefaultCancelText = "BYE";
                DatePromptConfig.DefaultOkText = "Do Something";

                TimePromptConfig.DefaultMinuteInterval = 15;
                TimePromptConfig.DefaultCancelText = "BYE";
                TimePromptConfig.DefaultOkText = "Do Something";
                LoginConfig.DefaultTitle = "HIGH SECURITY";
                LoginConfig.DefaultLoginPlaceholder = "WHO ARE YOU?";
                LoginConfig.DefaultPasswordPlaceholder = "SUPER SECRET PASSWORD";
                ProgressDialogConfig.DefaultTitle = "WAIT A MINUTE";

                // TOAST
                ToastConfig.DefaultDuration = TimeSpan.FromSeconds(5);

                //ToastConfig.InfoBackgroundColor = System.Drawing.Color.Aqua;
                //ToastConfig.SuccessTextColor = System.Drawing.Color.Blue;
                //ToastConfig.SuccessBackgroundColor = System.Drawing.Color.BurlyWood;
                //ToastConfig.WarnBackgroundColor = System.Drawing.Color.BlueViolet;
                //ToastConfig.ErrorBackgroundColor = System.Drawing.Color.DeepPink;

                this.Result("Abnormal Settings Loaded - Now run samples");
            });
        }
Пример #40
0
 public GlobalExceptionHandler(IUserDialogs dialogs) => this.dialogs = dialogs;
 public AudioRecorderViewModel(INetworkService networkService, IUserDialogs userDialogs, IMvxMessenger msg) : base(networkService, userDialogs)
 {
     _msg = Mvx.Resolve<IMvxMessenger>(); ;
 }
Пример #42
0
 protected AbstractViewModel(IUserDialogs dialogs)
 {
     this.Dialogs = dialogs;
 }
 public DescriptorDetailViewModel(IAdapter adapter, IUserDialogs userDialogs) : base(adapter)
 {
     _userDialogs = userDialogs;
 }
		public StoreMapViewModel(IStoresService storesService, IUserDialogs dservices) : base(storesService, dservices)
		{
			
		}
Пример #45
0
 public BaseViewModel(INetworkService networkService, IUserDialogs userDialogs)
 {
     NetworkService = networkService;
     UserDialogs = userDialogs;
 }
Пример #46
0
        public EditProjectPageViewModel(
            INavigationService navigationService,
            IUserDialogs dialogService,
            IAnalyticService analyticService) : base(navigationService)
        {
            Title = "New Project";
            analyticService.TrackScreen("edit-project-page");

            // store the fields in an enumerable for easy use later on in this class
            _validatableFields = new IValidity[]
            {
                ProjectName,

                //StartStatus,
                Description,
                SkillsRequired,
                PayRate,

                //PaymentType
            };

            AddValidationRules();

            Save = ReactiveCommand.CreateFromTask(async() =>
            {
                if (!IsValid())
                {
                    return;
                }

                analyticService.TrackTapEvent("save");

                if (_project != null)
                {
                    // if the product was being edited, map the local fields back to the project and
                    // save it
                    //_project.Name = ProjectName.Value;
                    _project.Description = Description.Value;

                    //_project.SkillsRequired = SkillsRequired.Value;
                    //_project.PaymentRate = decimal.Parse(PayRate.Value);
                    //_project.PaymentType = PaymentType.Value;

                    //switch (StartStatus.Value)
                    //{
                    //    case ProjectStartStatus.ReadyNow:
                    //        _project.EstimatedStartDate = DateTime.Today;
                    //        break;

                    // case ProjectStartStatus.OneToTwoWeeks: _project.EstimatedStartDate =
                    // DateTime.Today.AddDays(7); break;

                    // case ProjectStartStatus.ThreeToFourWeeks: _project.EstimatedStartDate =
                    // DateTime.Today.AddDays(7 * 3); break;

                    // case ProjectStartStatus.FiveOrMoreWeeks: _project.EstimatedStartDate =
                    // DateTime.Today.AddDays(7 * 5); break;

                    //    default:
                    //        throw new InvalidOperationException("Invalid start status");
                    //}

                    // TODO: projectDataStore.Update(_project);
                }
                else
                {
                    // the project was a new project. Save it

                    // TODO: projectDataStore.Save(_project);
                }

                // TODO: Return the project in the navigation parameters so we can refresh it in the UI of the calling page.

                await NavigationService.GoBackAsync(useModalNavigation: true).ConfigureAwait(false);
            });

            Cancel = ReactiveCommand.CreateFromTask(async() =>
            {
                if (_validatableFields.Any(field => field.IsChanged))
                {
                    bool keepEditing = await dialogService.ConfirmAsync(
                        new ConfirmConfig
                    {
                        Title      = "Unsaved changes",
                        Message    = "Are you sure you want to discard this project?",
                        OkText     = "Keep Editing",
                        CancelText = "Discard"
                    });
                    if (keepEditing)
                    {
                        // the user has chosen the option to continue editing
                        return;
                    }
                }

                analyticService.TrackTapEvent("cancel");

                // if there are no changes, or the user chooses to discard, go back to the previous screen
                await NavigationService.GoBackAsync(useModalNavigation: true).ConfigureAwait(false);
            });

            NavigatingTo
            .Take(1)
            .Where(args => args.ContainsKey("project"))
            .Select(args => (Project)args["project"])
            .Subscribe(project =>
            {
                // store the project being edited
                _project = project;
                Title    = "Edit Project";

                // map the project being edited to the local fields
                //ProjectName.Value = project.Name;
                //StartStatus.Value = project.StartStatus;
                Description.Value = project.Description;

                //SkillsRequired.Value = project.SkillsRequired;
                //PayRate.Value = project.PaymentRate.ToString();
                //PaymentType.Value = project.PaymentType;

                // accept changes for all fields
                foreach (var field in _validatableFields)
                {
                    field.AcceptChanges();
                }
            });

            // accept changes so we can determine whether they've been changed later on
            foreach (var field in _validatableFields)
            {
                field.AcceptChanges();
            }
        }
 public StoreListViewModel(IStoresService storesService, IUserDialogs dialogsService)
 {
     _storesService = storesService;
     _dialogsService = dialogsService;
     Initialization = NotifyTaskCompletion.Create(RefreshList);
 }
 public WorkerQueueViewModel(INetworkService networkService, IUserDialogs userDialogs, IAzureService azureService)
     : base(networkService, userDialogs)
 {
     _azureService = azureService;
 }
 public ServiceListViewModel(IAdapter adapter, IUserDialogs userDialogs) : base(adapter)
 {
     _userDialogs = userDialogs;
 }
Пример #50
0
        public StandardViewModel(IUserDialogs dialogs) : base(dialogs)
        {
            this.Commands = new List<CommandViewModel>
            {
                new CommandViewModel
                {
                    Text = "Alert",
                    Command = this.Create(async token => await this.Dialogs.AlertAsync("Test alert", "Alert Title", null, token))
                },
                new CommandViewModel
                {
                    Text = "Alert Long Text",
                    Command = this.Create(async token =>
                        await this.Dialogs.AlertAsync(
                            "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc consequat diam nec eros ornare, vitae cursus nunc molestie. Praesent eget lacus non neque cursus posuere. Nunc venenatis quam sed justo bibendum, ut convallis arcu lobortis. Vestibulum in diam nisl. Nulla pulvinar lacus vel laoreet auctor. Morbi mi urna, viverra et accumsan in, pretium vel lorem. Proin elementum viverra commodo. Sed nunc justo, sollicitudin eu fermentum vitae, faucibus a est. Nulla ante turpis, iaculis et magna sed, facilisis blandit dolor. Morbi est felis, semper non turpis non, tincidunt consectetur enim.",
                            cancelToken: token
                        )
                    )
                },
                new CommandViewModel
                {
                    Text = "Action Sheet",
                    Command = this.CreateActionSheetCommand(false, true, 6)
                },
                new CommandViewModel
                {
                    Text = "Action Sheet /w Message",
                    Command = this.CreateActionSheetCommand(false, false, 6, "This is an example of using a message in Acr.UserDialogs actionsheets.  I needed a long message here!")
                },
                new CommandViewModel
                {
                    Text = "Action Sheet (No Cancel)",
                    Command = this.CreateActionSheetCommand(false, false, 3)
                },
                new CommandViewModel
                {
                    Text = "Action Sheet (async)",
                    Command = this.Create(async token =>
                    {
                        var result = await this.Dialogs.ActionSheetAsync("Test Title", "Cancel", "Destroy", token, "Button1", "Button2", "Button3");
                        this.Result(result);
                    })
                },
                new CommandViewModel
                {
                    Text = "Bottom Sheet (Android Only)",
                    Command = this.CreateActionSheetCommand(true, true, 6)
                },
                new CommandViewModel
                {
                    Text = "Confirm",
                    Command = this.Create(async token =>
                    {
                        var r = await this.Dialogs.ConfirmAsync("Pick a choice", "Pick Title", cancelToken: token);
                        var text = r ? "Yes" : "No";
                        this.Result($"Confirmation Choice: {text}");
                    })
                },
                new CommandViewModel
                {
                    Text = "Login",
                    Command = this.Create(async token =>
                    {
                        var r = await this.Dialogs.LoginAsync(new LoginConfig
                        {
                            //LoginValue = "LastUserName",
                            Message = "DANGER",
                            OkText = "DO IT",
                            CancelText = "GET OUT",
                            LoginPlaceholder = "Username Placeholder",
                            PasswordPlaceholder = "Password Placeholder"
                        }, token);
                        var status = r.Ok ? "Success" : "Cancelled";
                        this.Result($"Login {status} - User Name: {r.LoginText} - Password: {r.Password}");
                    })
                },
                new CommandViewModel
                {
                    Text = "Prompt",
                    Command = new Command(() => this.Dialogs.ActionSheet(new ActionSheetConfig()
                        .SetTitle("Choose Type")
                        .Add("Default", () => this.PromptCommand(InputType.Default))
                        .Add("E-Mail", () => this.PromptCommand(InputType.Email))
                        .Add("Name", () => this.PromptCommand(InputType.Name))
                        .Add("Number", () => this.PromptCommand(InputType.Number))
                        .Add("Number with Decimal", () => this.PromptCommand(InputType.DecimalNumber))
                        .Add("Password", () => this.PromptCommand(InputType.Password))
                        .Add("Numeric Password (PIN)", () => this.PromptCommand(InputType.NumericPassword))
                        .Add("Phone", () => this.PromptCommand(InputType.Phone))
                        .Add("Url", () => this.PromptCommand(InputType.Url))
                        .SetCancel()
                    ))
                },
                new CommandViewModel
                {
                    Text = "Prompt Max Length",
                    Command = this.Create(async token =>
                    {
                        var result = await this.Dialogs.PromptAsync(new PromptConfig()

                            .SetTitle("Max Length Prompt")
                            .SetPlaceholder("Maximum Text Length (10)")
                            .SetMaxLength(10), token);

                        this.Result($"Result - {result.Ok} - {result.Text}");
                    })
                },
                new CommandViewModel
                {
                    Text = "Prompt (No Text or Cancel)",
                    Command = this.Create(async token =>
                    {
                        var result = await this.Dialogs.PromptAsync(new PromptConfig
                        {
                            Title = "PromptWithTextAndNoCancel",
                            Text = "Existing Text",
                            IsCancellable = false
                        }, token);
                        this.Result($"Result - {result.Ok} - {result.Text}");
                    })
                },
                new CommandViewModel
                {
                    Text = "Date",
                    Command = this.Create(async token =>
                    {
                        var result = await this.Dialogs.DatePromptAsync(new DatePromptConfig
                        {
                            IsCancellable = true,
                            MinimumDate = DateTime.Now.AddDays(-3),
                            MaximumDate = DateTime.Now.AddDays(1)
                        }, token);
                        this.Result($"Date Prompt: {result.Ok} - Value: {result.SelectedDate}");
                    })
                },
                new CommandViewModel
                {
                    Text = "Time",
                    Command = this.Create(async token =>
                    {
                        var result = await this.Dialogs.TimePromptAsync(new TimePromptConfig
                        {
                            IsCancellable = true
                        }, token);
                        this.Result($"Time Prompt: {result.Ok} - Value: {result.SelectedTime}");
                    })
                },
                new CommandViewModel
                {
                    Text = "Time (24 hour clock)",
                    Command = this.Create (async token => {
                        var result = await this.Dialogs.TimePromptAsync(new TimePromptConfig {
                            IsCancellable = true,
                            Use24HourClock = true
                        }, token);
                        this.Result ($"Time Prompt: {result.Ok} - Value: {result.SelectedTime}");
                    })
                }
            };
        }
Пример #51
0
 public TodoItemDetailViewModel(ITodoItemService todoItemService, IUserDialogs dialog)
 {
     _dialog  = dialog;
     _service = todoItemService;
 }
Пример #52
0
        public AlertsViewModel(IAlertService alertService, IUserDialogs userDialogs,
                               IMvxMessenger mvxMessenger, AppHelper appHelper) : base(userDialogs, mvxMessenger, appHelper)
        {
            _alertService = alertService;

            ClearAlertsCommand = ReactiveCommand
                                 .CreateFromObservable <Unit, string>((param) =>
            {
                return(_appHelper.RequestConfirmation(AppResources.Alerts_Confirm_Clear)
                       .Do((_) => _userDialogs.ShowLoading(AppResources.Alerts_Deleting_Alerts))
                       .SelectMany((_) => string.IsNullOrEmpty(SonIdentity)
                                                 ? _alertService.ClearSelfAlerts() : _alertService.ClearAlertsOfSon(SonIdentity))
                       .Do((_) => _userDialogs.HideLoading()));
            });

            ClearAlertsCommand.Subscribe((alertsDeleted) =>
            {
                Debug.WriteLine("Alerts Deleted -> " + alertsDeleted);
                Alerts.Clear();
                DataFound = false;
            });

            ClearAlertsCommand.ThrownExceptions.Subscribe(HandleExceptions);

            RefreshCommand = ReactiveCommand
                             .CreateFromObservable <Unit, IList <AlertEntity> >((param) =>
            {
                if (PopupNavigation.PopupStack.Count > 0)
                {
                    PopupNavigation.PopAllAsync();
                }
                return(string.IsNullOrEmpty(SonIdentity) ?
                       alertService.GetSelfAlerts(CountAlertsOption.Value, AntiquityOfAlertsOption.Value, AlertLevelFilter) :
                       _alertService.GetAlertsBySon(SonIdentity, CountAlertsOption.Value, AntiquityOfAlertsOption.Value, AlertLevelFilter));
            });

            RefreshCommand.Subscribe((AlertsEntities) =>
            {
                Alerts.ReplaceRange(AlertsEntities);
                ResetCommonProps();
            });

            RefreshCommand.IsExecuting.Subscribe((IsLoading) => IsBusy = IsLoading);

            RefreshCommand.ThrownExceptions.Subscribe(HandleExceptions);

            DeleteAlertCommand = ReactiveCommand
                                 .CreateFromObservable <AlertEntity, string>((AlertEntity) =>
                                                                             alertService.DeleteAlertOfSon(AlertEntity.Son.Identity, AlertEntity.Identity)
                                                                             .Do((_) => Alerts.Remove(AlertEntity)));

            DeleteAlertCommand.IsExecuting.Subscribe((IsLoading) => IsBusy = IsLoading);

            DeleteAlertCommand.Subscribe((_) =>
            {
                _userDialogs.ShowSuccess(AppResources.Alerts_Deleted);

                if (Alerts.Count() == 0)
                {
                    DataFound = false;
                }
            });

            DeleteAlertCommand.ThrownExceptions.Subscribe(HandleExceptions);


            AllCategory.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "IsFiltered")
                {
                    foreach (var category in AlertsLevelCategories)
                    {
                        category.IsEnabled = !AllCategory.IsFiltered;
                        if (AllCategory.IsFiltered)
                        {
                            category.IsFiltered = true;
                        }
                    }
                }
            };

            foreach (AlertCategoryModel AlertCategory in AlertsLevelCategories)
            {
                AlertCategory.PropertyChanged += (sender, e) =>
                {
                    if (e.PropertyName == "IsFiltered")
                    {
                        var AlertCategoryModel = sender as AlertCategoryModel;
                        UpdateAlertFilter(AlertCategoryModel);
                    }
                };
            }
        }
Пример #53
0
        public SettingsViewModel(IPermissions permissions,
                                 IGeofenceManager geofences,
                                 IUserDialogs dialogs,
                                 IViewModelManager viewModelMgr)
        {
            this.permissions = permissions;
            this.geofences = geofences;
            this.dialogs = dialogs;

            this.Menu = new Command(() => dialogs.ActionSheet(new ActionSheetConfig()
                .SetCancel()
                .Add("Add Geofence", async () => 
                    await viewModelMgr.PushNav<AddGeofenceViewModel>()
                )
                .Add("Use Default Geofences", async () => 
                {
                    var result = await dialogs.ConfirmAsync(new ConfirmConfig()
                        .UseYesNo()
                        .SetMessage("This will stop monitoring all existing geofences and set the defaults.  Are you sure you want to do this?"));

                    if (result)
                    {
                        geofences.StopAllMonitoring();
                        await Task.Delay(500);
                        geofences.StartMonitoring(new GeofenceRegion
                        {
                            Identifier = "FC HQ",
                            Center = new Position(43.6411314, -79.3808415),   // 88 Queen's Quay - Home
                            Radius = Distance.FromKilometers(1)
                        });
                        geofences.StartMonitoring(new GeofenceRegion
                        {
                            Identifier = "Close to HQ",
                            Center = new Position(43.6411314, -79.3808415),   // 88 Queen's Quay
                            Radius = Distance.FromKilometers(3)
                        });
                        geofences.StartMonitoring(new GeofenceRegion 
                        {
                            Identifier = "Ajax GO Station",
                            Center = new Position(43.8477697, -79.0435461),
                            Radius = Distance.FromMeters(500)
                        });
                        await Task.Delay(500); // ios needs a second to breathe when registering like this
                        this.RaisePropertyChanged("CurrentRegions");
                    }                
                })
                .Add("Stop All Geofences", async () => 
                {
                    var result = await dialogs.ConfirmAsync(new ConfirmConfig()
                        .UseYesNo()
                        .SetMessage("Are you sure wish to stop monitoring all geofences?"));

                    if (result)
                    {
                        this.geofences.StopAllMonitoring();
                        this.RaisePropertyChanged("CurrentRegions");
                    }
                })
            ));
            
            this.Remove = new Command<GeofenceRegion>(x =>
            {
                this.geofences.StopMonitoring(x);
                this.RaisePropertyChanged("CurrentRegions");
            });
        }
Пример #54
0
 public BleGattServiceViewModel(Guid service, IBleGattServerConnection gattServer, IUserDialogs dialogManager)
 {
     m_serviceGuid   = service;
     Characteristic  = new ObservableCollection <BleGattCharacteristicViewModel>();
     m_gattServer    = gattServer;
     m_dialogManager = dialogManager;
 }
Пример #55
0
        public App(
            string uri,
            IAuthService authService,
            IConnectivity connectivity,
            IUserDialogs userDialogs,
            IDatabaseService databaseService,
            ISyncService syncService,
            IFingerprint fingerprint,
            ISettings settings,
            ILockService lockService,
            IGoogleAnalyticsService googleAnalyticsService,
            ILocalizeService localizeService)
        {
            _uri                    = uri;
            _databaseService        = databaseService;
            _connectivity           = connectivity;
            _userDialogs            = userDialogs;
            _syncService            = syncService;
            _authService            = authService;
            _fingerprint            = fingerprint;
            _settings               = settings;
            _lockService            = lockService;
            _googleAnalyticsService = googleAnalyticsService;
            _localizeService        = localizeService;

            SetCulture();
            SetStyles();

            if (authService.IsAuthenticated && _uri != null)
            {
                MainPage = new ExtendedNavigationPage(new VaultAutofillListLoginsPage(_uri));
            }
            else if (authService.IsAuthenticated)
            {
                MainPage = new MainPage();
            }
            else
            {
                MainPage = new ExtendedNavigationPage(new HomePage());
            }

            MessagingCenter.Subscribe <Application, bool>(Current, "Resumed", async(sender, args) =>
            {
                await CheckLockAsync(args);
                await Task.Run(() => IncrementalSyncAsync()).ConfigureAwait(false);
            });

            MessagingCenter.Subscribe <Application, bool>(Current, "Lock", (sender, args) =>
            {
                Device.BeginInvokeOnMainThread(async() => await CheckLockAsync(args));
            });

            MessagingCenter.Subscribe <Application, string>(Current, "Logout", (sender, args) =>
            {
                Device.BeginInvokeOnMainThread(() => Logout(args));
            });

            MessagingCenter.Subscribe <Application>(Current, "SetMainPage", (sender) =>
            {
                _setMainPageCancellationTokenSource = SetMainPageFromAutofill(_setMainPageCancellationTokenSource, 500);
            });

            MessagingCenter.Subscribe <Application>(Current, "SetMainPageNow", (sender) =>
            {
                _setMainPageCancellationTokenSource = SetMainPageFromAutofill(_setMainPageCancellationTokenSource, 0);
            });
        }
Пример #56
0
 public MainViewModel(IMvxNavigationService navigationService, IApiService apiService, IUserDialogs userDialogs)
 {
     _navigationService = navigationService;
     _apiService        = apiService;
     _userDialogs       = userDialogs;
 }
 public DisplayIncidentViewModel(INetworkService networkService, IUserDialogs userDialogs, IAzureService azureService)
     : base(networkService, userDialogs)
 {
     _azureService = azureService;
     IncidentDetails = new List<DisplayIncidentDetailViewModel>();
 }
 public DiscoverPageModel(IUserDialogs userDialogs, IBeerDrinkinClient beerDrinkinClient)
 {
     _userDialogs = userDialogs;
     _beerDrinkinClient = beerDrinkinClient;
 }