mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
TextBoxWithButton control correctly updates field value
Create Group now allows inline input of the group name
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Input;
|
||||
using Windows.System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Controls;
|
||||
|
||||
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
|
||||
|
||||
@@ -11,11 +14,6 @@ namespace ModernKeePass.Views.UserControls
|
||||
{
|
||||
public sealed partial class HamburgerMenuUserControl
|
||||
{
|
||||
public HamburgerMenuUserControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string HeaderLabel
|
||||
{
|
||||
get { return (string)GetValue(HeaderLabelProperty); }
|
||||
@@ -112,9 +110,14 @@ namespace ModernKeePass.Views.UserControls
|
||||
typeof(ICommand),
|
||||
typeof(HamburgerMenuUserControl),
|
||||
new PropertyMetadata(null, (o, args) => { }));
|
||||
|
||||
|
||||
|
||||
public event EventHandler<SelectionChangedEventArgs> SelectionChanged;
|
||||
|
||||
public HamburgerMenuUserControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
SelectionChanged?.Invoke(sender, e);
|
||||
@@ -126,5 +129,14 @@ namespace ModernKeePass.Views.UserControls
|
||||
if (parent == null) return;
|
||||
VisualStateManager.GoToState(this, parent.ActualWidth <= 640 ? "Hidden" : "Collapsed", true);
|
||||
}
|
||||
|
||||
private void NewGroupTextBox_OnKeyDown(object sender, KeyRoutedEventArgs e)
|
||||
{
|
||||
if (e.Key != VirtualKey.Enter) return;
|
||||
var textBox = sender as TextBoxWithButton;
|
||||
ActionButtonCommand.Execute(textBox?.Text);
|
||||
// Stop the event from triggering twice
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user