Skip to content

Commit

Permalink
Added more icons
Browse files Browse the repository at this point in the history
Added more icons
jamsoft committed Jun 3, 2024
1 parent 9787593 commit 368ca86
Showing 14 changed files with 75 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -16,16 +16,16 @@ https://jamsoft.github.io/JamSoft.AvaloniaUI.Dialogs/

## Installation
```shell
dotnet add package JamSoft.AvaloniaUI.Dialogs --version 1.3.0
dotnet add package JamSoft.AvaloniaUI.Dialogs --version 1.3.1
```
```shell
Install-Package JamSoft.AvaloniaUI.Dialogs -Version 1.3.0
Install-Package JamSoft.AvaloniaUI.Dialogs -Version 1.3.1
```
```xml
<PackageReference Include="JamSoft.AvaloniaUI.Dialogs" Version="1.3.0" />
<PackageReference Include="JamSoft.AvaloniaUI.Dialogs" Version="1.3.1" />
```
```shell
paket add JamSoft.AvaloniaUI.Dialogs --version 1.3.0
paket add JamSoft.AvaloniaUI.Dialogs --version 1.3.1
```
### Tested On
- Windows 10 & 11
Original file line number Diff line number Diff line change
@@ -348,11 +348,11 @@ private async void ShowMessageBoxCommandExecuted()
var resultYesNoNoIcon = await _messageBoxService.Show("Yes No Without Icon", "Do you want to carry on?", MsgBoxButton.YesNo);
Message = $"{resultYesNoNoIcon} clicked";

var viewModel = new MsgBoxViewModel("Yes No With Icon", "Do you want to carry on?", MsgBoxButton.YesNo, MsgBoxImage.Warning);
var viewModel = new MsgBoxViewModel("Yes No With Icon", "Do you want to carry on?", MsgBoxButton.YesNo, MsgBoxImage.Forbidden);
var resultVm = await _messageBoxService.Show(viewModel);
Message = $"{resultVm} clicked";

var resultYesNoCancelCustomButtonText = await _messageBoxService.Show("German Yes No Cancel", "Möchten Sie weitermachen?", MsgBoxButton.YesNoCancel, MsgBoxImage.Question, "Nein", "Ja", "Abbrechen");
var resultYesNoCancelCustomButtonText = await _messageBoxService.Show("German Yes No Cancel", "Möchten Sie weitermachen?", MsgBoxButton.YesNoCancel, MsgBoxImage.Wifi, "Nein", "Ja", "Abbrechen");
Message = $"{resultYesNoCancelCustomButtonText} clicked";
}
}
Binary file added src/JamSoft.AvaloniaUI.Dialogs/Assets/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/JamSoft.AvaloniaUI.Dialogs/Assets/back-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/JamSoft.AvaloniaUI.Dialogs/Assets/ban.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/JamSoft.AvaloniaUI.Dialogs/Assets/database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/JamSoft.AvaloniaUI.Dialogs/Assets/wifi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -21,11 +21,11 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>JamSoft.AssemblyKeyFile.snk</AssemblyOriginatorKeyFile>
<PublicSign>true</PublicSign>
<Version>1.3.0</Version>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
<FileVersion>1.3.0.0</FileVersion>
<Version>1.3.1</Version>
<AssemblyVersion>1.3.1.0</AssemblyVersion>
<FileVersion>1.3.1.0</FileVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<InformationalVersion>1.3.0.0-rel</InformationalVersion>
<InformationalVersion>1.3.1.0-rel</InformationalVersion>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
42 changes: 41 additions & 1 deletion src/JamSoft.AvaloniaUI.Dialogs/MsgBox/MsgBoxImage.cs
Original file line number Diff line number Diff line change
@@ -53,5 +53,45 @@ public enum MsgBoxImage
/// <summary>
/// Show a custom icon
/// </summary>
Custom
Custom,

/// <summary>
/// Show the Success icon
/// </summary>
Success,

/// <summary>
/// Show the Battery icon
/// </summary>
Battery,

/// <summary>
/// Show the Database icon
/// </summary>
Database,

/// <summary>
/// Show the Folder icon
/// </summary>
Folder,

/// <summary>
/// Show the Forbidden icon
/// </summary>
Forbidden,

/// <summary>
/// Show the Plus icon
/// </summary>
Plus,

/// <summary>
/// Show the Setting icon
/// </summary>
Setting,

/// <summary>
/// Show the Wifi icon
/// </summary>
Wifi
}
24 changes: 24 additions & 0 deletions src/JamSoft.AvaloniaUI.Dialogs/ViewModels/MsgBoxViewModel.cs
Original file line number Diff line number Diff line change
@@ -105,6 +105,30 @@ protected virtual void SetImage()
case MsgBoxImage.Question:
Icon = new Bitmap(AssetLoader.Open(new Uri($"avares://JamSoft.AvaloniaUI.Dialogs/Assets/interrogation.png")));
break;
case MsgBoxImage.Success:
Icon = new Bitmap(AssetLoader.Open(new Uri($"avares://JamSoft.AvaloniaUI.Dialogs/Assets/check-circle.png")));
break;
case MsgBoxImage.Battery:
Icon = new Bitmap(AssetLoader.Open(new Uri($"avares://JamSoft.AvaloniaUI.Dialogs/Assets/battery-half.png")));
break;
case MsgBoxImage.Database:
Icon = new Bitmap(AssetLoader.Open(new Uri($"avares://JamSoft.AvaloniaUI.Dialogs/Assets/database.png")));
break;
case MsgBoxImage.Folder:
Icon = new Bitmap(AssetLoader.Open(new Uri($"avares://JamSoft.AvaloniaUI.Dialogs/Assets/folder-open.png")));
break;
case MsgBoxImage.Forbidden:
Icon = new Bitmap(AssetLoader.Open(new Uri($"avares://JamSoft.AvaloniaUI.Dialogs/Assets/ban.png")));
break;
case MsgBoxImage.Plus:
Icon = new Bitmap(AssetLoader.Open(new Uri($"avares://JamSoft.AvaloniaUI.Dialogs/Assets/add.png")));
break;
case MsgBoxImage.Setting:
Icon = new Bitmap(AssetLoader.Open(new Uri($"avares://JamSoft.AvaloniaUI.Dialogs/Assets/customize.png")));
break;
case MsgBoxImage.Wifi:
Icon = new Bitmap(AssetLoader.Open(new Uri($"avares://JamSoft.AvaloniaUI.Dialogs/Assets/wifi.png")));
break;
default:
Icon = null;
break;

0 comments on commit 368ca86

Please sign in to comment.