Skip to content

Commit

Permalink
Sample fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Feb 19, 2025
1 parent 6c3d138 commit c26bf92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions samples/Sample.Uno/Presentation/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
VerticalAlignment="Center"
Spacing="16">

<TextBlock Text="{x:Bind ViewModel.OfflineResultText}" />
<TextBlock Text="{x:Bind ViewModel.OfflineResultText, Mode=OneWay}" />

<TextBlock Text="{x:Bind ViewModel.OfflineDate}" />
<TextBlock Text="{x:Bind ViewModel.OfflineDate, Mode=OneWay}" />

<Button Content="Run Offline"
Command="{x:Bind ViewModel.OfflineCommand}"/>
Expand Down
8 changes: 5 additions & 3 deletions samples/Sample.Uno/Presentation/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ public partial class MainViewModel(
INavigator navigator
) : ObservableObject, IEventHandler<AppEvent>
{
[ObservableProperty] string? offlineResultText;
[ObservableProperty] string? offlineDate;
[ObservableProperty] string offlineResultText = "No Result";
[ObservableProperty] string offlineDate = "Not Offline";

[RelayCommand]
async Task Offline()
{
var context = await mediator.RequestWithContext(new OfflineRequest());
var context = await mediator
.RequestWithContext(new OfflineRequest())
.ConfigureAwait(true);
var offline = context.Context.Offline();

this.OfflineResultText = context.Result;
Expand Down

0 comments on commit c26bf92

Please sign in to comment.