public MainPage() { InitializeComponent(); ViewModel = new MainPageVM(); GuestName.Text = ViewModel.GetGuestByBarcode("123456"); }
public MainPage() { this.InitializeComponent(); HamburgerMenuDisplayMode = SplitViewDisplayMode.CompactOverlay; DataContext = ViewModel = new MainPageVM(); }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(new System.Windows.DependencyObject())) { return; } #if DEBUG this._model.OnFormLoaded(); this._model.Compose(); this.DataContext = this._model; FrameworkElement p = this.Parent as FrameworkElement; while (!(p is MainWindow)) { p = p.Parent as FrameworkElement; } p.DataContext = this._model; #else _model = new MainPageVM(); Task task = Task.Run(() => { this._model.OnFormLoaded(); this._model.Compose(); this.DataContext = this._model; }); #endif }
public MainPage(IWifiManagerOperations mgr, MainPageVM vm) { InitializeComponent(); this.mgr = mgr; vm.AddMgr(mgr); this.BindingContext = vm; }
private void SetbindingContext() { if (this.GetType() == typeof(MainPage)) { BindingContext = new MainPageVM(); } else if (this.GetType() == typeof(LoginPage)) { BindingContext = new LoginPageVM(); } else if (this.GetType() == typeof(RegisterPage)) { BindingContext = new RegisterPageVM(); } else if (this.GetType() == typeof(AddPet)) { BindingContext = new AddPetVM(); } else if (this.GetType() == typeof(PetsPage)) { BindingContext = new PetsPageVM(); } else if (this.GetType() == typeof(MainDetails)) { BindingContext = new MainDetailsVM(); } }
public MainPage() { this.InitializeComponent(); _navigationHandler = NavigationHandler.Instance; _navigationHandler.SetNavigationFrame(MainFrame); _mainPageVM = DataContext as MainPageVM; }
public MainPage() { InitializeComponent(); //Set the main page viewmodel . Defined in ViewModels/MainPageVM _ViewModel = new MainPageVM(); BindingContext = _ViewModel; }
void Exec(string connStringName, Action <Config> configCreation, Action <DatabaseModel> assert) { MainPageVM vm = new MainPageVM(false, (mvm, dbs) => { foreach (var t in dbs) { if (t.Value is IvPluginDbGenerator) { var tt = t.Value as IvPluginDbGenerator; if (tt.Name == connStringName) { //mvm.SelectedDbDesignPlugin = tt; } } } if (mvm.SelectedDbDesignPlugin == null) { throw new ArgumentException(); } var cfg = mvm.Config; configCreation(cfg); //mvm.SelectedDbDesignPlugin.ConnectionString = mvm.ConnectionString; //var model = mvm.GetEfModel(); //// Migrate DB //mvm.SelectedDbDesignPlugin.UpdateToModel(model); //var m = mvm.SelectedDbDesignPlugin.GetDbModel(new List<string>(), new List<string>()); //assert(m); }); }
public MainPage() : base() { InitializeComponent(); base.Initialize(); // It is the first launch of the app if this key doesn't exist. Otherwise we are returning // to the main page after tombstoning and showing the splash screen looks bad if (PhoneApplicationService.Current.State.ContainsKey("ShowLoadingSplash") == false) { ShowLoadingSplash(); } viewModel = aViewModel as MainPageVM; firstLoad = true; navigatedAway = false; navigationLock = new Object(); this.Loaded += new RoutedEventHandler(MainPage_Loaded); SupportedOrientations = SupportedPageOrientation.Portrait; this.ApplicationBar.ForegroundColor = ((SolidColorBrush)Application.Current.Resources["OBAForegroundBrush"]).Color; // the native theme uses a shade of "gray" that is actually white or black with an alpha mask. // the appbar needs to be opaque. ColorAlphaConverter alphaConverter = new ColorAlphaConverter(); SolidColorBrush appBarBrush = (SolidColorBrush)alphaConverter.Convert( Application.Current.Resources["OBADarkBrush"], typeof(SolidColorBrush), Application.Current.Resources["OBABackgroundBrush"], null ); this.ApplicationBar.BackgroundColor = appBarBrush.Color; }
protected void OnLoad(object sender, RoutedEventArgs e) { TryCatchMessageTask(() => { DataContext = pageModel = new MainPageVM(this); }); }
public void Db006_MigrateDataWhenApplyNewDbStructure() { MainPageVM mvm = null; Execute((vm) => { mvm = vm; vm.Config.Model.GroupConstants.AddConstant("tinyint", new DataType() { DataTypeEnum = EnumDataType.NUMERICAL, IsPositive = true, Length = 2, IsNullable = false }); vm.Config.Model.GroupConstants.AddConstant("smallint", new DataType() { DataTypeEnum = EnumDataType.NUMERICAL, IsPositive = true, Length = 4, IsNullable = false }); vm.Config.Model.GroupConstants.AddConstant("int", new DataType() { DataTypeEnum = EnumDataType.NUMERICAL, IsPositive = true, Length = 9, IsNullable = false }); vm.Config.Model.GroupConstants.AddConstant("bigint", new DataType() { DataTypeEnum = EnumDataType.NUMERICAL, IsPositive = true, Length = 18, IsNullable = false }); vm.Config.Model.GroupConstants.AddConstant("nvarchar", new DataType() { DataTypeEnum = EnumDataType.STRING, IsNullable = false, Length = 0 }); }, (conn) => { conn.Execute(""); }); }
/// <summary> /// Initialize VM and set the DataContext. /// </summary> /// <param name="e"></param> protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); var vm = new MainPageVM(Dispatcher); DataContext = vm; }
public MainPage() { InitializeComponent(); _viewModel = DataContext as MainPageVM; SetBackground(); }
public App() { InitializeComponent(); AudioPlayerPageVM audioPlayerPageVM = new AudioPlayerPageVM(); AudioLibPageVM audioLibPageVM = new AudioLibPageVM(); ModesPageVM modesPageVM = new ModesPageVM(); SettingsPageVM settingsPageVM = new SettingsPageVM(); AddSongPageVM addSongPageVM = new AddSongPageVM(); MainPageVM mainPageVM = new MainPageVM(); AudioPlayerPage audioPlayerPage = new AudioPlayerPage(audioPlayerPageVM); AudioLibPage audioLibPage = new AudioLibPage(audioLibPageVM); ModesPage modesPage = new ModesPage(modesPageVM); SettingsPage settingsPage = new SettingsPage(settingsPageVM); AddSongPage addSongPage = new AddSongPage(addSongPageVM); MainPage mainPage = new MainPage(mainPageVM); ContentPage[] pages = { audioPlayerPage, audioLibPage, modesPage, settingsPage, addSongPage, mainPage }; NavigationHandler.SingletonNavHandler.SetPages(pages); MainPage = new AnimationNavigationPage(mainPage); GetPermissions(); }
public MainPage() { InitializeComponent(); viewModel = new MainPageVM(); BindingContext = viewModel; }
public void Property001_Position() { var mvm = new MainPageVM(false); mvm.OnFormLoaded(); mvm.Compose(MainPageVM.GetvSharpStudioPluginsPath()); var cfg = mvm.Config; int catPos = 13; cfg.Model.GroupCatalogs.NodeAddNewSubNode(); cfg.Model.GroupCatalogs[0].GroupProperties.NodeAddNewSubNode(); Assert.IsTrue(cfg.Model.GroupCatalogs[0].GroupProperties[0].Position == catPos); Assert.IsTrue(cfg.Model.GroupCatalogs[0].GroupProperties.LastGenPosition == catPos); cfg.Model.GroupCatalogs[0].GroupProperties.NodeAddNewSubNode(); catPos++; Assert.IsTrue(cfg.Model.GroupCatalogs[0].GroupProperties[1].Position == catPos); Assert.IsTrue(cfg.Model.GroupCatalogs[0].GroupProperties.LastGenPosition == catPos); cfg.Model.GroupCatalogs[0].GroupProperties[0].NodeRemove(); Assert.IsTrue(cfg.Model.GroupCatalogs[0].GroupProperties[0].Position == catPos); Assert.IsTrue(cfg.Model.GroupCatalogs[0].GroupProperties.LastGenPosition == catPos); cfg.Model.GroupCatalogs[0].GroupProperties[0].NodeAddNew(); catPos++; Assert.IsTrue(cfg.Model.GroupCatalogs[0].GroupProperties[1].Position == catPos); Assert.IsTrue(cfg.Model.GroupCatalogs[0].GroupProperties.LastGenPosition == catPos); }
public void Editable021CanCancelCatalogPropertiy() { var mvm = new MainPageVM(false); mvm.OnFormLoaded(); mvm.Compose(MainPageVM.GetvSharpStudioPluginsPath()); var cfg = mvm.Config; Catalog vm = cfg.Model.GroupCatalogs.AddCatalog(); vm.BeginEdit(); vm.GroupProperties.AddProperty("pdouble0", EnumDataType.NUMERICAL, 10, 0); vm.CancelEdit(); Assert.IsTrue(vm.GroupProperties.Count() == 0); vm.GroupProperties.AddProperty("pdouble0", EnumDataType.NUMERICAL, 10, 0); vm.BeginEdit(); vm.GroupProperties[0].DataType.DataTypeEnum = EnumDataType.STRING; vm.CancelEdit(); Assert.IsTrue(vm.GroupProperties.Count() == 1); Assert.IsTrue(vm.GroupProperties[0].DataType.DataTypeEnum == EnumDataType.NUMERICAL); vm.BeginEdit(); vm.GroupProperties.ListProperties.Clear(); vm.CancelEdit(); Assert.IsTrue(vm.GroupProperties.Count() == 1); Assert.IsTrue(vm.GroupProperties[0].DataType.DataTypeEnum == EnumDataType.NUMERICAL); }
public App() { InitializeComponent(); NavigationHandler handler = new NavigationHandler(); AudioPlayerPageVM audioPlayerPageVM = new AudioPlayerPageVM(); AudioLibPageVM audioLibPageVM = new AudioLibPageVM(handler); ConnectionPageVM connectionPageVM = new ConnectionPageVM(handler); ModesPageVM modesPageVM = new ModesPageVM(); SettingsPageVM settingsPageVM = new SettingsPageVM(); AddSongPageVM addSongPageVM = new AddSongPageVM(handler); MainPageVM mainPageVM = new MainPageVM(handler); AudioPlayerPage audioPlayerPage = new AudioPlayerPage(audioPlayerPageVM); AudioLibPage audioLibPage = new AudioLibPage(audioLibPageVM); ConnectionPage connectionPage = new ConnectionPage(connectionPageVM); ModesPage modesPage = new ModesPage(modesPageVM); SettingsPage settingsPage = new SettingsPage(settingsPageVM); AddSongPage addSongPage = new AddSongPage(addSongPageVM); MainPage mainPage = new MainPage(mainPageVM); ContentPage[] pages = { audioPlayerPage, audioLibPage, connectionPage, modesPage, settingsPage, addSongPage, mainPage }; handler.SetPages(pages); MainPage = new NavigationPage(mainPage); }
public MainPage() { InitializeComponent(); VM = new MainPageVM(); VM.Init(); this.DataContext = VM; }
public MainPage() { InitializeComponent(); var dataService = ServiceLocator.Current.GetInstance<IDataService>(); var navigationService = new NavigationService(Navigation); var lists = dataService.GetLists(); BindingContext = new MainPageVM(lists, navigationService); }
private MainPageVM CreateModel1() { var vm = new MainPageVM(false); //vm.Model.GroupCatalogs. return(vm); }
public MainPage() { this.InitializeComponent(); this.ViewModel = new MainPageVM(); //VersiĆ³n de Fernando //this.ViewModel = (MainPageVM)this.DataContext; }
protected override void OnNavigatedTo(NavigationEventArgs e) { MainPageVM mainPageVM = (MainPageVM)this.DataContext; mainPageVM.NavigationService = this.NavigationService; ServiceLocator.AddService <NavigationService>(this.NavigationService); mainPageVM.OnPropertyChanged("LoginStatus"); base.OnNavigatedTo(e); }
public MainPage() { InitializeComponent(); VM = new MainPageVM(); VM.PropertyChanged += VM_PropertyChanged; Window.Current.Activated += Window_Activated; }
public MainPage() { InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); var gameService = new GameHubProxy(); BindingContext = new MainPageVM(gameService); }
protected override void OnNavigatedFrom(NavigationEventArgs e) { if (e.Uri.OriginalString.Equals("/Pages/LoginDetailsPage.xaml")) { MainPageVM mainPageVM = this.DataContext as MainPageVM; mainPageVM.OnPropertyChanged("LoginStatus"); } base.OnNavigatedFrom(e); }
public App() { InitializeComponent(); var p = new MainPage(); var vm = new MainPageVM(); p.BindingContext = vm; MainPage = new NavigationPage(p); }
public MainPage(MainWindow window) { InitializeComponent(); this._window = window; this._vm = new MainPageVM(); this.DataContext = this._vm; this.Loaded += MainPage_Loaded; }
public MainPage() { InitializeComponent(); MainPageVM = new MainPageVM(); BindingContext = MainPageVM; //var device = DeviceInfo.Model; }
public App() { InitializeComponent(); //MainPage = new NavigationPage(new MainPage()); (Application.Current as App).NavigationPage = new NavigationPage(new MainPage()); // Declare NavigationPage in App.cs Application.Current.MainPage = NavigationPage; InputPageVM = new InputPageVM(); MainPageVM = new MainPageVM(); }
public MainPage() { this.InitializeComponent(); this.MainPageVm = (MainPageVM)this.DataContext; for (int i = 0; i < MainPageVm.diferencias.Count; i++) { canvas.Children.Add(MainPageVm.diferencias.ElementAt(i).ellipse); } }