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); });
public SettingsPageViewModel() { _selectedTab = 0; GeneralSettingsTab = new GeneralSettingsTabViewModel(); BitcoinTabSettings = new BitcoinTabSettingsViewModel(); RestartCommand = ReactiveCommand.Create(AppLifetimeHelper.Restart); }
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); });