Closed eyalkapah closed 4 years ago
@eyalkapah I am not able to reproduce this issue. Is PrimaryButtonStyle a style you have provided ? Can you attach a repro app ?
@ranjeshj please follow the link for repro
https://github.com/eyalkapah/ContentDialogBug
notice that the problem is on 14393 only.
Thanks,
@eyalkapah the primary button style api was introduced with v10.0.15063.0 so unfortunately you will not be able to get this to work on 14393 and we won't be able to address the bug. However with WinUI 3.0 this will no longer be an issue. I would suggest making a version check within your app code before making this call. https://docs.microsoft.com/en-us/uwp/api/windows.foundation.metadata.apiinformation
isn't the purpose of the library? bring features to earlier versions?
"Updated versions of existing controls: The library also contains updated versions of existing Windows platform controls that you can use with earlier versions of Windows 10."
@eyalkapah ContentDialog is a type from coming from the OS, not WinUI2 codebase (hint that it is Windows.UI.Xaml.Controls.ContentDialog and not Microsoft.UI.Xaml..) hence the issue with that not working downlevel. The plan is to move those types here in WinUI3 so you won't hit this then.
Describe the bug Cannot set PrimaryButtonStyle on a ContentDialog via code.
gets an exception:
System.InvalidCastException: 'Unable to cast object of type 'Windows.UI.Xaml.Controls.ContentDialog' to type 'Windows.UI.Xaml.Controls.IContentDialog2'.'
Steps to reproduce the bug Define a ContentDialog in code and try set its PrimaryButtonStyle.
Expected behavior Primary button will get the requested style.
Version Info
NuGet package version: Microsoft.UI.Xaml 2.1.190606001
Additional context The problems occurs on 14393. Although it should work since target version is 17763