One more fix for dialogs.
This commit is contained in:
@@ -13,6 +13,16 @@
|
|||||||
<EnableMsixTooling>true</EnableMsixTooling>
|
<EnableMsixTooling>true</EnableMsixTooling>
|
||||||
<WindowsSdkPackageVersion>10.0.19041.35-preview</WindowsSdkPackageVersion>
|
<WindowsSdkPackageVersion>10.0.19041.35-preview</WindowsSdkPackageVersion>
|
||||||
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
|
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
|
||||||
|
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
|
||||||
|
<AppxPackageSigningEnabled>False</AppxPackageSigningEnabled>
|
||||||
|
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
|
||||||
|
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
|
||||||
|
<AppxPackageDir>C:\Users\bkaan\Desktop\Packages\WinUI\</AppxPackageDir>
|
||||||
|
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
|
||||||
|
<GenerateTestArtifacts>True</GenerateTestArtifacts>
|
||||||
|
<AppxBundle>Always</AppxBundle>
|
||||||
|
<AppxBundlePlatforms>x86|x64|arm64</AppxBundlePlatforms>
|
||||||
|
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="AppThemes\Custom.xaml" />
|
<None Remove="AppThemes\Custom.xaml" />
|
||||||
|
|||||||
@@ -56,19 +56,19 @@ namespace Wino.Services
|
|||||||
RequestedTheme = _themeService.RootTheme.ToWindowsElementTheme()
|
RequestedTheme = _themeService.RootTheme.ToWindowsElementTheme()
|
||||||
};
|
};
|
||||||
|
|
||||||
#if NET8_0
|
|
||||||
AssignXamlRoot(dialog);
|
AssignXamlRoot(dialog);
|
||||||
#endif
|
|
||||||
|
|
||||||
await HandleDialogPresentation(() => dialog.ShowDialogAsync(title, message));
|
await HandleDialogPresentation(() => dialog.ShowDialogAsync(title, message));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AssignXamlRoot(ContentDialog dialog)
|
private void AssignXamlRoot(ContentDialog dialog)
|
||||||
{
|
{
|
||||||
|
#if NET8_0
|
||||||
if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
|
if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
|
||||||
{
|
{
|
||||||
dialog.XamlRoot = (_appShellService.AppWindow.Content).XamlRoot;
|
dialog.XamlRoot = (_appShellService.AppWindow.Content).XamlRoot;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -82,9 +82,8 @@ namespace Wino.Services
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#if NET8_0
|
|
||||||
AssignXamlRoot(dialog);
|
AssignXamlRoot(dialog);
|
||||||
#endif
|
|
||||||
return await dialog.ShowAsync();
|
return await dialog.ShowAsync();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -131,6 +130,8 @@ namespace Wino.Services
|
|||||||
RequestedTheme = _themeService.RootTheme.ToWindowsElementTheme()
|
RequestedTheme = _themeService.RootTheme.ToWindowsElementTheme()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AssignXamlRoot(dialog);
|
||||||
|
|
||||||
return await HandleDialogPresentation(() => dialog.ShowDialogAsync(title, question, confirmationButtonTitle));
|
return await HandleDialogPresentation(() => dialog.ShowDialogAsync(title, question, confirmationButtonTitle));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,6 +167,8 @@ namespace Wino.Services
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AssignXamlRoot(dialog as ContentDialog);
|
||||||
|
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,6 +363,7 @@ namespace Wino.Services
|
|||||||
public async Task<AccountSignature> ShowSignatureEditorDialog(AccountSignature signatureModel = null)
|
public async Task<AccountSignature> ShowSignatureEditorDialog(AccountSignature signatureModel = null)
|
||||||
{
|
{
|
||||||
SignatureEditorDialog signatureEditorDialog;
|
SignatureEditorDialog signatureEditorDialog;
|
||||||
|
|
||||||
if (signatureModel != null)
|
if (signatureModel != null)
|
||||||
{
|
{
|
||||||
signatureEditorDialog = new SignatureEditorDialog(signatureModel)
|
signatureEditorDialog = new SignatureEditorDialog(signatureModel)
|
||||||
|
|||||||
Reference in New Issue
Block a user