-
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.
Add export grouping of tasks, Redesigned Export page
- Loading branch information
1 parent
76a7ccb
commit 4f788d5
Showing
7 changed files
with
180 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Windows.Data; | ||
|
||
using Humanizer; | ||
|
||
namespace QBTracker.Converters | ||
{ | ||
[ValueConversion(typeof(IEnumerable<Enum>), typeof(IEnumerable<ValueDescription>))] | ||
public class EnumHumanizerConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null) | ||
return null; | ||
if (value is IEnumerable en) | ||
return en.Cast<object>() | ||
.Select(x => new ValueDescription(x, x.ToString().Humanize())); | ||
return new ValueDescription(value, value.ToString().Humanize()); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
public class ValueDescription | ||
{ | ||
public ValueDescription(object value, string description) | ||
{ | ||
Value = value; | ||
Description = description; | ||
} | ||
|
||
public object Value { get; } | ||
public string Description { get; } | ||
} | ||
} |
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,8 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:converters="clr-namespace:QBTracker.Converters"> | ||
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> | ||
<converters:InverterConverter x:Key="InverterConverter" /> | ||
<converters:MaterialColorConverter x:Key="MaterialColorConverter" /> | ||
<converters:EnumHumanizerConverter x:Key="EnumHumanizerConverter" /> | ||
</ResourceDictionary> |
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