-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace EnumToIntConverter with a dumber variant that doesn't set .NE…
…T Native on fire god
- Loading branch information
Showing
10 changed files
with
39 additions
and
221 deletions.
There are no files selected for viewing
45 changes: 0 additions & 45 deletions
45
Sources/Stylophone.Localization/Strings/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 was deleted.
Oops, something went wrong.
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,32 @@ | ||
using Stylophone.Common.Interfaces; | ||
using Stylophone.Localization.Strings; | ||
using System; | ||
|
||
using Windows.UI.Xaml.Data; | ||
|
||
namespace Stylophone.Helpers | ||
{ | ||
public class ThemeToIntConverter : IValueConverter | ||
{ | ||
|
||
public object Convert(object value, Type targetType, object parameter, string language) | ||
{ | ||
|
||
if (value is Theme t) | ||
return (int)t; | ||
|
||
throw new ArgumentException("Not a Theme"); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, string language) | ||
{ | ||
if (value is int enumInt) | ||
{ | ||
// Cast enumInt to EnumType | ||
return Enum.ToObject(typeof(Theme), enumInt); | ||
} | ||
|
||
throw new ArgumentException("Not an int"); | ||
} | ||
} | ||
} |
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