1
0
mirror of https://github.com/SirLecram/HospitalServerManager synced 2024-10-19 00:45:36 +02:00
admissionManager/View/MainFrameView.xaml.cs
Marcel Grześ 069f0612da Basic function development
A few models has been improved;
New pages has been added; NewRecordDialog has been added;
ViewNavigator was created; A type providers has been added; new interfaces has been added; New validator, which checks if interface is implemented has been added;
The application can read data and add new record by API now.
2018-12-29 11:58:25 +01:00

63 lines
2.2 KiB
C#

using HospitalServerManager.InterfacesAndEnums;
using HospitalServerManager.ViewModel.Controllers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
//Szablon elementu Pusta strona jest udokumentowany na stronie https://go.microsoft.com/fwlink/?LinkId=234238
namespace HospitalServerManager.View
{
/// <summary>
/// Pusta strona, która może być używana samodzielnie lub do której można nawigować wewnątrz ramki.
/// </summary>
public sealed partial class MainFrameView : Page
{
private INavigator Navigator { get; set; }
private IProvideType TypeProvider { get; set; }
public MainFrameView()
{
this.InitializeComponent();
InitializeProperties();
}
private void AppBarButton_Click(object sender, RoutedEventArgs e)
{
string pageTypeName = (sender as AppBarButton).Tag.ToString();
Type pageType = TypeProvider.GetTypeFromString(pageTypeName);
IPageNavigateable page = Navigator.ChangeFrame(pageType, mainFrame);
//mainFrame.Navigate(typeof(PatientsPage), new HospitalServerManager.ViewModel.Controllers.DatabaseReader());
//Frame.Navigate(typeof(PatientsPage));
}
private void InitializeProperties()
{
IValidateIfInterfaceIsImplemented validator = new ViewModel.Validators.InterfaceImplementValidator();
//mainFrame.Content = new AdmissionsPage();
Navigator = new ViewNavigator(validator, /*mainFrame.Content as IPageNavigateable*/new PatientsPage());
//Navigator.SetParameter(controler);
// TODO: Dodać pozostałe Page
TypeProvider = new ViewModel.DataProvider.NavigationPageTypeProvider(validator,
new List<Type>
{
typeof(PatientsPage), typeof(DoctorsPage),
});
Type pageType = TypeProvider.GetTypeFromString("PatientsPage");
Navigator.ChangeFrame(pageType, mainFrame);
/*Type type = typeof(Model.Patient);
type.In*/
}
}
}