-
Notifications
You must be signed in to change notification settings - Fork 1
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
Tinyfish
committed
Jun 30, 2024
1 parent
5bd550e
commit 94c8eae
Showing
6 changed files
with
1,215 additions
and
1,090 deletions.
There are no files selected for viewing
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,25 @@ | ||
using System.Globalization; | ||
using Avalonia.Data; | ||
using Avalonia.Data.Converters; | ||
|
||
namespace HellDivers2OneKeyStratagem; | ||
|
||
public class RadioButtonToStringConverter : IValueConverter | ||
{ | ||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
if (value is string currentStringValue && parameter is string stringValue) | ||
return currentStringValue == stringValue; | ||
|
||
return BindingOperations.DoNothing; | ||
} | ||
|
||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
if (value is bool isChecked && parameter is string stringValue) | ||
if (isChecked) | ||
return stringValue; | ||
|
||
return BindingOperations.DoNothing; | ||
} | ||
} |
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
Oops, something went wrong.