Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bec2141
commit f3ba539
Showing
3 changed files
with
53 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,31 +1,46 @@ | |||
namespace GameOfLifeMvu | namespace GameOfLifeMvu | ||
|
|
||
open Avalonia | open Avalonia | ||
open Avalonia.Controls.ApplicationLifetimes | |||
open Avalonia.FuncUI | |||
open Avalonia.Themes.Fluent | open Avalonia.Themes.Fluent | ||
open Elmish | |||
open Avalonia.FuncUI.Hosts | |||
open Avalonia.FuncUI | |||
open Avalonia.FuncUI.Elmish | |||
open Avalonia.Controls.ApplicationLifetimes | |||
|
|||
type MainWindow() as this = | |||
inherit HostWindow() | |||
do | |||
base.Title <- "Game of Life" | |||
base.Width <- 800.0 | |||
base.Height <- 1000.0 | |||
base.MinWidth <- 800.0 | |||
base.MinHeight <- 1000.0 | |||
|
|
||
Elmish.Program.mkProgram Shell.init Shell.update Shell.view | |||
|> Program.withHost this | |||
|> Program.run | |||
|
|
||
/// This is your application you can ose the initialize method to load styles | |||
/// or handle Life Cycle events of your application | |||
type App() = | type App() = | ||
inherit Application() | inherit Application() | ||
|
|
||
override this.Initialize() = | override this.Initialize() = | ||
this.Styles.Add (FluentTheme(baseUri = null, Mode = FluentThemeMode.Dark)) | this.Styles.Add (FluentTheme()) | ||
this.Styles.Load "avares://GameOfLifeMvu/Styles.xaml" | this.RequestedThemeVariant <- Styling.ThemeVariant.Dark | ||
|
|
||
override this.OnFrameworkInitializationCompleted() = | override this.OnFrameworkInitializationCompleted() = | ||
match this.ApplicationLifetime with | match this.ApplicationLifetime with | ||
| :? IClassicDesktopStyleApplicationLifetime as desktopLifetime -> | | :? IClassicDesktopStyleApplicationLifetime as desktopLifetime -> | ||
desktopLifetime.MainWindow <- Shell.MainWindow() | let mainWindow = MainWindow() | ||
desktopLifetime.MainWindow <- mainWindow | |||
| _ -> () | | _ -> () | ||
|
|
||
module Program = | module Program = | ||
|
|
||
[<EntryPoint>] | [<EntryPoint>] | ||
let main (args: string []) = | let main(args: string[]) = | ||
AppBuilder.Configure<App>() | AppBuilder | ||
.Configure<App>() | |||
.UsePlatformDetect() | .UsePlatformDetect() | ||
.UseSkia() | .UseSkia() | ||
.StartWithClassicDesktopLifetime(args) | .StartWithClassicDesktopLifetime(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters