mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-23 02:51:26 -07:00
38 lines
1.0 KiB
C#
38 lines
1.0 KiB
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Input;
|
|
|
|
using Bloxstrap.UI.ViewModels.Menu;
|
|
|
|
namespace Bloxstrap.UI.Menu.Pages
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for InstallationPage.xaml
|
|
/// </summary>
|
|
public partial class InstallationPage
|
|
{
|
|
public InstallationPage()
|
|
{
|
|
DataContext = new InstallationViewModel();
|
|
InitializeComponent();
|
|
}
|
|
|
|
// https://stackoverflow.com/a/13289118/11852173
|
|
// yes this doesnt fully conform to xaml but whatever
|
|
private void TextBox_KeyEnterUpdate(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.Key == Key.Enter)
|
|
{
|
|
TextBox tBox = (TextBox)sender;
|
|
DependencyProperty prop = TextBox.TextProperty;
|
|
|
|
BindingExpression binding = BindingOperations.GetBindingExpression(tBox, prop);
|
|
|
|
if (binding is not null)
|
|
binding.UpdateSource();
|
|
}
|
|
}
|
|
}
|
|
}
|