Skip to content

Commit

Permalink
Update opening-a-dialog.md (#577)
Browse files Browse the repository at this point in the history
* update wrong code in music app store tutorial

* add note for the introduction of IInteractionContext
  • Loading branch information
bitwool authored Dec 19, 2024
1 parent a03e75d commit 165ea51
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions docs/tutorials/music-store-app/opening-a-dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ Your next step is to make sure that the main window view knows how to start the
- Add the `DoShowDialogAsync` method as follows:

```csharp
private async Task DoShowDialogAsync(InteractionContext<MusicStoreViewModel,
// This code is only valid in newer ReactiveUI which is shipped since avalonia 11.2.0
private async Task DoShowDialogAsync(IInteractionContext<MusicStoreViewModel,
AlbumViewModel?> interaction)
{
var dialog = new MusicStoreWindow();
Expand Down Expand Up @@ -170,7 +171,7 @@ namespace Avalonia.MusicStore.Views
action(ViewModel!.ShowDialog.RegisterHandler(DoShowDialogAsync)));
}

private async Task DoShowDialogAsync(InteractionContext<MusicStoreViewModel,
private async Task DoShowDialogAsync(IInteractionContext<MusicStoreViewModel,
AlbumViewModel?> interaction)
{
var dialog = new MusicStoreWindow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ namespace Avalonia.MusicStore.ViewModels
- Добавьте метод `DoShowDialogAsync`, как показано ниже:

```csharp
private async Task DoShowDialogAsync(InteractionContext<MusicStoreViewModel,
// This code is only valid in newer ReactiveUI which is shipped since avalonia 11.2.0
private async Task DoShowDialogAsync(IInteractionContext<MusicStoreViewModel,
AlbumViewModel?> interaction)
{
var dialog = new MusicStoreWindow();
Expand Down Expand Up @@ -185,7 +186,7 @@ namespace Avalonia.MusicStore.Views
action(ViewModel!.ShowDialog.RegisterHandler(DoShowDialogAsync)));
}

private async Task DoShowDialogAsync(InteractionContext<MusicStoreViewModel,
private async Task DoShowDialogAsync(IInteractionContext<MusicStoreViewModel,
AlbumViewModel?> interaction)
{
var dialog = new MusicStoreWindow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ namespace Avalonia.MusicStore.ViewModels
- 添加以下 `DoShowDialogAsync` 方法:

```csharp
private async Task DoShowDialogAsync(InteractionContext<MusicStoreViewModel,
// This code is only valid in newer ReactiveUI which is shipped since avalonia 11.2.0
private async Task DoShowDialogAsync(IInteractionContext<MusicStoreViewModel,
AlbumViewModel?> interaction)
{
var dialog = new MusicStoreWindow();
Expand Down Expand Up @@ -172,7 +173,7 @@ namespace Avalonia.MusicStore.Views
action(ViewModel!.ShowDialog.RegisterHandler(DoShowDialogAsync)));
}

private async Task DoShowDialogAsync(InteractionContext<MusicStoreViewModel,
private async Task DoShowDialogAsync(IInteractionContext<MusicStoreViewModel,
AlbumViewModel?> interaction)
{
var dialog = new MusicStoreWindow();
Expand Down

0 comments on commit 165ea51

Please sign in to comment.