//private AccentColorRadioObjectGroup accentRadioGroup; public SettingsPage() { InitializeComponent(); BindingContext = new SettingsPageViewModel(AppServiceProvider.Instance); //accentRadioGroup = new AccentColorRadioObjectGroup() //{ // { RedAccentColorRadioCircle, AppAccentColor.Red }, // { PinkAccentColorRadioCircle, AppAccentColor.Pink }, // { PurpleAccentColorRadioCircle, AppAccentColor.Purple }, // { DeepPurpleAccentColorRadioCircle, AppAccentColor.DeepPurple }, // { IndigoAccentColorRadioCircle, AppAccentColor.Indigo }, // { BlueAccentColorRadioCircle, AppAccentColor.Blue }, // { LightBlueAccentColorRadioCircle, AppAccentColor.LightBlue }, // { CyanAccentColorRadioCircle, AppAccentColor.Cyan }, // { TealAccentColorRadioCircle, AppAccentColor.Teal }, // { GreenAccentColorRadioCircle, AppAccentColor.Green }, // { LightGreenAccentColorRadioCircle, AppAccentColor.LightGreen }, // { LimeAccentColorRadioCircle, AppAccentColor.Lime }, // { YellowAccentColorRadioCircle, AppAccentColor.Yellow }, // { AmberAccentColorRadioCircle, AppAccentColor.Amber }, // { OrangeAccentColorRadioCircle, AppAccentColor.Orange }, // { DeepOrangeAccentColorRadioCircle, AppAccentColor.DeepOrange } //}; //accentRadioGroup.InitializeSelected(Services.Theme.AccentColor); }
public SettingsPage() { _settingsPageViewModel = new SettingsPageViewModel(); InitializeComponent(); DataContext = _settingsPageViewModel; BackKeyPress += (o, e) => App.ViewModel.OnExitSettings(); }
public SettingsPage() { InitializeComponent(); ViewModel = IoC.Get <SettingsPageViewModel>(); this.AnimateOutStarted += OnLeavingPage; IoC.Get <MainWindow>().Closing += OnMainWindowExit; }
public void AppVerTest() { _mockEssentialsService.SetupGet(x => x.AppVersion).Returns("1.2.3"); SettingsPageViewModel unitUnderTest = CreateViewModel(); Assert.Equal("1.2.3", unitUnderTest.AppVer); }
protected override void OnInitialize() { var pages = new List <SettingsPageViewModel>(); _settingsEditors = IoC.GetAll <ISettingsEditor>(); foreach (var settingsEditor in _settingsEditors) { var parentCollection = GetParentCollection(settingsEditor, pages); var page = parentCollection.Find(m => m.Name == settingsEditor.SettingsPageName); if (page == null) { page = new SettingsPageViewModel { Name = settingsEditor.SettingsPageName }; parentCollection.Add(page); } page.Editors.Add(settingsEditor); } Pages = pages.OrderBy(se => se.Name).ToList(); // to sort main names foreach (var page in pages) // sort shildren { var children = page.Children; children = children.OrderBy(se => se.Name).ToList(); page.Children.Clear(); page.Children.AddRange(children); children.Clear(); } SelectedPage = GetFirstLeafPageRecursive(Pages); }
public SettingsPageView() { NavigationPage.SetHasNavigationBar(this, false); BackgroundColor = Color.FromHex(Theme.Current.AppBackgroundColor); BindingContext = new SettingsPageViewModel(new PlatformServices()); createViews(); }
public SettingsPage() { InitializeComponent(); BindingContext = new SettingsPageViewModel(); languagePicker.Items.Add("English"); foreach (var file in PlatformDependentSettings.GetLocalizations().Select(x => new FileInfo(x))) { if (file.Extension == ".xml") { languagePicker.Items.Add(file.Name.Split('.')[0]); } } languagePicker.SelectedItem = (from object item in languagePicker.Items where item.ToString() == Settings.Localization.ToString() select item).First(); languagePicker.SelectedIndexChanged += LanguagePicker_SelectedIndexChanged; speedSlider.Value = Settings.WalkingSpeedCoefficient * 100; subwaySwitch.IsToggled = Settings.AllowSubway; tramSwitch.IsToggled = Settings.AllowTram; busSwitch.IsToggled = Settings.AllowBus; trainSwitch.IsToggled = Settings.AllowTrain; cablecarSwitch.IsToggled = Settings.AllowCablecar; shipSwitch.IsToggled = Settings.AllowShip; wifiSwitch.IsToggled = Settings.UseCellularsToUpdateCache; }
public SettingsPage( SettingsPageViewModel viewModel , INavigationService navigationService , IMessageDisplayer messageDisplayer ) { InitializeComponent(); _navigationService = navigationService; _messageDisplayer = messageDisplayer; BindingContext = _viewModel = viewModel; MessagingCenter.Subscribe <SettingsPageViewModel, Exception>(_viewModel , MessengerKeys.SettingsFailedLoadSettings , (_, ex) => { Debug.WriteLine($"Error while searching for xpub: {Environment.NewLine}{ex}"); Device.BeginInvokeOnMainThread(async() => { // needs to be at root to show alerts await _navigationService.ClearStack(); await DisplayAlert("Erro", "Erro ao carregar configuração", "Cancelar"); }); } ); }
public SettingsPage() { SwappedOut += Dispose; InitializeComponent(); ViewModel = Lib.IoC.GetConstant <SettingsPageViewModel>(); Lib.IoC.Get <MainWindow>().Closing += OnMainWindowExit; }
public MainViewModel() { _windowState = (WindowState)Enum.Parse(typeof(WindowState), Services.UiConfig.WindowState); _windowWidth = Services.UiConfig.WindowWidth ?? 1280; _windowHeight = Services.UiConfig.WindowHeight ?? 960; var(x, y) = (Services.UiConfig.WindowX, Services.UiConfig.WindowY); if (x != null && y != null) { _windowPosition = new PixelPoint(x.Value, y.Value); } _dialogScreen = new DialogScreenViewModel(); _fullScreen = new DialogScreenViewModel(NavigationTarget.FullScreen); _compactDialogScreen = new DialogScreenViewModel(NavigationTarget.CompactDialogScreen); MainScreen = new TargettedNavigationStack(NavigationTarget.HomeScreen); NavigationState.Register(MainScreen, DialogScreen, FullScreen, CompactDialogScreen); _isMainContentEnabled = true; _isDialogScreenEnabled = true; _isFullScreenEnabled = true; _statusBar = new StatusBarViewModel(); UiServices.Initialize(); _addWalletPage = new AddWalletPageViewModel(); _settingsPage = new SettingsPageViewModel(); _privacyMode = new PrivacyModeViewModel(); _navBar = new NavBarViewModel(MainScreen); MusicControls = new MusicControlsViewModel(); NavigationManager.RegisterType(_navBar); RegisterViewModels(); RxApp.MainThreadScheduler.Schedule(async() => await _navBar.InitialiseAsync()); this.WhenAnyValue(x => x.WindowState, x => x.WindowPosition, x => x.WindowWidth, x => x.WindowHeight) .Where(x => x.Item1 != WindowState.Minimized) .Where(x => x.Item2 != new PixelPoint(-32000, -32000)) // value when minimized .ObserveOn(RxApp.MainThreadScheduler) .Subscribe(t => { var(state, position, width, height) = t; Services.UiConfig.WindowState = state.ToString(); if (position is { }) { Services.UiConfig.WindowX = position.Value.X; Services.UiConfig.WindowY = position.Value.Y; } Services.UiConfig.WindowWidth = width; Services.UiConfig.WindowHeight = height; });
public async Task EnumerateFiles() { var css = Substitute.For <IConfigurationSettingCollection>(); var shell = Substitute.For <ICoreShell>(); string folder = @"C:\"; string file1 = @"C:\Settings.R"; string file2 = @"C:\Debug.Settings.R"; string file3 = @"C:\foo.bar"; var fs = Substitute.For <IFileSystem>(); fs.GetFileSystemEntries(folder, Arg.Any <string>(), SearchOption.AllDirectories).Returns(new string[] { file1, file2, file3 }); fs.DirectoryExists(Arg.Any <string>()).Returns(false); fs.FileExists(file1).Returns(true); fs.FileExists(file2).Returns(true); fs.FileExists(file3).Returns(true); var model = new SettingsPageViewModel(css, shell, fs); await model.SetProjectPathAsync(folder, null); model.CurrentFile.Should().Be("~/Settings.R"); model.Files.Should().HaveCount(2); model.Files.ToArray()[0].Should().Be("~/Settings.R"); model.Files.ToArray()[1].Should().Be("~/Debug.Settings.R"); }
public SettingsPage(INavigation nav) { InitializeComponent(); ViewModel = new SettingsPageViewModel(nav, (bool)App.DataManager.IsFullScreenView); this.BindingContext = ViewModel; }
public SettingsPage() { this.InitializeComponent(); this.SetRequestedTheme(); this.viewModel = Ioc.Build <SettingsPageViewModel>(); this.DataContext = this.viewModel; }
public SettingsPage(MainWindow ownerWindow) { this.OwnerWindow = ownerWindow; this.ViewModel = new SettingsPageViewModel(this.OwnerWindow); this.DataContext = this.ViewModel; InitializeComponent(); }
public static SettingsPageViewModel GetSettVM() { if (Settings == null) { Settings = new SettingsPageViewModel(); } return(Settings); }
public SettingsPage() { InitializeComponent(); BindingContext = _viewModel = new SettingsPageViewModel(); _viewModel.LoadSettingsCommand.Execute(null); }
private async void ConvertToForm_Click(object sender, RoutedEventArgs e) { //packetMsg.MessageBody = " //Message #1 \r\n //Date: Mon, 01 Feb 2016 12:29:03 PST\r\n //From: kz6dm @w3xsc.ampr.org\r\n //To: kz6dm\r\n //Subject: 6DM-907P_O/R_ICS213_Check-in\r\n //!PACF!6DM-907P_O/R_ICS213_Check-in\r\n //# EOC MESSAGE FORM \r\n //# JS-ver. PR-4.1-3.1, 01/19/17,\r\n //# FORMFILENAME: Message.html\r\n //MsgNo: [6DM - 907P]\r\n //1a.: [02/01/2016]\r\n //1b.: [1219]\r\n4.: [OTHER]\r\n5.: [ROUTINE]\r\n7.: [Operations]\r\n9a.: [MTVEOC]\r\n8.: [Operations]\r\n9b.: [HOSECM]\r\n10.: [Check-in]\r\n12.: [\\nMonday Check-in]\r\nRec-Sent: [sent]\r\nMethod: [Other]\r\nOther: [Packet]\r\nOpCall: [KZ6DM]\r\nOpName: [Poul Hansen]\r\nOpDate: []\r\nOpTime: []\r\n# EOF\r\n"; // read data //!PACF!6DM - 681P_O / R_ICS213_ghjhgj //# EOC MESSAGE FORM //# JS-ver. PR-4.1-3.1, 01/19/17 //# FORMFILENAME: Message.html //MsgNo: [6DM - 681P] //1a.: [03/01/18] //1b.: [1650] //4.: [OTHER] //5.: [ROUTINE] //9a.: [gfhjgfj] //9b.: [gfhjgfhj] //10.: [ghjhgj] //12.: [\nghjghj] //Rec-Sent: [sent] //Method: [Other] //Other: [Packet] //OpCall: [KZ6DM] //OpName: [Poul Hansen] //OpDate: [03/01/2018] //OpTime: [1652] //#EOF // Find type // do a navigate to forms with index and form id (maybe file name} PacketMessage message = new PacketMessage() { ReceivedTime = DateTime.Parse(messageReceivedTime.Text), MessageNumber = SettingsPageViewModel.GetMessageNumberPacket(), TNCName = "E-Mail", }; message.MessageBody = $"Date: {message.ReceivedTime}\r\n"; message.MessageBody += $"From: {messageTo.Text}\r\n"; message.MessageBody += $"To: {messageFrom.Text}\r\n"; message.MessageBody += $"Subject: {messageSubject.Text}\r\n"; message.MessageBody += PacFormText.Text; CommunicationsService communicationsService = CommunicationsService.CreateInstance(); communicationsService.CreatePacketMessageFromMessageAsync(ref message); }
public SettingsPage() { InitializeComponent(); if (DataContext == null) { DataContext = new SettingsPageViewModel(); } _viewmodel = DataContext as SettingsPageViewModel; }
public void Add(SettingsPageViewModel subSetting) { if (SubSettings == null) { SubSettings = new SettingsPageViewModelCollection(); } subSetting.Parent = this; SubSettings.Add(subSetting); }
public NavBarViewModel(NavigationStateViewModel navigationState, RoutingState router, WalletManagerViewModel walletManager, AddWalletPageViewModel addWalletPage) { Router = router; _walletManager = walletManager; _topItems = new ObservableCollection <NavBarItemViewModel>(); _bottomItems = new ObservableCollection <NavBarItemViewModel>(); var homePage = new HomePageViewModel(navigationState, walletManager, addWalletPage); var settingsPage = new SettingsPageViewModel(navigationState); var searchPage = new SearchPageViewModel(navigationState, walletManager, addWalletPage, settingsPage, homePage); _selectedItem = homePage; _topItems.Add(SelectedItem); _bottomItems.Add(searchPage); _bottomItems.Add(settingsPage); _bottomItems.Add(addWalletPage); Router.CurrentViewModel .OfType <NavBarItemViewModel>() .Subscribe( x => { if (walletManager.Items.Contains(x) || _topItems.Contains(x) || _bottomItems.Contains(x)) { if (!_isNavigating) { _isNavigating = true; SelectedItem = x; _isNavigating = false; } } }); this.WhenAnyValue(x => x.SelectedItem) .OfType <NavBarItemViewModel>() .Subscribe( x => { if (!_isNavigating) { _isNavigating = true; x.NavigateToSelfAndReset(x.CurrentTarget); CollapseOnClickAction?.Invoke(); _isNavigating = false; } }); Observable.FromEventPattern(Router.NavigationStack, nameof(Router.NavigationStack.CollectionChanged)) .ObserveOn(RxApp.MainThreadScheduler) .Subscribe(_ => IsBackButtonVisible = Router.NavigationStack.Count > 1); this.WhenAnyValue(x => x.IsOpen) .Subscribe(x => SelectedItem.IsExpanded = x); }
public SettingsPage(SettingsPageViewModel settingsPageViewModel) { InitializeComponent(); _settingsPageViewModel = settingsPageViewModel; _settingsPageViewModel.ConnectedToPage = this; BindingContext = _settingsPageViewModel; }
public SettingsPage() { InitializeComponent(); this.ViewModel = new SettingsPageViewModel() { Title = this.Title }; this.BindingContext = this.ViewModel; }
public SettingsPage() { InitializeComponent(); BindingContext = new SettingsPageViewModel(Navigation); var navigationPage = Application.Current.MainPage as NavigationPage; navigationPage.BarBackgroundColor = Color.Green; }
protected override void OnDisappearing() { base.OnDisappearing(); this.BindingContext = null; this.ViewModel = null; GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced); }
public void InitializeTest() { _mockEventLogRepository.Setup(x => x.IsExist()).ReturnsAsync(true); SettingsPageViewModel unitUnderTest = CreateViewModel(); unitUnderTest.Initialize(new NavigationParameters()); _mockLoggerService.Verify(x => x.Info("isExistEventLogs: True", It.IsAny <string>(), It.IsAny <string>(), It.IsAny <int>()), Times.Once()); }
public IActionResult Settings() { SettingsPageViewModel model = new SettingsPageViewModel() { Categories = _categoryLogic.GetAll().Select(c => new CategoryViewModel { Id = c.CategoryId, Name = c.Name }).ToList(), }; return(View(model)); }
public Page CreateSettingsPage() { var settingsPageViewModel = new SettingsPageViewModel(); var settingsPagePresenter = new SettingsPagePresenter(settingsPageViewModel, _mainService, _synchronizationContext); var settingsPageView = new SettingsPageView(); settingsPageView.DataContext = settingsPageViewModel; return(settingsPageView); }
protected override void InitializationComplete() { // init _service = ServiceManager.ConfigureService <GeneralSettingService>(); _viewModel = new SettingsPageViewModel(); comboLanguages.ItemsSource = MultiLangEnumHelper.ToCollection(typeof(Language)); comboAccentColors.ItemsSource = MCThemeManager.Instance.AccentColors; comboThemeColors.ItemsSource = MCThemeManager.Instance.ThemeColors; this.DataContext = _viewModel; }
/// <summary> /// 現在のインスタンスで使用されているリソースを解放します。 /// </summary> /// <param name="disposing"> /// アンマネージ リソースとマネージ リソースの両方を解放する場合は true。アンマネージ /// リソースのみ解放する場合は false。 /// </param> protected override void Dispose(bool disposing) { if (this.disposed != true) { if (disposing == true) { this.viewModel = null; } } this.disposed = true; }
public SettingsTab() { this.InitializeComponent(); GoBack += () => ContentPage.GoBack(); Data = Service.Services.GetRequiredService <SettingsPageViewModel>(); DispatcherTimer = new DispatcherTimer(); DispatcherTimer.Tick += DispatcherTimer_Tick; DispatcherTimer.Interval = new TimeSpan(0, 0, 5); DispatcherTimer.Start(); }
public SettingsPage(Action<EC.Model.MenuItem> navigate ) { BindingContext = viewModel = new SettingsPageViewModel(); Style = AppStyle.SettingsPageStyle; var pageTitle = new ContentView() { Style = AppStyle.PageTitleLabelFrameStyle, Padding = new Thickness(10, Device.OnPlatform(15,20, 0),0, 10), Content = new Label { Style = AppStyle.PageTitleLabelStyle, Text = "En la Cancha", }, BackgroundColor = Color.FromHex(Constants.PrimaryColor), }; var signoutButton = new Button() { VerticalOptions = LayoutOptions.EndAndExpand, HorizontalOptions = LayoutOptions.Center, Text = "Salir", TextColor = AppStyle.DarkLabelColor, }; var menu = new MenuView(navigate); var container = new StackLayout { Style = AppStyle.DefaultStack, Padding = new Thickness(0), Children = { pageTitle, //new BoxView() { // HeightRequest = 5, // BackgroundColor = Color.Black, //}, new StackLayout() { Style= AppStyle.DefaultStack, BackgroundColor = Color.Transparent, Padding = new Thickness(5), Children= { new SettingsUserView(), //new SyncView (), //new SettingsSwitchView ("GPS"), //new SettingsSwitchView ("Notificaciones"), } }, new StackLayout() { Style = AppStyle.DefaultStack, BackgroundColor = Color.Transparent, Children = { menu, } }, signoutButton, new StatusBarView() } }; Content = new ScrollView() { Content = container }; }
private void LoadSettingsPage() { CurrentViewModel = new SettingsPageViewModel( new SettingsPage() { PageTitle = "This is the Settings Page." }); }