Esempio n. 1
0
        private void RegisterViewModels()
        {
            SearchPageViewModel.Register(_searchPage);
            PrivacyModeViewModel.Register(_privacyMode);
            AddWalletPageViewModel.Register(_addWalletPage);
            SettingsPageViewModel.Register(_settingsPage);

            GeneralSettingsTabViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 0;
                return(_settingsPage);
            });

            PrivacySettingsTabViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 1;
                return(_settingsPage);
            });

            NetworkSettingsTabViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 2;
                return(_settingsPage);
            });

            BitcoinTabSettingsViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 3;
                return(_settingsPage);
            });

            AboutViewModel.RegisterLazy(() => new AboutViewModel());

            BroadcastTransactionViewModel.RegisterAsyncLazy(
                async() =>
            {
                var dialogResult = await DialogScreen.NavigateDialog(new LoadTransactionViewModel(_global.Network));

                if (dialogResult.Result is { })
                {
                    while (_global.TransactionBroadcaster is null)
                    {
                        await Task.Delay(100);
                    }

                    return(new BroadcastTransactionViewModel(
                               _global.BitcoinStore,
                               _global.Network,
                               _global.TransactionBroadcaster,
                               dialogResult.Result));
                }

                return(null);
            });
Esempio n. 2
0
        private void RegisterViewModels()
        {
            SearchPageViewModel.Register(_searchPage);
            PrivacyModeViewModel.Register(_privacyMode);
            AddWalletPageViewModel.Register(_addWalletPage);
            SettingsPageViewModel.Register(_settingsPage);

            GeneralSettingsTabViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 0;
                return(_settingsPage);
            });

            PrivacySettingsTabViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 1;
                return(_settingsPage);
            });

            NetworkSettingsTabViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 2;
                return(_settingsPage);
            });

            BitcoinTabSettingsViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 3;
                return(_settingsPage);
            });

            AboutViewModel.RegisterLazy(() => new AboutViewModel());

            BroadcastTransactionViewModel.RegisterAsyncLazy(
                async() =>
            {
                var dialogResult = await DialogScreen.NavigateDialogAsync(new LoadTransactionViewModel(Services.Config.Network));

                if (dialogResult.Result is { })
                {
                    return(new BroadcastTransactionViewModel(Services.Config.Network,
                                                             dialogResult.Result));
                }

                return(null);
            });
Esempio n. 3
0
        private void RegisterViewModels()
        {
            HomePageViewModel.Register(_homePage);

            SearchPageViewModel.Register(_searchPage);
            PrivacyModeViewModel.Register(_privacyMode);
            AddWalletPageViewModel.Register(_addWalletPage);
            SettingsPageViewModel.Register(_settingsPage);

            GeneralSettingsTabViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 0;
                return(_settingsPage);
            });

            PrivacySettingsTabViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 1;
                return(_settingsPage);
            });

            NetworkSettingsTabViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 2;
                return(_settingsPage);
            });

            BitcoinTabViewModel.RegisterLazy(
                () =>
            {
                _settingsPage.SelectedTab = 3;
                return(_settingsPage);
            });

            AboutViewModel.RegisterLazy(() => new AboutViewModel());

            LegalDocumentsViewModel.RegisterAsyncLazy(
                async() =>
            {
                var content = await File.ReadAllTextAsync(_global.LegalDocuments.FilePath);

                var legalDocs = new LegalDocumentsViewModel(content);

                return(legalDocs);
            });
        }