public LogInViewModel() { EmployeeCatalog = new EmployeeCatalog(); Employees = new Employee(); AddItemCommand = new RelayCommand(DoLogInUser); _frameNavigation = new FrameNavigation(); }
public async void Login(object s) { try { UserCatalog UserCatalog = new UserCatalog(); if (UserCatalog != null) { foreach (var user in UserCatalog.Users) { if (user.AdminCpr.Trim() == AdminCpr.Trim() && user.Password.Trim() == Password.Trim()) { Type typeProfile = typeof(NewsView); FrameNavigation.ActivateFrameNavigation(typeProfile); AllowLogin = true; break; } } if (AllowLogin == false) { var dialog = new MessageDialog("Wrong email or password!"); await dialog.ShowAsync(); } } } catch (Exception) { } }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override async void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (Debugger.IsAttached) { DebugSettings.EnableFrameRateCounter = true; } #endif var rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { NavigationHelper.Register<PageStates, MainPage>(PageStates.Main); NavigationHelper.Register<PageStates, SecondPage>(PageStates.Second); NavigationHelper.Register<PageStates, ThirdPage>(PageStates.Third); NavigationHelper.Register<SecondaryStates, SeparatePage>(SecondaryStates.Main); var core = new SampleApplication(); await core.Startup(builder => { builder.RegisterType<Special>().As<ISpecial>(); }); var region = core.RegionManager.RegionByType<MainWindow>(); var fn = new FrameNavigation<PageStates, PageTransitions>(rootFrame, region); await region.Startup(core.RegionManager); var wm = new WindowManager(core); // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter //rootFrame.Navigate(typeof(MainPage), e.Arguments); } // Ensure the current window is active Window.Current.Activate(); }
public void CreateReceipt(object s) { ReceiptViewModel rvm = new ReceiptViewModel(); //rvm.PassCollection(SelectedMedicines); Type type = typeof(ReceiptView); FrameNavigation.ActivateFrameNavigation(type); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); var frame = Split.FindName("InnerFrame") as Frame; var fn = new FrameNavigation<ThirdStates>(frame, CurrentViewModel.StateManager.StateGroups[typeof(ThirdStates)] as INotifyStateChanged<ThirdStates>); await CurrentViewModel.Start(); }
private static void SetupNavigation() { var navigationService = new FrameNavigation(); navigationService.Configure("Home", new Uri("../Pages/Home.xaml", UriKind.Relative)); navigationService.Configure("Page1", new Uri("../Pages/Page1.xaml", UriKind.Relative)); //navigationService.Configure("Page2", new Uri("../Pages/Page2.xaml", UriKind.Relative)); SimpleIoc.Default.Register <IFrameNavigation>(() => navigationService); }
public void Register(object s) { PatientCatalog PatientCatalog = new PatientCatalog(); PatientCatalog.GetData(Patient); PatientCatalog.Post(); Type type = typeof(PatientListView); FrameNavigation.ActivateFrameNavigation(type); }
public void Booking(object s) { AppointmentCatalog AppointmentCatalog = new AppointmentCatalog(); AppointmentCatalog.GetData(Appointment); AppointmentCatalog.Post(); Type type = typeof(NewsView); FrameNavigation.ActivateFrameNavigation(type); }
public void Register(object s) { DoctorCatalog DoctorCatalog = new DoctorCatalog(); DoctorCatalog.GetData(Doctor); DoctorCatalog.Post(); Type type = typeof(NewsView); FrameNavigation.ActivateFrameNavigation(type); }
public void Register(object s) { MedicineCatalog MedicineCatalog = new MedicineCatalog(); MedicineCatalog.GetData(Medicine); MedicineCatalog.Post(); Type type = typeof(NewsView); FrameNavigation.ActivateFrameNavigation(type); }
public void Register(object s) { UserCatalog UserCatalog = new UserCatalog(); UserCatalog.GetData(User); UserCatalog.Post(); Type type = typeof(LoginView); FrameNavigation.ActivateFrameNavigation(type); }
protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); var frame = Split.FindName("InnerFrame") as Frame; var fn = new FrameNavigation<ThirdStates, ThirdTransitions>(frame, CurrentViewModel); NavigationHelper.Register<ThirdStates,ThrirdOnePage>(ThirdStates.One); NavigationHelper.Register<ThirdStates,ThirdTwoPage>(ThirdStates.Two); NavigationHelper.Register<ThirdStates,ThirdThreePage>(ThirdStates.Three); NavigationHelper.Register<ThirdStates,ThirdFourPage>(ThirdStates.Four); await CurrentViewModel.Start(); }
public void ShowListOfPatient(object s) { Type type = typeof(PatientListView); FrameNavigation.ActivateFrameNavigation(type); }
public void LogOut(object s) { Type type = typeof(LoginView); FrameNavigation.ActivateFrameNavigation(type); }
public void ShowCustomerLandingPageView(object s) { FrameNavigation.ActivateFrameNavigation(typeof(CustomerLandingPage)); }
public void AppointmentView(object s) { Type type = typeof(NewsView); FrameNavigation.ActivateFrameNavigation(type); }
public void ShowResetAccountView(object s) { FrameNavigation.ActivateFrameNavigation(typeof(ForgetPasswordPage)); }
public void ShowNewsView(object s) { Type type = typeof(NewsView); FrameNavigation.ActivateFrameNavigation(type); }
public void ShowAppointmentBookingView(object s) { Type type = typeof(AppointmentBookingView); FrameNavigation.ActivateFrameNavigation(type); }
//was supposed to be async but duuno where to put await xD public void ShowCreateAccount(object s) { Type type = typeof(CreateAccountView); FrameNavigation.ActivateFrameNavigation(type); }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used when the application is launched to open a specific file, to display /// search results, and so forth. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override async void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { this.DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); // TODO: change this value to a cache size that is appropriate for your application rootFrame.CacheSize = 1; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { // TODO: Load state from previously suspended application } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { var core = new SampleApplication(); var fn = new FrameNavigation<PageStates, PageTransitions>(rootFrame, core); fn.Register<MainPage>(PageStates.Main); fn.Register<SecondPage>(PageStates.Second); fn.Register<ThirdPage>(PageStates.Third); await core.Startup(); //#if WINDOWS_PHONE_APP // // Removes the turnstile navigation for startup. // if (rootFrame.ContentTransitions != null) // { // this.transitions = new TransitionCollection(); // foreach (var c in rootFrame.ContentTransitions) // { // this.transitions.Add(c); // } // } // rootFrame.ContentTransitions = null; // rootFrame.Navigated += this.RootFrame_FirstNavigated; //#endif // // When the navigation stack isn't restored navigate to the first page, // // configuring the new page by passing required information as a navigation // // parameter // if (!rootFrame.Navigate(typeof(MainPage), e.Arguments)) // { // throw new Exception("Failed to create initial page"); // } } // Ensure the current window is active Window.Current.Activate(); }
public void ShowLoginView(object s) { FrameNavigation.ActivateFrameNavigation(typeof(LoginPage)); }