-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 1.8.1
- Loading branch information
Showing
22 changed files
with
350 additions
and
244 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
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
17 changes: 17 additions & 0 deletions
17
gamevault/UserControls/GeneralControls/DateRangeSelector.xaml
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,17 @@ | ||
<UserControl x:Class="gamevault.UserControls.DateRangeSelector" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" | ||
xmlns:local="clr-namespace:gamevault.UserControls" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" d:DesignWidth="800"> | ||
<Grid> | ||
<StackPanel Orientation="Horizontal" LostFocus="StackPanel_LostFocus"> | ||
<TextBox x:Name="uiFilterYearFrom" mah:ControlsHelper.CornerRadius="5" BorderThickness="2" mah:TextBoxHelper.Watermark="{Binding YearFromPlaceholder}" Background="{DynamicResource MainColor}" Width="42" MaxLength="4" PreviewTextInput="YearSelector_Changed"/> | ||
<Rectangle Fill="White" Stroke="White" StrokeThickness="4" Height="3" Width="7" Margin="5"/> | ||
<TextBox x:Name="uiFilterYearTo" mah:ControlsHelper.CornerRadius="5" BorderThickness="2" mah:TextBoxHelper.Watermark="{Binding YearToPlaceholder}" Background="{DynamicResource MainColor}" Width="42" MaxLength="4" PreviewTextInput="YearSelector_Changed"/> | ||
</StackPanel> | ||
</Grid> | ||
</UserControl> |
60 changes: 60 additions & 0 deletions
60
gamevault/UserControls/GeneralControls/DateRangeSelector.xaml.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,60 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.RegularExpressions; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace gamevault.UserControls | ||
{ | ||
/// <summary> | ||
/// Interaction logic for DateRangeSelector.xaml | ||
/// </summary> | ||
public partial class DateRangeSelector : UserControl | ||
{ | ||
public string YearToPlaceholder { get; set; } | ||
public string YearFromPlaceholder { get; set; } = "1980"; | ||
public event EventHandler EntriesUpdated; | ||
public DateRangeSelector() | ||
{ | ||
InitializeComponent(); | ||
YearToPlaceholder = DateTime.Now.Year.ToString(); | ||
this.DataContext = this; | ||
} | ||
public bool IsValid() | ||
{ | ||
return uiFilterYearFrom.Text != string.Empty && uiFilterYearTo.Text != string.Empty; | ||
} | ||
public string GetYearFrom() | ||
{ | ||
return uiFilterYearFrom.Text; | ||
} | ||
public string GetYearTo() | ||
{ | ||
return uiFilterYearTo.Text; | ||
} | ||
public void ClearSelection() | ||
{ | ||
uiFilterYearFrom.Text = string.Empty; uiFilterYearTo.Text = string.Empty; | ||
} | ||
private void StackPanel_LostFocus(object sender, RoutedEventArgs e) | ||
{ | ||
if (EntriesUpdated != null && IsValid()) | ||
EntriesUpdated(this, e); | ||
} | ||
private void YearSelector_Changed(object sender, TextCompositionEventArgs e) | ||
{ | ||
Regex regex = new Regex("[^0-9]+"); | ||
e.Handled = (((TextBox)e.Source).Text == "" && e.Text == "0") || regex.IsMatch(e.Text); | ||
} | ||
} | ||
} |
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
32 changes: 0 additions & 32 deletions
32
gamevault/UserControls/GeneralControls/UserEditUserControl.xaml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.