2022-08-25 05:25:52 -05:00
|
|
|
|
// Copyright (c) Microsoft Corporation
|
|
|
|
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
|
|
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Library;
|
2022-10-26 14:02:31 +01:00
|
|
|
|
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
2022-08-25 05:25:52 -05:00
|
|
|
|
using Microsoft.UI.Xaml.Controls;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Views
|
|
|
|
|
|
{
|
|
|
|
|
|
public sealed partial class PowerOcrPage : Page
|
|
|
|
|
|
{
|
|
|
|
|
|
private PowerOcrViewModel ViewModel { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public PowerOcrPage()
|
|
|
|
|
|
{
|
|
|
|
|
|
var settingsUtils = new SettingsUtils();
|
|
|
|
|
|
ViewModel = new PowerOcrViewModel(
|
|
|
|
|
|
settingsUtils,
|
|
|
|
|
|
SettingsRepository<GeneralSettings>.GetInstance(settingsUtils),
|
2022-10-13 09:46:30 +02:00
|
|
|
|
SettingsRepository<PowerOcrSettings>.GetInstance(settingsUtils),
|
2022-08-25 05:25:52 -05:00
|
|
|
|
ShellPage.SendDefaultIPCMessage);
|
|
|
|
|
|
DataContext = ViewModel;
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
2022-12-28 19:54:59 +01:00
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
}
|
2022-08-25 05:25:52 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|