Skip to content

Commit e470a0a

Browse files
authored
Merge pull request #818 from unoplatform/dev/ks/samples-update-mvux-bindableProxy
chore: update samples for MVUX generated class
2 parents cf96230 + 084fd2b commit e470a0a

File tree

22 files changed

+34
-30
lines changed

22 files changed

+34
-30
lines changed

reference/Counter/CSharp-MVUX/Counter/Counter.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@
3939
CSharpMarkup;
4040
MVUX;
4141
</UnoFeatures>
42+
<WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion>
4243
</PropertyGroup>
4344
</Project>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
global using System.Collections.Immutable;
1+
global using System.Collections.Immutable;
22
global using Microsoft.Extensions.DependencyInjection;
33
global using Microsoft.Extensions.Logging;
44
global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
55
global using Color = Windows.UI.Color;
6+
[assembly: Uno.Extensions.Reactive.Config.BindableGenerationTool(3)]

reference/Counter/CSharp-MVUX/Counter/MainPage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public sealed partial class MainPage : Page
44
{
55
public MainPage()
66
{
7-
this.DataContext(new BindableMainModel(), (page, vm) => page
7+
this.DataContext(new MainViewModel(), (page, vm) => page
88
.Background(ThemeResource.Get<Brush>("ApplicationPageBackgroundThemeBrush"))
99
.Content(
1010
new StackPanel()
@@ -36,4 +36,4 @@ public MainPage()
3636
)
3737
);
3838
}
39-
}
39+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
33
"msbuild-sdks": {
4-
"Uno.Sdk": "5.3.90"
4+
"Uno.Sdk": "5.4.5"
55
}
66
}

reference/Counter/XAML-MVUX/Counter/Counter.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@
3838
<UnoFeatures>
3939
MVUX;
4040
</UnoFeatures>
41+
<WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion>
4142
</PropertyGroup>
4243
</Project>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
global using System.Collections.Immutable;
1+
global using System.Collections.Immutable;
22
global using Microsoft.Extensions.DependencyInjection;
33
global using Microsoft.Extensions.Logging;
44
global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
5+
[assembly: Uno.Extensions.Reactive.Config.BindableGenerationTool(3)]

reference/Counter/XAML-MVUX/Counter/MainPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:local="using:Counter"
66
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
77
<Page.DataContext>
8-
<local:BindableMainModel />
8+
<local:MainViewModel />
99
</Page.DataContext>
1010
<StackPanel VerticalAlignment="Center">
1111
<Image
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
33
"msbuild-sdks": {
4-
"Uno.Sdk": "5.3.90"
4+
"Uno.Sdk": "5.4.5"
55
}
66
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
global using System.Collections.Immutable;
1+
global using System.Collections.Immutable;
22
global using Microsoft.Extensions.DependencyInjection;
33
global using Microsoft.Extensions.Logging;
44
global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
55
global using Color = Windows.UI.Color;
6+
[assembly: Uno.Extensions.Reactive.Config.BindableGenerationTool(3)]

reference/SimpleCalc/CSharp-MVUX/SimpleCalculator/MainPage.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public sealed partial class MainPage : Page
1010
{
1111
public MainPage()
1212
{
13-
this.DataContext(new BindableMainModel(this.GetThemeService()), (page, vm)
13+
this.DataContext(new MainViewModel(this.GetThemeService()), (page, vm)
1414
=> page
1515
.Resources(r => r
1616
.Add(AppIcons.Dark)
@@ -39,7 +39,7 @@ public MainPage()
3939
);
4040
}
4141

42-
private ToggleButton Header(BindableMainModel vm)
42+
private ToggleButton Header(MainViewModel vm)
4343
=> new ToggleButton()
4444
.Grid(row: 0)
4545
.Margin(8, 24, 8, 0)
@@ -63,7 +63,7 @@ private ToggleButton Header(BindableMainModel vm)
6363
.Foreground(Theme.Brushes.Primary.Default)
6464
);
6565

66-
private StackPanel Output(BindableMainModel vm) =>
66+
private StackPanel Output(MainViewModel vm) =>
6767
new StackPanel()
6868
.Grid(row: 2)
6969
.Spacing(16)
@@ -75,21 +75,21 @@ private StackPanel Output(BindableMainModel vm) =>
7575
Result(vm)
7676
);
7777

78-
private TextBlock Equation(BindableMainModel vm) =>
78+
private TextBlock Equation(MainViewModel vm) =>
7979
new TextBlock()
8080
.Text(() => vm.Calculator.Equation)
8181
.HorizontalAlignment(HorizontalAlignment.Right)
8282
.Foreground(Theme.Brushes.OnSecondary.Container.Default)
8383
.Style(Theme.TextBlock.Styles.DisplaySmall);
8484

85-
private TextBlock Result(BindableMainModel vm) =>
85+
private TextBlock Result(MainViewModel vm) =>
8686
new TextBlock()
8787
.Text(() => vm.Calculator.Output)
8888
.HorizontalAlignment(HorizontalAlignment.Right)
8989
.Foreground(Theme.Brushes.OnBackground.Default)
9090
.Style(Theme.TextBlock.Styles.DisplayLarge);
9191

92-
private Grid KeyPad(BindableMainModel vm)
92+
private Grid KeyPad(MainViewModel vm)
9393
=> new Grid()
9494
.Grid(row: 3)
9595
.RowSpacing(16)
@@ -132,7 +132,7 @@ private Grid KeyPad(BindableMainModel vm)
132132
);
133133

134134
private Button KeyPadButton(
135-
BindableMainModel vm,
135+
MainViewModel vm,
136136
int gridRow,
137137
int gridColumn,
138138
object content,
@@ -150,7 +150,7 @@ private Button KeyPadButton(
150150
.Style(Theme.Button.Styles.Elevated);
151151

152152
private Button KeyPadPrimaryButton(
153-
BindableMainModel vm,
153+
MainViewModel vm,
154154
int gridRow,
155155
int gridColumn,
156156
object content,
@@ -167,7 +167,7 @@ private Button KeyPadPrimaryButton(
167167
.Style(Theme.Button.Styles.Filled);
168168

169169
private Button KeyPadSecondaryButton(
170-
BindableMainModel vm,
170+
MainViewModel vm,
171171
int gridRow,
172172
int gridColumn,
173173
object content,

0 commit comments

Comments
 (0)