Skip to content

Commit 91a18bf

Browse files
committed
Update demos
1 parent c22f36e commit 91a18bf

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

demos/CommandLine/Demo.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,9 @@ static async Task Main()
121121

122122
_ = Task.Run(async () =>
123123
{
124-
await foreach (var update in db.ListenAsync(new CancellationToken()))
124+
await foreach (var update in db.Events.OnStatusChanged.ListenAsync(new CancellationToken()))
125125
{
126-
if (update.StatusChanged != null)
127-
{
128-
connected = update.StatusChanged.Connected;
129-
}
126+
connected = update.Status.Connected;
130127
}
131128
});
132129

demos/MAUITodo/Views/ListsPage.xaml.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@ protected override async void OnAppearing()
2222

2323
_ = Task.Run(async () =>
2424
{
25-
await foreach (var update in database.Db.ListenAsync(new CancellationToken()))
25+
await foreach (var update in database.Db.Events.OnStatusChanged.ListenAsync(new CancellationToken()))
2626
{
27-
if (update.StatusChanged != null)
27+
MainThread.BeginInvokeOnMainThread(() =>
2828
{
29-
MainThread.BeginInvokeOnMainThread(() =>
30-
{
31-
WifiStatusItem.IconImageSource = update.StatusChanged.Connected ? "wifi.png" : "wifi_off.png";
32-
});
33-
}
29+
WifiStatusItem.IconImageSource = update.Status.Connected ? "wifi.png" : "wifi_off.png";
30+
});
3431
}
3532
});
3633

0 commit comments

Comments
 (0)