Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split mvu and component #66

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Fabulous.MauiControls.sln
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ComponentNavigation", "samp
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Calculator", "samples\Calculator\Calculator.fsproj", "{E24F96A8-B1FF-45AA-A7D9-379F3F88F422}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fabulous", "..\Fabulous\src\Fabulous\Fabulous.fsproj", "{DBF01E7E-7733-42CD-8AB5-A31D1B96A6CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -140,6 +142,10 @@ Global
{66532A61-1BB8-4BD1-A281-A160ABB0EFE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66532A61-1BB8-4BD1-A281-A160ABB0EFE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66532A61-1BB8-4BD1-A281-A160ABB0EFE7}.Release|Any CPU.Build.0 = Release|Any CPU
{DBF01E7E-7733-42CD-8AB5-A31D1B96A6CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DBF01E7E-7733-42CD-8AB5-A31D1B96A6CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DBF01E7E-7733-42CD-8AB5-A31D1B96A6CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DBF01E7E-7733-42CD-8AB5-A31D1B96A6CE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{67FB01A1-1A3E-4A3B-83DC-7D63B56FB1A1} = {35A6823C-8312-4F92-818A-5117BB31A569}
Expand Down
5 changes: 3 additions & 2 deletions samples/Calculator/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ namespace Calculator
open System
open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Mvu
open Microsoft.Maui.Controls
open Microsoft.Maui.Graphics

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module App =
type Operator =
Expand Down Expand Up @@ -109,8 +111,7 @@ module App =
Application(
ContentPage(
(Grid(rowdefs = [ Star; Star; Star; Star; Star; Star ], coldefs = [ Star; Star; Star; Star ]) {
View
.Label(display model)
Label(display model)
.font(size = 48.0, attributes = FontAttributes.Bold)
.background(Colors.Black)
.textColor(Colors.White)
Expand Down
2 changes: 2 additions & 0 deletions samples/Components/HelloComponent/App.fs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
namespace HelloComponent

open Fabulous.Maui
open Fabulous.Maui.Components
open Microsoft.Maui.Hosting

open type Fabulous.Maui.View
open type Fabulous.Maui.Components.View

module App =
let view () =
Expand Down
4 changes: 4 additions & 0 deletions samples/Components/MultipleMvus/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ namespace MultipleMvus

open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Components
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Components.View
open type Fabulous.Maui.Mvu.View

module Counter =
type Model = { Count: int }
Expand Down
4 changes: 4 additions & 0 deletions samples/Components/MvuCounter/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ namespace MvuCounter

open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Components
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Components.View
open type Fabulous.Maui.Mvu.View

module App =
type Model =
Expand Down
2 changes: 2 additions & 0 deletions samples/Components/SimpleCounter/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ namespace SimpleCounter

open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Components
open Microsoft.Maui.Hosting

open type Fabulous.Maui.View
open type Fabulous.Maui.Components.View

module App =
let view () =
Expand Down
4 changes: 4 additions & 0 deletions samples/Components/TicTacComponent/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ open Microsoft.Maui.ApplicationModel
open Microsoft.Maui.Devices
open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Components
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Components.View
open type Fabulous.Maui.Mvu.View

/// Represents a player and a player's move
type Player =
Expand Down
2 changes: 2 additions & 0 deletions samples/CounterApp/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ namespace CounterApp

open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module App =
type Model =
Expand Down
3 changes: 2 additions & 1 deletion samples/Gallery/App.fs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
namespace Gallery

open Fabulous.Maui.SmallScalars
open Microsoft.FSharp.Core
open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Mvu
open Microsoft.Maui.Controls

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module App =
type Path =
Expand Down
1 change: 0 additions & 1 deletion samples/Gallery/Gallery.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@

<ItemGroup>
<PackageReference Include="FSharp.Core" />
<PackageReference Include="Fabulous" />
<PackageReference Include="Microsoft.Extensions.Configuration" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.Logging" />
Expand Down
3 changes: 3 additions & 0 deletions samples/Gallery/Overview.fs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
namespace Gallery

open Fabulous.Maui
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module Overview =
let view (push: int -> 'msg) =
Expand Down
3 changes: 3 additions & 0 deletions samples/Gallery/SamplePage.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ namespace Gallery

open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module SamplePage =
let view (pop: 'msg) mapMsg index model =
Expand Down
3 changes: 3 additions & 0 deletions samples/Gallery/Samples/Border.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ namespace Gallery.Samples

open Gallery
open Fabulous.Maui
open Fabulous.Maui.Mvu
open Microsoft.Maui
open Microsoft.Maui.Graphics

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module Border =
let view () =
Expand Down
3 changes: 3 additions & 0 deletions samples/Gallery/Samples/FormattedLabel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ namespace Gallery.Samples

open Gallery
open Fabulous.Maui
open Fabulous.Maui.Mvu
open Microsoft.Maui
open Microsoft.Maui.Controls
open Microsoft.Maui.Graphics

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module FormattedLabel =
type Model = Id
Expand Down
3 changes: 3 additions & 0 deletions samples/Gallery/Samples/ImageButton.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ namespace Gallery.Samples

open Gallery
open Fabulous.Maui
open Fabulous.Maui.Mvu
open Microsoft.Maui
open Microsoft.Maui.Graphics

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module ImageButton =
let view () =
Expand Down
3 changes: 3 additions & 0 deletions samples/Gallery/Samples/Label.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ namespace Gallery.Samples

open Gallery
open Fabulous.Maui
open Fabulous.Maui.Mvu
open Microsoft.Maui
open Microsoft.Maui.Graphics

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module Label =
let view () =
Expand Down
3 changes: 3 additions & 0 deletions samples/Gallery/Samples/Shadow.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ namespace Gallery.Samples

open Gallery
open Fabulous.Maui
open Fabulous.Maui.Mvu
open Microsoft.Maui
open Microsoft.Maui.Controls
open Microsoft.Maui.Graphics

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module Shadow =
let view () =
Expand Down
3 changes: 3 additions & 0 deletions samples/Gallery/Samples/Shapes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ namespace Gallery.Samples

open Gallery
open Fabulous.Maui
open Fabulous.Maui.Mvu
open Microsoft.Maui.Controls
open Microsoft.Maui.Controls.Shapes
open Microsoft.Maui.Graphics

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module Shapes =
type Model = Id
Expand Down
3 changes: 3 additions & 0 deletions samples/Gallery/Samples/TextButton.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ namespace Gallery.Samples

open Gallery
open Fabulous.Maui
open Fabulous.Maui.Mvu
open Microsoft.Maui.Graphics

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module TextButton =
let view () =
Expand Down
2 changes: 2 additions & 0 deletions samples/Gallery/Samples/ThemeAware.fs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
namespace Gallery.Samples

open Fabulous.Maui
open Fabulous.Maui.Mvu
open Microsoft.Maui.Graphics
open Gallery

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module ThemeAware =
let view () =
Expand Down
3 changes: 0 additions & 3 deletions samples/Gallery/Styles.fs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
namespace Gallery

open Microsoft.Maui
open Fabulous
open Fabulous.Maui

open type Fabulous.Maui.View

module Fonts =
let OpenSansRegular = "OpenSansRegular"
let OpenSansSemibold = "OpenSansSemibold"
Expand Down
4 changes: 3 additions & 1 deletion samples/HelloWorld/App.fs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
namespace HelloWorld

open Fabulous.Maui
open Fabulous.Maui.Mvu
open Microsoft.Maui.Hosting

open type Fabulous.Maui.View
open Microsoft.Maui.Hosting
open type Fabulous.Maui.Mvu.View

module App =
let view () =
Expand Down
2 changes: 2 additions & 0 deletions samples/Navigation/BasicNavigation/PageA.fs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace NavigationSample

open Fabulous.Maui
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module PageA =
type Model = { Count: int }
Expand Down
2 changes: 2 additions & 0 deletions samples/Navigation/BasicNavigation/PageB.fs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace NavigationSample

open Fabulous.Maui
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module PageB =
type Model = { Count: int }
Expand Down
2 changes: 2 additions & 0 deletions samples/Navigation/BasicNavigation/PageC.fs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace NavigationSample

open Fabulous.Maui
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

module PageC =
type Model = { Count: int }
Expand Down
2 changes: 2 additions & 0 deletions samples/Navigation/BasicNavigation/Sample.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ namespace NavigationSample

open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

/// The most basic navigation with Fabulous is done by swapping widgets.
///
Expand Down
4 changes: 4 additions & 0 deletions samples/Navigation/ComponentNavigation/PageA.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ namespace ComponentNavigation

open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Components
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Components.View
open type Fabulous.Maui.Mvu.View

/// Each page is "isolated". They have their own MVU loop and own types.
/// The only dependency they receive from outside is the NavigationController, which is passed to the update function.
Expand Down
4 changes: 4 additions & 0 deletions samples/Navigation/ComponentNavigation/PageB.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ namespace ComponentNavigation

open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Components
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Components.View
open type Fabulous.Maui.Mvu.View

module PageB =
type Model =
Expand Down
4 changes: 4 additions & 0 deletions samples/Navigation/ComponentNavigation/PageC.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ namespace ComponentNavigation

open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Components
open Fabulous.Maui.Mvu

open type Fabulous.Maui.View
open type Fabulous.Maui.Components.View
open type Fabulous.Maui.Mvu.View

module PageC =
type Model =
Expand Down
3 changes: 3 additions & 0 deletions samples/Navigation/ComponentNavigation/Sample.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ namespace ComponentNavigation

open Fabulous
open Fabulous.Maui
open Fabulous.Maui.Components

open type Fabulous.Maui.View
open type Fabulous.Maui.Components.View
open type Fabulous.Maui.Mvu.View

/// This is the root of the app
module Sample =
Expand Down
1 change: 1 addition & 0 deletions samples/Navigation/NavigationPath/NavigationState.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ open Fabulous
open Fabulous.Maui

open type Fabulous.Maui.View
open type Fabulous.Maui.Mvu.View

/// MVU is a very explicit but also very verbose pattern.
/// Everything needs to be explicitly written out.
Expand Down
Loading
Loading