FsXaml icon indicating copy to clipboard operation
FsXaml copied to clipboard

A case where XAML event is not found

Open BentTranberg opened this issue 7 years ago • 0 comments

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.

BentTranberg avatar Aug 17 '17 15:08 BentTranberg