Skip to content

Commit

Permalink
update: README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
emako committed Aug 15, 2024
1 parent dd616b4 commit 3766452
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,35 +74,40 @@ Similar to WPF UI.
> The `ContentDialogHostService` simplifies the creation and management of `ContentDialog` instances in your application.
```c#
ContentDialog dialog =
new()
{
Title = "My sample dialog",
Content = "Content of the dialog",
CloseButtonText = "Close button",
PrimaryButtonText = "Primary button",
SecondaryButtonText = "Secondary button"
};
ContentDialog dialog = new()
{
Title = "My sample dialog",
Content = "Content of the dialog",
CloseButtonText = "Close button",
PrimaryButtonText = "Primary button",
SecondaryButtonText = "Secondary button"
};

// Setting the dialog container
dialog.DialogHost = ContentDialogHostService.ContentPresenterForDialogs;

// Showing the dialog
await dialog.ShowAsync(CancellationToken.None);
```

- **MessageBox**

> To utilize Win32's classic `MessageBox` methods while supporting modern UI themes like Mica and dark mode.
```c#
using MessageBox = Wpf.Ui.Violeta.Controls.MessageBox;

MessageBox.Information("This is a information message");
MessageBox.Warning("This is a warning message");
MessageBox.Error("This is a error message");

// Sync methods
_ = MessageBox.Information("This is a information message");
_ = MessageBox.Warning("This is a warning message");
_ = MessageBox.Error("This is a error message");
MessageBoxResult result = MessageBox.Question("This is a question and do you want to click OK?");

// Async methods
_ = await MessageBox.InformationAsync("This is a information message");
_ = await MessageBox.WarningAsync("This is a warning message");
_ = await MessageBox.ErrorAsync("This is a error message");
MessageBoxResult result = await MessageBox.QuestionAsync("This is a question and do you want to click OK?");
```

### 📷 Screenshots
Expand Down

0 comments on commit 3766452

Please sign in to comment.