-
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
1 parent
8d4f7f1
commit bc655bf
Showing
17 changed files
with
535 additions
and
207 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using Avalonia.Controls; | ||
using Avalonia.Data.Converters; | ||
using Avalonia.Media; | ||
using GUESS.Views; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Globalization; | ||
using System.Text; | ||
|
||
namespace GUESS.Converters | ||
{ | ||
public class BoolToPromptConverter : IValueConverter | ||
{ | ||
public static BoolToPromptConverter Singleton { get; } = new BoolToPromptConverter(); | ||
|
||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
var doesWin = (bool)value; | ||
var section = (string)parameter; | ||
if (doesWin) | ||
{ | ||
if (section == "Header") | ||
{ | ||
return "That's a Win!"; | ||
} | ||
else | ||
{ | ||
return "Cool!"; | ||
} | ||
} | ||
else | ||
{ | ||
if (section == "Header") | ||
{ | ||
return "That's a Lose"; | ||
} | ||
else | ||
{ | ||
return "Alright"; | ||
} | ||
} | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
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
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 Avalonia; | ||
using Avalonia.Data; | ||
using Avalonia.Data.Converters; | ||
using Avalonia.Media; | ||
using GUESS.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Text; | ||
|
||
namespace GUESS.Converters | ||
{ | ||
public class StatusToBrushConverter : IValueConverter | ||
{ | ||
public static StatusToBrushConverter Singleton { get; } = new StatusToBrushConverter(); | ||
|
||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
=> new SolidColorBrush(((Status)value) switch | ||
{ | ||
Status.HalfHalf => Color.FromUInt32(0xffeae463), | ||
Status.Correct => Color.FromUInt32(0xffade887), | ||
Status.Wrong => Color.FromUInt32(0xfff26b6b), | ||
Status.None => Color.FromUInt32(0xfff4f4f4), | ||
_ => throw new NotSupportedException() | ||
}); | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return new BindingNotification(new NotSupportedException()); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Avalonia.Input; | ||
using Avalonia.Media; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace GUESS.Misc | ||
{ | ||
public class BrushDataObject : DataObject | ||
{ | ||
public BrushDataObject(IBrush brush) => Brush = brush; | ||
public IBrush Brush { get; } | ||
} | ||
} |
Oops, something went wrong.