Skip to content

Commit

Permalink
Merge pull request #136 from DHancock/Dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
DHancock authored Dec 29, 2023
2 parents a5e6b0a + 3c373c1 commit a96276f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
2 changes: 0 additions & 2 deletions Countdown/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@

global using Windows.ApplicationModel.DataTransfer;
global using Windows.Foundation;
global using Windows.Foundation.Collections;
global using Windows.Graphics;
global using Windows.Media.Playback;
global using Windows.Storage;
global using Windows.System;
global using Windows.UI;
global using Windows.Win32;
Expand Down
28 changes: 14 additions & 14 deletions Countdown/Views/LettersView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ internal sealed partial class LettersView : Page
private bool firstLoad = true;

private TreeViewList? treeViewList;
private TextBox? textBox;
private LettersViewModel? viewModel;

public LettersView()
Expand All @@ -16,23 +15,24 @@ public LettersView()

Loaded += (s, e) =>
{
textBox ??= FindChild<TextBox>(SuggestionBox);

if (textBox is not null)
if (firstLoad)
{
textBox.CharacterCasing = CharacterCasing.Lower;
textBox.MaxLength = Models.WordModel.cMaxLetters;
firstLoad = false;

textBox.BeforeTextChanging += (s, a) =>
TextBox? textBox = FindChild<TextBox>(SuggestionBox);

if (textBox is not null)
{
if (a.NewText.Length > 0)
a.Cancel = a.NewText.Any(c => c is < 'a' or > 'z');
};
}
textBox.CharacterCasing = CharacterCasing.Lower;
textBox.MaxLength = Models.WordModel.cMaxLetters;

textBox.BeforeTextChanging += (s, a) =>
{
if (a.NewText.Length > 0)
a.Cancel = a.NewText.Any(c => c is < 'a' or > 'z');
};
}

if (firstLoad)
{
firstLoad = false;
App.MainWindow?.AddDragRegionEventHandlers(this);
}

Expand Down

0 comments on commit a96276f

Please sign in to comment.