Ejemplo 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);
            });