FsXaml generates overridable event handler methods when event handlers are set from XAML. That does not work when in the same XAML element an attribute using a markup extension appears before the attribute setting the event handler.
Repro steps
In the XAML element for a control that has an event handler set from XAML, put an attribute using a markup extension before the event handler attribute.
FsXaml generates a virtual method for the event handler that can be overriden in a derived class.
Actual behavior
FsXaml does not generate the virtual method, and attempting to override it results in a compiler error. The specific markup extension does not appear to be important; the behavior is the same for x:Static, StaticResource and DynamicResource.
Known workarounds
Reorder the attributes, so that the event handler is set before any attributes using markup extensions.
Related information
FsXaml 3.1.6
FSharp.Core 4.3.4
Visual Studio 2017 15.5.7
.NET 4.7.1
Description
FsXaml generates overridable event handler methods when event handlers are set from XAML. That does not work when in the same XAML element an attribute using a markup extension appears before the attribute setting the event handler.
Repro steps
(A reproduction can be found at https://github.com/TeaDrivenDev/FsXaml_MarkupExtension_Event in
MainWindow.xaml
.)Expected behavior
FsXaml generates a virtual method for the event handler that can be overriden in a derived class.
Actual behavior
FsXaml does not generate the virtual method, and attempting to override it results in a compiler error. The specific markup extension does not appear to be important; the behavior is the same for
x:Static
,StaticResource
andDynamicResource
.Known workarounds
Reorder the attributes, so that the event handler is set before any attributes using markup extensions.
Related information
FsXaml 3.1.6 FSharp.Core 4.3.4 Visual Studio 2017 15.5.7 .NET 4.7.1