diff --git a/Emne 3/MyApp/App.axaml b/Emne 3/MyApp/App.axaml new file mode 100644 index 0000000..c986774 --- /dev/null +++ b/Emne 3/MyApp/App.axaml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/Emne 3/MyApp/App.axaml.cs b/Emne 3/MyApp/App.axaml.cs new file mode 100644 index 0000000..0bd49a2 --- /dev/null +++ b/Emne 3/MyApp/App.axaml.cs @@ -0,0 +1,23 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; + +namespace MyApp; + +public partial class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = new MainWindow(); + } + + base.OnFrameworkInitializationCompleted(); + } +} \ No newline at end of file diff --git a/Emne 3/MyApp/MainWindow.axaml b/Emne 3/MyApp/MainWindow.axaml new file mode 100644 index 0000000..d664ac7 --- /dev/null +++ b/Emne 3/MyApp/MainWindow.axaml @@ -0,0 +1,9 @@ + + Welcome to Avalonia! + diff --git a/Emne 3/MyApp/MainWindow.axaml.cs b/Emne 3/MyApp/MainWindow.axaml.cs new file mode 100644 index 0000000..519ad9f --- /dev/null +++ b/Emne 3/MyApp/MainWindow.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace MyApp; + +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Emne 3/MyApp/MyApp.csproj b/Emne 3/MyApp/MyApp.csproj new file mode 100644 index 0000000..1f68fc7 --- /dev/null +++ b/Emne 3/MyApp/MyApp.csproj @@ -0,0 +1,22 @@ + + + WinExe + net9.0 + enable + true + app.manifest + true + + + + + + + + + + None + All + + + diff --git a/Emne 3/MyApp/Program.cs b/Emne 3/MyApp/Program.cs new file mode 100644 index 0000000..dd1f2a5 --- /dev/null +++ b/Emne 3/MyApp/Program.cs @@ -0,0 +1,21 @@ +using Avalonia; +using System; + +namespace MyApp; + +class Program +{ + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) => BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace(); +} diff --git a/Emne 3/MyApp/app.manifest b/Emne 3/MyApp/app.manifest new file mode 100644 index 0000000..2c92203 --- /dev/null +++ b/Emne 3/MyApp/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/Emne 3/shell.nix b/Emne 3/shell.nix.bak similarity index 99% rename from Emne 3/shell.nix rename to Emne 3/shell.nix.bak index 19bd266..bea35b0 100644 --- a/Emne 3/shell.nix +++ b/Emne 3/shell.nix.bak @@ -11,4 +11,4 @@ mkShell { csharp-ls avalonia ]; -} +} \ No newline at end of file