Error with previewer

Hi,

I have an error with the previewer. Code works fine but have no preview available.

Here is the code :

<Window xmlns="http://schemas.alternetsoft.com/ui/2021"
        xmlns:x="http://schemas.alternetsoft.com/ui/2021/uixml"
        x:Class="Mig2AlternetUI.MainWindow"
        Title="Mig2AlternetUI"
		Width="400" Height="600">
	<StackPanel Orientation="Vertical" Padding="10" Grid.Column="0">
		<Label Text="C# Project Path :" />
		<TextBox Text="Enter Project path" Name="txtboxPath" Margin="0,0,50,0" TextChanged="txtboxPath_TextChanged" MouseLeftButtonDown="txtboxPath_Click"/>
		<Button Text="..." Name="btnPath" Margin="318,-23,0,0" Width="10" Click="btnPath_Click"/>
		<Button Text="Create Report" Name="btnReport" Click="btnReport_Click"/>
		<TextBox Text="" Name="txtboxDebug" Height="445" Multiline="True"/>
		<Label Text="" Name="lblResult" Margin="4"/>
		<Label Text="" Name="lblOutput" Margin="4,0,0,0"/>
	</StackPanel>
</Window>

Here is error : 

System.Xaml.XamlException: ‘Unable to find suitable setter or adder for property MouseLeftButtonDown of type Alternet.UI:Alternet.UI.UIElement for argument System.Private.CoreLib:System.String, available setter parameter lists are:
Alternet.UI.MouseButtonEventHandler Line 8, position 111.
at XamlX.Transform.Transformers.ConvertPropertyValuesToAssignmentsTransformer.<>c__DisplayClass0_3.g__CreateAssignment|1(<>c__DisplayClass0_0& , <>c__DisplayClass0_1& , <>c__DisplayClass0_2& )
at XamlX.Transform.Transformers.ConvertPropertyValuesToAssignmentsTransformer.Transform(AstTransformationContext context, IXamlAstNode node)
at XamlX.Transform.AstTransformationContext.Visitor.Visit(IXamlAstNode node)
at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor)
at XamlX.Ast.XamlAstNode.VisitList[T](IList1 list, IXamlAstVisitor visitor) at XamlX.Ast.XamlAstObjectNode.VisitChildren(IXamlAstVisitor visitor) at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor) at XamlX.Ast.XamlAstNode.VisitList[T](IList1 list, IXamlAstVisitor visitor)
at XamlX.Ast.XamlPropertyAssignmentNode.VisitChildren(IXamlAstVisitor visitor)
at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor)
at XamlX.Ast.XamlAstNode.VisitList[T](IList1 list, IXamlAstVisitor visitor) at XamlX.Ast.XamlManipulationGroupNode.VisitChildren(IXamlAstVisitor visitor) at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor) at XamlX.Ast.XamlAstNode.VisitList[T](IList1 list, IXamlAstVisitor visitor)
at XamlX.Ast.XamlAstObjectNode.VisitChildren(IXamlAstVisitor visitor)
at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor)
at XamlX.Ast.XamlAstNode.VisitList[T](IList1 list, IXamlAstVisitor visitor) at XamlX.Ast.XamlPropertyAssignmentNode.VisitChildren(IXamlAstVisitor visitor) at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor) at XamlX.Ast.XamlAstNode.VisitList[T](IList1 list, IXamlAstVisitor visitor)
at XamlX.Ast.XamlAstObjectNode.VisitChildren(IXamlAstVisitor visitor)
at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor)
at XamlX.Compiler.XamlCompiler2.Transform(XamlDocument doc, Boolean strict) at Alternet.UI.Markup.Xaml.XamlIl.CompilerExtensions.UixmlPortXamlIlCompiler.ParseAndCompile(String xaml, String baseUri, IFileSource fileSource, IXamlTypeBuilder1 tb, IXamlType overrideRootType)
at Alternet.UI.Markup.Xaml.XamlIl.UixmlPortXamlIlRuntimeCompiler.LoadSreCore(String xaml, Assembly localAssembly, Object rootInstance, Uri uri, Boolean isDesignMode)
at Alternet.UI.Markup.Xaml.XamlIl.UixmlPortXamlIlRuntimeCompiler.LoadSre(String xaml, Assembly localAssembly, Object rootInstance, Uri uri, Boolean isDesignMode)
at Alternet.UI.Markup.Xaml.XamlIl.UixmlPortXamlIlRuntimeCompiler.Load(Stream stream, Assembly localAssembly, Object rootInstance, Uri uri, Boolean isDesignMode)
at Alternet.UI.Markup.Xaml.UixmlPortRuntimeXamlLoader.Load(Stream stream, Assembly localAssembly, Object rootInstance, Uri uri, Boolean designMode)
at Alternet.UI.UixmlLoader.Load(Stream xamlStream, Assembly localAssembly)
at Alternet.UI.Integration.UIXmlPreviewerService.LoadControlFromUixml(IDictionary2 parameters) at Alternet.UI.Integration.UIXmlPreviewerService.ProcessUixmlUpdate(IDictionary2 parameters)’ numéro de ligne ‘8’ et position de ligne ‘111’.


Error come from "MouseLeftButtonDown" semms to be not "understand" by previewer.

Thank you for your help.

NeoXeo

Hi,

Can you tell me if you reproduce this error and if you have a solution or an approximate date to correct this ?

Thanks.

NeoXeo

Hi NeoXeo,

We reproduced this problem when editing this UIXML, and it seems to be related to the MouseLeftButtonDown event handler. If you define the event handler itself like this, the preview seems to work correctly. We will try to fix this issue very shortly.

    private void TxtboxPath_MouseLeftButtonDown(object sender, Alternet.UI.MouseButtonEventArgs e)
    {
        
    }

Kind regards,
Dmitry

Hi Dmitry,

I have try this without success. I have opened an issue on github repository of Alternet-UI.

Regards,
NeoXeo

I have updated issue on AlterNet UI GitHub repository with version 0.9.153. Error still present and solution to declare event handler into code doesn’t work.
Thank for your help.