-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.xaml.cs
67 lines (59 loc) · 2.04 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using Essensausgleich.ViewModel;
#if WINDOWS
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Windows.Graphics;
#endif
namespace Essensausgleich
{/// <summary>
/// App.xaml.cs
/// </summary>
public partial class App : Application
{
const int WindowWidth = 380;
const int WindowHeight = 620;
/// <summary>
/// Public App
/// </summary>
public App()
{
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
});
MainPage = new AppShell();
}
/// <summary>
/// ViewModel
/// </summary>
public static Anwendung ViewModelAnwendung { get; set; } = null!;
/// <summary>
/// Stellt den Context für die APPobjekte bereit glaub ich
/// </summary>
public Essensausgleich.Infra.Infrastructur Context
{ get; set; } = null!;
/// <summary>
/// Overrides the Statup process and starts my infrastracture
/// </summary>
protected override void OnStart()
{
base.OnStart();
/*
this.Context = new Essensausgleich.Infra.Infrastructur();
//Das View Model Initialisieren
ViewModelAnwendung = this.Context.Fabricate<ViewModel.Anwendung>();
ViewModelAnwendung.Initialize();
//Log.WriteLine("FilesystemManager Init");
*/
}
}
}