项目作者: sonnemaf

项目描述 :
Model-View-Update (MVU) design pattern for UWP apps
高级语言: C#
项目地址: git://github.com/sonnemaf/MvuTest.git
创建时间: 2020-05-28T09:31:17Z
项目社区:https://github.com/sonnemaf/MvuTest

开源协议:

下载


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

  1. using MvuTest.Controls;
  2. using System;
  3. using Windows.UI;
  4. using Windows.UI.Popups;
  5. using Windows.UI.Xaml;
  6. namespace MvuTest {
  7. public class MainPage : MvuPage {
  8. private TextBlock2 _tb;
  9. private int _count;
  10. protected override IUIElement2 Build() =>
  11. this.StackPanel(
  12. this.ToggleButton("Toggle it")
  13. .Width(200)
  14. .FontSize(30),
  15. this.Button("Increment", (sender, e) => {
  16. _tb.Text($"Count {++_count}");
  17. }).HorizontalAlignment(HorizontalAlignment.Center),
  18. (_tb = this.TextBlock("Count 0"))
  19. .FontSize(20)
  20. .Foreground(Colors.Red),
  21. this.TextBox("Fons Sonnemans")
  22. .Header("Name")
  23. ).Spacing(12)
  24. .HorizontalAlignment(HorizontalAlignment.Center)
  25. .VerticalAlignment(VerticalAlignment.Center);
  26. }
  27. }