diff --git a/MCTG/Views/App.xaml.cs b/MCTG/Views/App.xaml.cs index 0ae3fef..be9eef9 100644 --- a/MCTG/Views/App.xaml.cs +++ b/MCTG/Views/App.xaml.cs @@ -1,44 +1,44 @@ -#if WINDOWS -using Microsoft.UI; -using Microsoft.UI.Windowing; -using Windows.Graphics; -#endif - -using DataPersistence; +#if WINDOWS +using Microsoft.UI; +using Microsoft.UI.Windowing; +using Windows.Graphics; +#endif + +using DataPersistence; using Model; -namespace Views -{ - public partial class App : Application - { - public DataManager DataMgr { get; private set; } = new DataManager(new Stubs()); - public User user { get; set; } - const int WindowWidth = 1200; - const int WindowHeight = 800; - - public App() +namespace Views +{ + public partial class App : Application + { + public DataManager DataMgr { get; private set; } = new DataManager(new Stubs()); + public User user { get; set; } + const int WindowWidth = 1200; + const int WindowHeight = 800; + + public App() { - user = DataMgr.Data[nameof(User)].Cast().Last(); - InitializeComponent(); - - Microsoft.Maui.Handlers.WindowHandler.Mapper.AppendToMapping(nameof(IWindow), (handler, view) => - { -#if WINDOWS - var mauiWindow = handler.VirtualView; - var nativeWindow = handler.PlatformView; - nativeWindow.Activate(); - IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(nativeWindow); - WindowId windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(windowHandle); - AppWindow appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId); - appWindow.Resize(new SizeInt32(WindowWidth, WindowHeight)); -#endif - }); - - - /* - Comment(ctrl-k + ctrl-c)/Uncomment(ctrl-k + ctrl-u) to change page - */ - UserAppTheme = AppTheme.Light; - MainPage = new MyProfil(); - //MainPage = new MyPosts(); - } - } -} + user = DataMgr.Data[nameof(User)].Cast().Last(); + InitializeComponent(); + + Microsoft.Maui.Handlers.WindowHandler.Mapper.AppendToMapping(nameof(IWindow), (handler, view) => + { +#if WINDOWS + var mauiWindow = handler.VirtualView; + var nativeWindow = handler.PlatformView; + nativeWindow.Activate(); + IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(nativeWindow); + WindowId windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(windowHandle); + AppWindow appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId); + appWindow.Resize(new SizeInt32(WindowWidth, WindowHeight)); +#endif + }); + + + /* - Comment(ctrl-k + ctrl-c)/Uncomment(ctrl-k + ctrl-u) to change page - */ + UserAppTheme = AppTheme.Light; + MainPage = new AddRecipe(); + //MainPage = new MyPosts(); + } + } +} diff --git a/MCTG/Views/ContainerFlyout.xaml.cs b/MCTG/Views/ContainerFlyout.xaml.cs index 6fcb273..09e2b29 100644 --- a/MCTG/Views/ContainerFlyout.xaml.cs +++ b/MCTG/Views/ContainerFlyout.xaml.cs @@ -1,49 +1,49 @@ -using DataPersistence; -using Model; - -namespace Views; - -public partial class ContainerFlyout : ContentView -{ +using DataPersistence; +using Model; + +namespace Views; + +public partial class ContainerFlyout : ContentView +{ public DataManager DataMgr => (App.Current as App).DataMgr; - public User user => (App.Current as App).user; - - - public ContainerFlyout() + public User user => (App.Current as App).user; + + + public ContainerFlyout() { InitializeComponent(); BindingContext = this; - - - } - - // Bind MyFlyoutContent - public static readonly BindableProperty MyFlyoutContentProperty = - BindableProperty.Create("MyFlyoutContent", typeof(View), typeof(ContainerFlyout), new Grid()); - - public View MyFlyoutContent - { - get => (View)GetValue(MyFlyoutContentProperty); - set => SetValue(MyFlyoutContentProperty, value); - } - - // Bind IsNotConnected - public static readonly BindableProperty IsNotConnectedProperty = - BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), true); - - public bool IsNotConnected - { - get => (bool)GetValue(IsNotConnectedProperty); - set => SetValue(IsNotConnectedProperty, value); - } - - // bind NeedReturn - public static readonly BindableProperty NeedReturnProperty = - BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false); - - public bool NeedReturn - { - get => (bool)GetValue(NeedReturnProperty); - set => SetValue(NeedReturnProperty, value); - } -} + + + } + + // Bind MyFlyoutContent + public static readonly BindableProperty MyFlyoutContentProperty = + BindableProperty.Create("MyFlyoutContent", typeof(View), typeof(ContainerFlyout), new Grid()); + + public View MyFlyoutContent + { + get => (View)GetValue(MyFlyoutContentProperty); + set => SetValue(MyFlyoutContentProperty, value); + } + + // Bind IsNotConnected + public static readonly BindableProperty IsNotConnectedProperty = + BindableProperty.Create("IsNotConnected", typeof(bool), typeof(Button), true); + + public bool IsNotConnected + { + get => (bool)GetValue(IsNotConnectedProperty); + set => SetValue(IsNotConnectedProperty, value); + } + + // bind NeedReturn + public static readonly BindableProperty NeedReturnProperty = + BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false); + + public bool NeedReturn + { + get => (bool)GetValue(NeedReturnProperty); + set => SetValue(NeedReturnProperty, value); + } +} diff --git a/MCTG/Views/MyProfil.xaml b/MCTG/Views/MyProfil.xaml index a51bc9c..e40d9dc 100644 --- a/MCTG/Views/MyProfil.xaml +++ b/MCTG/Views/MyProfil.xaml @@ -14,8 +14,8 @@ -