mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Make channel selection input more responsive
This commit is contained in:
parent
f553a812cb
commit
0162dbf3bb
@ -42,7 +42,7 @@
|
||||
<TextBlock FontSize="14" Text="Channel" />
|
||||
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Choose which deployment channel Roblox should be downloaded from." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
||||
</StackPanel>
|
||||
<ComboBox Grid.Column="1" Margin="8,0,8,0" Padding="10,5,10,5" Width="200" IsEditable="True" ItemsSource="{Binding Channels, Mode=OneWay}" Text="{Binding SelectedChannel, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" KeyUp="ComboBox_KeyEnterUpdate" />
|
||||
<ComboBox Grid.Column="1" Margin="8,0,8,0" Padding="10,5,10,5" Width="200" IsEditable="True" ItemsSource="{Binding Channels, Mode=OneWay}" Text="{Binding SelectedChannel, Mode=TwoWay, Delay=250}" />
|
||||
</Grid>
|
||||
</ui:CardExpander.Header>
|
||||
<StackPanel>
|
||||
|
@ -17,21 +17,5 @@ namespace Bloxstrap.UI.Menu.Pages
|
||||
DataContext = new BehaviourViewModel();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/a/13289118/11852173
|
||||
// yes this doesnt fully conform to xaml but whatever
|
||||
private void ComboBox_KeyEnterUpdate(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
ComboBox box = (ComboBox)sender;
|
||||
DependencyProperty prop = ComboBox.TextProperty;
|
||||
|
||||
BindingExpression binding = BindingOperations.GetBindingExpression(box, prop);
|
||||
|
||||
if (binding is not null)
|
||||
binding.UpdateSource();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user