Skip to content

Commit 8d09261

Browse files
committed
chore: update packages
1 parent 2021447 commit 8d09261

File tree

12 files changed

+49
-37
lines changed

12 files changed

+49
-37
lines changed
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
namespace Counter;
22

3-
internal partial record MainModel
3+
internal partial record Countable(int Count, int Step)
44
{
5-
public IState<int> Count => State.Value(this, () => 0);
5+
public Countable Increment() => this with
6+
{
7+
Count = Count + Step
8+
};
9+
}
610

7-
public IState<int> Step => State.Value(this, () => 1);
11+
internal partial record MainModel
12+
{
13+
public IState<Countable> Countable => State.Value(this, () => new Countable(0, 1));
814

9-
public ValueTask IncrementCommand(int Step)
10-
=> Count.Update(c => c + Step, CancellationToken.None);
11-
}
15+
public ValueTask IncrementCounter()
16+
=> Countable.UpdateAsync(c => c?.Increment());
17+
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ public MainPage()
2121
.HorizontalAlignment(HorizontalAlignment.Center)
2222
.TextAlignment(Microsoft.UI.Xaml.TextAlignment.Center)
2323
.PlaceholderText("Step Size")
24-
.Text(x => x.Binding(() => vm.Step).TwoWay()),
24+
.Text(x => x.Bind(() => vm.Countable.Step).TwoWay()),
2525
new TextBlock()
2626
.Margin(12)
2727
.HorizontalAlignment(HorizontalAlignment.Center)
2828
.TextAlignment(Microsoft.UI.Xaml.TextAlignment.Center)
29-
.Text(() => vm.Count, txt => $"Counter: {txt}"),
29+
.Text(() => vm.Countable.Count, txt => $"Counter: {txt}"),
3030
new Button()
3131
.Margin(12)
3232
.HorizontalAlignment(HorizontalAlignment.Center)
33-
.Command(() => vm.IncrementCommand)
33+
.Command(() => vm.IncrementCounter)
3434
.Content("Increment Counter by Step Size")
3535
)
3636
)
3737
);
3838
}
39-
}
39+
}

reference/Counter/CSharp-MVUX/Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
</PropertyGroup>
1515

1616
<PropertyGroup>
17-
<UnoExtensionsVersion>4.1.14</UnoExtensionsVersion>
18-
<UnoToolkitVersion>6.0.18</UnoToolkitVersion>
17+
<UnoExtensionsVersion>4.1.23</UnoExtensionsVersion>
18+
<UnoToolkitVersion>6.0.24</UnoToolkitVersion>
1919
<UnoThemesVersion>5.0.13</UnoThemesVersion>
20-
<UnoCSharpMarkupVersion>5.2.13</UnoCSharpMarkupVersion>
20+
<UnoCSharpMarkupVersion>5.2.14</UnoCSharpMarkupVersion>
2121
</PropertyGroup>
2222
</Project>
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.2.80"
4+
"Uno.Sdk": "5.2.139"
55
}
66
}

reference/Counter/CSharp-MVVM/Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
</PropertyGroup>
1515

1616
<PropertyGroup>
17-
<UnoExtensionsVersion>4.1.14</UnoExtensionsVersion>
18-
<UnoToolkitVersion>6.0.18</UnoToolkitVersion>
17+
<UnoExtensionsVersion>4.1.23</UnoExtensionsVersion>
18+
<UnoToolkitVersion>6.0.24</UnoToolkitVersion>
1919
<UnoThemesVersion>5.0.13</UnoThemesVersion>
20-
<UnoCSharpMarkupVersion>5.2.13</UnoCSharpMarkupVersion>
20+
<UnoCSharpMarkupVersion>5.2.14</UnoCSharpMarkupVersion>
2121
</PropertyGroup>
2222
</Project>
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.2.80"
4+
"Uno.Sdk": "5.2.139"
55
}
66
}
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
namespace Counter;
22

3-
internal partial record MainModel
3+
internal partial record Countable(int Count, int Step)
44
{
5-
public IState<int> Count => State.Value(this, () => 0);
5+
public Countable Increment() => this with
6+
{
7+
Count = Count + Step
8+
};
9+
}
610

7-
public IState<int> Step => State.Value(this, () => 1);
11+
internal partial record MainModel
12+
{
13+
public IState<Countable> Countable => State.Value(this, () => new Countable(0, 1));
814

9-
public ValueTask IncrementCommand(int Step)
10-
=> Count.Update(c => c + Step, CancellationToken.None);
11-
}
15+
public ValueTask IncrementCounter()
16+
=> Countable.UpdateAsync(c => c?.Increment());
17+
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Page
1+
<Page
22
x:Class="Counter.MainPage"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@@ -19,20 +19,20 @@
1919
Margin="12"
2020
HorizontalAlignment="Center"
2121
PlaceholderText="Step Size"
22-
Text="{Binding Step, Mode=TwoWay}"
22+
Text="{Binding Countable.Step, Mode=TwoWay}"
2323
TextAlignment="Center" />
2424

2525
<TextBlock
2626
Margin="12"
2727
HorizontalAlignment="Center"
2828
TextAlignment="Center">
29-
<Run Text="Counter: " /><Run Text="{Binding Count}" />
29+
<Run Text="Counter: " /><Run Text="{Binding Countable.Count}" />
3030
</TextBlock>
3131

3232
<Button
3333
Margin="12"
3434
HorizontalAlignment="Center"
35-
Command="{Binding IncrementCommand}"
35+
Command="{Binding IncrementCounter}"
3636
Content="Increment Counter by Step Size" />
3737
</StackPanel>
38-
</Page>
38+
</Page>

reference/Counter/XAML-MVUX/Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
</PropertyGroup>
1515

1616
<PropertyGroup>
17-
<UnoExtensionsVersion>4.1.14</UnoExtensionsVersion>
18-
<UnoToolkitVersion>6.0.18</UnoToolkitVersion>
17+
<UnoExtensionsVersion>4.1.23</UnoExtensionsVersion>
18+
<UnoToolkitVersion>6.0.24</UnoToolkitVersion>
1919
<UnoThemesVersion>5.0.13</UnoThemesVersion>
20-
<UnoCSharpMarkupVersion>5.2.13</UnoCSharpMarkupVersion>
20+
<UnoCSharpMarkupVersion>5.2.14</UnoCSharpMarkupVersion>
2121
</PropertyGroup>
2222
</Project>
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.2.80"
4+
"Uno.Sdk": "5.2.139"
55
}
66
}

0 commit comments

Comments
 (0)