2021-06-29 13:06:12 +03: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.
|
|
|
|
|
|
|
2021-07-23 16:59:22 +03:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2021-06-29 13:06:12 +03:00
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Library;
|
|
|
|
|
|
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
2022-04-19 22:00:28 +02:00
|
|
|
|
using Microsoft.UI.Xaml.Controls;
|
2021-07-23 16:59:22 +03:00
|
|
|
|
using Windows.Storage;
|
|
|
|
|
|
using Windows.Storage.Pickers;
|
2021-06-29 13:06:12 +03:00
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Views
|
|
|
|
|
|
{
|
|
|
|
|
|
public sealed partial class VideoConferencePage : Page
|
|
|
|
|
|
{
|
|
|
|
|
|
private VideoConferenceViewModel ViewModel { get; set; }
|
|
|
|
|
|
|
2021-07-23 16:59:22 +03:00
|
|
|
|
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");
|
2022-04-19 22:00:28 +02:00
|
|
|
|
var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(App.GetSettingsWindow());
|
|
|
|
|
|
WinRT.Interop.InitializeWithWindow.Initialize(openPicker, hwnd);
|
2021-07-23 16:59:22 +03:00
|
|
|
|
|
|
|
|
|
|
StorageFile file = await openPicker.PickSingleFileAsync();
|
|
|
|
|
|
return file?.Path;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-06-29 13:06:12 +03:00
|
|
|
|
public VideoConferencePage()
|
|
|
|
|
|
{
|
|
|
|
|
|
var settingsUtils = new SettingsUtils();
|
2022-10-13 09:46:30 +02:00
|
|
|
|
ViewModel = new VideoConferenceViewModel(
|
|
|
|
|
|
settingsUtils,
|
|
|
|
|
|
SettingsRepository<GeneralSettings>.GetInstance(settingsUtils),
|
|
|
|
|
|
SettingsRepository<VideoConferenceSettings>.GetInstance(settingsUtils),
|
|
|
|
|
|
ShellPage.SendDefaultIPCMessage,
|
|
|
|
|
|
PickFileDialog);
|
2021-06-29 13:06:12 +03:00
|
|
|
|
DataContext = ViewModel;
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|