You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to subclass ScrollView, and while that works fine, I'm not able to change DefaultStyleKey to my own style from Generic.xaml. When I set it to my own type, OnApplyTemplate is never called and the control fails to render.
Create a new templated control and inherit from ScrollView.
Set the DefaultStyleKey to the type of the control
Define a matching style in Generic.xaml (it can just be the default scrollview template with the type parameters changed).
Run sample and observe OnApplyTemplate is not hit in the custom control (and attached sample renders the red background)
Remove the "DefaultStyleKey" setter in the constructor and notice that OnApplyTemplate is not hit and the template from the ScrollView baseclass is applied instead (attached sample now renders green).
Expected behavior
The custom template is applied so that we can easily attach additional behavior to scrollview
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003
Windows version
Windows 11 (24H2): Build 26100
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
I was trying to subclass ScrollView, and while that works fine, I'm not able to change
DefaultStyleKey
to my own style from Generic.xaml. When I set it to my own type, OnApplyTemplate is never called and the control fails to render.Steps to reproduce the bug
or:
OnApplyTemplate
is not hit in the custom control (and attached sample renders the red background)Expected behavior
The custom template is applied so that we can easily attach additional behavior to scrollview
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003
Windows version
Windows 11 (24H2): Build 26100
Additional context
No response
The text was updated successfully, but these errors were encountered: