[TextExtractor] Extend settings with preferred language (#22901)

* [TextExtractor] Extend settings with preferred language

* TextExtractor simplifying code, adding update languages on dropdown opening

* fix typo

* TextExtractor fixing bug with order of languages
This commit is contained in:
Laszlo Nemeth
2022-12-28 19:54:59 +01:00
committed by GitHub
parent 1f4ba8f267
commit dd62dab831
8 changed files with 129 additions and 3 deletions

View File

@@ -23,5 +23,21 @@ namespace Microsoft.PowerToys.Settings.UI.Views
DataContext = ViewModel;
InitializeComponent();
}
private void TextExtractor_ComboBox_Loaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
{
/**
* UWP hack
* because UWP load the bound ItemSource of the ComboBox asynchronous,
* so after InitializeComponent() the ItemSource is still empty and can't automatically select a entry.
* Selection via SelectedItem and SelectedValue is still not working too
*/
ViewModel.UpdateLanguages();
}
private void TextExtractor_ComboBox_DropDownOpened(object sender, object e)
{
ViewModel.UpdateLanguages();
}
}
}