Skip to content

Model-View-Update (MVU) design pattern for UWP apps

Notifications You must be signed in to change notification settings

sonnemaf/MvuTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Model-View-Update (MVU) design pattern for UWP apps

using MvuTest.Controls;
using System;
using Windows.UI;
using Windows.UI.Popups;
using Windows.UI.Xaml;

namespace MvuTest {

    public class MainPage : MvuPage {

        private TextBlock2 _tb;

        private int _count;

        protected override IUIElement2 Build() =>
            this.StackPanel(
                this.ToggleButton("Toggle it")
                    .Width(200)
                    .FontSize(30),
                this.Button("Increment", (sender, e) => {
                    _tb.Text($"Count {++_count}");
                }).HorizontalAlignment(HorizontalAlignment.Center),
                (_tb = this.TextBlock("Count 0"))
                    .FontSize(20)
                    .Foreground(Colors.Red),
                this.TextBox("Fons Sonnemans")
                    .Header("Name")
            ).Spacing(12)
             .HorizontalAlignment(HorizontalAlignment.Center)
             .VerticalAlignment(VerticalAlignment.Center);
    }

}

Releases

No releases published

Packages

No packages published

Languages