I am getting a XAMLParseException when trying to load a xaml component with a Loaded event. I am not quite sure how write the method signature for the handled event. C# examples are clear but I'm not sure how to convert this to the F# version. I will include my first attempt below.
ViewModel code:
let theWindow = Application.LoadComponent(new Uri("/MyApp;component/MyWindow.xaml", UriKind.Relative)) :?> Window
XAML Header:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:MyApp.Converters;assembly=MyApp"
xmlns:local="clr-namespace:MyApp;assembly=MyApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
x:Name="_theWindow"
WindowStartupLocation="CenterOwner"
Title="My App - Popup Window"
Loaded="Window_Loaded"
Icon="MyApp;component/icons/MyApp.ico"
Width="484.667" Height="215.333"
Left="100" Top="100">
F# method:
member x.Window_Loaded (sender : object, eventArgs : RoutedEventArgs) = // Do stuff