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 925121a commit 91462f6
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 14 deletions.
71 changes: 61 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,37 @@

[![GitHub license](https://img.shields.io/github/license/emako/wpfui.violeta)](https://github.com/emako/wpfui.violeta/blob/master/LICENSE) [![NuGet](https://img.shields.io/nuget/v/WPF-UI.Violeta.svg)](https://nuget.org/packages/WPF-UI.Violeta) [![VS 2022 Downloads](https://img.shields.io/visual-studio-marketplace/i/lepo.WPF-UI?label=vs-2022)](https://marketplace.visualstudio.com/items?itemName=lepo.WPF-UI) [![Actions](https://github.com/emako/wpfui.violeta/actions/workflows/library.nuget.yml/badge.svg)](https://github.com/emako/wpfui.violeta/actions/workflows/library.nuget.yml) [![Platform](https://img.shields.io/badge/platform-Windows-blue?logo=windowsxp&color=1E9BFA)](https://dotnet.microsoft.com/zh-cn/download/dotnet/latest/runtime)

WPF UI Violeta is based on [WPF UI](https://github.com/lepoco/wpfui), and provides the Fluent experience in your known and loved WPF framework. Some new immersive controls like `Toast`.
WPF UI Violeta is based on [WPF UI](https://github.com/lepoco/wpfui), and provides the Fluent experience in your known and loved WPF framework. Some new immersive controls like `Toast`, `Flyout`, `ContentDialog`, `MessageBox` and etc.

When I decided to create this project I was listening to the song `Violeta`.

### 🚀 Getting started

The same as WPF UI.
Similar to WPF UI.

```xaml
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:vio="http://schemas.lepo.co/wpfui/2022/xaml/violeta"
<Application
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:vio="http://schemas.lepo.co/wpfui/2022/xaml/violeta">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Dark" />
<ui:ControlsDictionary />
<vio:ControlsDictionary />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
```

### 📷 Screenshots

Under construction

### 👋Example

[Wpf.Ui.Test](https://github.com/emako/wpfui.violeta/tree/master/src/Wpf.Ui.Test)

- Toast
- **Toast**

> `Toast` is an independent popup notification that automatically disappears after a specified time.
```c#
Toast.Information("I am information message");
Expand All @@ -37,7 +46,10 @@ Under construction
Toast.Show(owner: null!, "I am any message", new ToastConfig());
```

- Flyout
- **Flyout**

> The `FlyoutService` enables you to attach `Flyout` menus or tooltips to various controls such as `Button`, providing a flexible and intuitive way to display additional content or options.
```xaml
<ui:Button Content="Show Flyout">
<ui:FlyoutService.Flyout>
Expand All @@ -57,6 +69,45 @@ Under construction
</ui:Button>
```

- **ContentDialog**

> 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"
};

// 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");

MessageBoxResult result = MessageBox.Question("This is a question and do you want to click OK?");
```

### 📷 Screenshots

Under construction

### Thanks

Expand Down
9 changes: 5 additions & 4 deletions src/Wpf.Ui.Test/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Windows.Media;
using Wpf.Ui.Controls;
using Wpf.Ui.Violeta.Controls;
using MessageBox = Wpf.Ui.Violeta.Controls.MessageBox;

namespace Wpf.Ui.Test;

Expand Down Expand Up @@ -95,19 +96,19 @@ private void ShowMessageBox(Button self)
{
if (self.Content.ToString() == "Information")
{
Violeta.Controls.MessageBox.Information("This is a information message");
MessageBox.Information("This is a information message");
}
else if (self.Content.ToString() == "Warning")
{
Violeta.Controls.MessageBox.Warning("This is a warning message");
MessageBox.Warning("This is a warning message");
}
else if (self.Content.ToString() == "Question")
{
Violeta.Controls.MessageBox.Question("This is a question and do you want to click OK?");
MessageBox.Question("This is a question and do you want to click OK?");
}
else if (self.Content.ToString() == "Error")
{
Violeta.Controls.MessageBox.Error("This is a error message");
MessageBox.Error("This is a error message");
}
}
}

0 comments on commit 91462f6

Please sign in to comment.