mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
* [OOBE]Fix not shortcut not updating Fix for issue #20953. Activation key update in the OOBE window when the user changes it in the settings window. Add settings repository reference to the ViewModel constructor to use the repository settings object (and not create a second instance of it). * Fix for issue #20953. Unit test fixed.
48 lines
1.8 KiB
C#
48 lines
1.8 KiB
C#
// 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 System;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.PowerToys.Settings.UI.Library;
|
|
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
|
using Microsoft.UI.Xaml.Controls;
|
|
using Windows.Storage;
|
|
using Windows.Storage.Pickers;
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Views
|
|
{
|
|
public sealed partial class VideoConferencePage : Page
|
|
{
|
|
private VideoConferenceViewModel ViewModel { get; set; }
|
|
|
|
private static async Task<string> PickFileDialog()
|
|
{
|
|
FileOpenPicker openPicker = new FileOpenPicker();
|
|
openPicker.ViewMode = PickerViewMode.Thumbnail;
|
|
openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
|
|
openPicker.FileTypeFilter.Add(".jpg");
|
|
openPicker.FileTypeFilter.Add(".jpeg");
|
|
openPicker.FileTypeFilter.Add(".png");
|
|
var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(App.GetSettingsWindow());
|
|
WinRT.Interop.InitializeWithWindow.Initialize(openPicker, hwnd);
|
|
|
|
StorageFile file = await openPicker.PickSingleFileAsync();
|
|
return file?.Path;
|
|
}
|
|
|
|
public VideoConferencePage()
|
|
{
|
|
var settingsUtils = new SettingsUtils();
|
|
ViewModel = new VideoConferenceViewModel(
|
|
settingsUtils,
|
|
SettingsRepository<GeneralSettings>.GetInstance(settingsUtils),
|
|
SettingsRepository<VideoConferenceSettings>.GetInstance(settingsUtils),
|
|
ShellPage.SendDefaultIPCMessage,
|
|
PickFileDialog);
|
|
DataContext = ViewModel;
|
|
InitializeComponent();
|
|
}
|
|
}
|
|
}
|