FsXaml
FsXaml copied to clipboard
A case where XAML event is not found
Description
There was no handler to override when the XAML looked like this.
<MenuItem Header="{Binding Source={x:Static lang:Resources.Exit}}" Click="MnExitClick"/>
The error message from the compiler was: "No abstract or interface member was found that corresponds to this override."
type MainWindowXaml = XAML<"Xaml/MainWindow.xaml">
type MainWindow() =
inherit MainWindowXaml()
override x.MnExitClick (o, e) = x.Close()
Known workarounds
I moved the handler declaration to the front, like this, and then it compiled and ran successfully.
<MenuItem Click="MnExitClick" Header="{Binding Source={x:Static lang:Resources.Exit}}"/>
Related information
Windows 10. VS 2015 with Update 3. NET Framework 4.5.2. FsXaml 3.1.6.