1
0
mirror of https://github.com/SirLecram/HospitalServerManager synced 2024-07-17 18:30:30 +02:00
admissionManager/View/MainFrameView.xaml.cs

56 lines
1.9 KiB
C#
Raw Normal View History

using HospitalServerManager.InterfacesAndEnums;
using HospitalServerManager.ViewModel.Controllers;
using System;
2018-11-18 18:49:40 +01:00
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
{
/// WebService powinien byc chyba wlasciwoscia w roznych kontrolerach np. GetController/PutController itp.
2018-11-18 18:49:40 +01:00
public sealed partial class MainFrameView : Page
{
private INavigator Navigator { get; set; }
private IProvideType TypeProvider { get; set; }
public MainFrameView()
2018-11-18 18:49:40 +01:00
{
this.InitializeComponent();
InitializeProperties();
2018-11-18 18:49:40 +01:00
}
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);
2018-11-18 18:49:40 +01:00
}
private void InitializeProperties()
{
IValidateIfInterfaceIsImplemented validator = new ViewModel.Validators.InterfaceImplementValidator();
Navigator = new ViewNavigator(validator, new PatientsPage());
// TODO: Dodać pozostałe Page
TypeProvider = new ViewModel.DataProvider.NavigationPageTypeProvider(validator,
new List<Type>
{
typeof(PatientsPage), typeof(DoctorsPage), typeof(AdmissionsPage), typeof(DiagnosesPage),
typeof(RoomsPage),
});
Type pageType = TypeProvider.GetTypeFromString("AdmissionsPage");
Navigator.ChangeFrame(pageType, mainFrame);
}
}
2018-11-18 18:49:40 +01:00
}