// 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 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.GetInstance(settingsUtils), SettingsRepository.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage, PickFileDialog); DataContext = ViewModel; InitializeComponent(); } } }