[Settings] [VCM] Allow selecting a picture for VCM camera mute when running elevated (#24247)

* Fix the issue of not being able to select an image for VCM
Camera mute while PowerToys is running elevated.

* change the buffer size for Path and filename

* move DLL import to native methods file

* Adding comment to rember to move back to WinUI3
when it is fixed

* making Dll Import methods internal

* changes from comments

* fix new c# errors

* Remove async
This commit is contained in:
sosssego
2023-03-21 22:59:45 +00:00
committed by GitHub
parent 061d724f44
commit c1a811c26a
4 changed files with 67 additions and 17 deletions

View File

@@ -30,7 +30,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
private Func<string, int> SendConfigMSG { get; }
private Func<Task<string>> PickFileDialog { get; }
private Func<string> PickFileDialog { get; }
private string _settingsConfigFileFolder = string.Empty;
@@ -39,7 +39,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
ISettingsRepository<GeneralSettings> settingsRepository,
ISettingsRepository<VideoConferenceSettings> videoConferenceSettingsRepository,
Func<string, int> ipcMSGCallBackFunc,
Func<Task<string>> pickFileDialog,
Func<string> pickFileDialog,
string configFileSubfolder = "")
{
PickFileDialog = pickFileDialog;
@@ -197,11 +197,11 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
RaisePropertyChanged(nameof(CameraImageOverlayPath));
}
private async void SelectOverlayImageAction()
private void SelectOverlayImageAction()
{
try
{
string pickedImage = await PickFileDialog().ConfigureAwait(true);
string pickedImage = PickFileDialog();
if (pickedImage != null)
{
CameraImageOverlayPath = pickedImage;