forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
126 additions
and
134 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/Uno.UI.RemoteControl/HotReload/HotReloadStatusView.Resources.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#nullable enable | ||
|
||
using System; | ||
using System.Linq; | ||
using Microsoft.UI.Xaml.Data; | ||
|
||
namespace Uno.UI.RemoteControl.HotReload; | ||
|
||
internal sealed class NullableBoolToObjectConverter : IValueConverter | ||
{ | ||
public object? TrueValue { get; set; } | ||
|
||
public object? FalseValue { get; set; } | ||
|
||
public object? NullValue { get; set; } | ||
|
||
public object? Convert(object? value, Type targetType, object parameter, string language) | ||
=> value switch | ||
{ | ||
null => NullValue, | ||
true => TrueValue, | ||
false => FalseValue, | ||
_ => throw new NotSupportedException("Only nullable boolean values are supported."), | ||
}; | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, string language) | ||
=> throw new NotSupportedException("Only one-way conversion is supported."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters