Open Dakar2008Inropa opened 1 month ago
The known issue has been fixed in 11.2-beta1
.
Workaround, add the code as follows to your user control
public static void AddLoadedHandler(Interactive element, EventHandler<RoutedEventArgs> handler)
{
element.AddHandler(LoadedEvent, handler);
}
Describe the bug
When trying to use AttachedToVisualTree or Loaded on a UserControl element it gives an Invalid Markup in the axaml designer.
To Reproduce
<UserControl xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="AvaloniaPad.MainView" Name="MainViewUC" Loaded="UserControl_Loaded"></UserControl>
Expected behavior
No response
Avalonia version
11.1.3
OS
Windows
Additional context
No response