wieslawsoltes / PanAndZoom

Pan and zoom control for Avalonia.
http://wieslawsoltes.github.io/PanAndZoom/
MIT License
345 stars 45 forks source link

Is it possible to support Preview with AvaloniaRider plugin #56

Closed squirrelfeng closed 2 years ago

squirrelfeng commented 2 years ago

Hi, good tool, thanks! But when I use it in my axaml, AvaloniaRider plugin is unable to preview design, it gives below warning:

Is it possible to be compatible? Thanks!

XamlParseException at 136:8: Unable to resolve type ZoomBorder from namespace using:Avalonia.Controls.PanAndZoom Line 136, position 8. XamlX.XamlParseException: Unable to resolve type ZoomBorder from namespace using:Avalonia.Controls.PanAndZoom Line 136, position 8. at XamlX.Transform.Transformers.TypeReferenceResolver.ResolveTypeCore(AstTransformationContext context, String xmlns, String name, Boolean isMarkupExtension, List`1 typeArguments, IXamlLineInfo lineInfo, Boolean strict) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Transform/Transformers/TypeReferenceResolver.cs:line 109 at XamlX.Transform.Transformers.TypeReferenceResolver.ResolveType(AstTransformationContext context, String xmlns, String name, Boolean isMarkupExtension, List`1 typeArguments, IXamlLineInfo lineInfo, Boolean strict) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Transform/Transformers/TypeReferenceResolver.cs:line 41 at XamlX.Transform.Transformers.TypeReferenceResolver.ResolveType(AstTransformationContext context, XamlAstXmlTypeReference xmlref, Boolean strict) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Transform/Transformers/TypeReferenceResolver.cs:line 147 at XamlX.Transform.Transformers.TypeReferenceResolver.Transform(AstTransformationContext context, IXamlAstNode node) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Transform/Transformers/TypeReferenceResolver.cs:line 141 at XamlX.Transform.AstTransformationContext.Visitor.Visit(IXamlAstNode node) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Transform/AstTransformationContext.cs:line 62 at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Ast/Common.cs:line 67 at XamlX.Ast.XamlAstObjectNode.VisitChildren(IXamlAstVisitor visitor) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Ast/Xaml.cs:line 76 at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Ast/Common.cs:line 67 at XamlX.Ast.XamlAstNode.VisitList[T](IList`1 list, IXamlAstVisitor visitor) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Ast/Common.cs:line 74 at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Ast/Common.cs:line 67 at XamlX.Ast.XamlAstNode.VisitList[T](IList`1 list, IXamlAstVisitor visitor) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Ast/Common.cs:line 74 at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Ast/Common.cs:line 67 at XamlX.Ast.XamlAstNode.VisitList[T](IList`1 list, IXamlAstVisitor visitor) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Ast/Common.cs:line 74 at XamlX.Ast.XamlAstNode.Visit(IXamlAstVisitor visitor) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Ast/Common.cs:line 67 at XamlX.Compiler.XamlCompiler`2.Transform(XamlDocument doc, Boolean strict) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github/src/XamlX/Compiler/XamlCompiler.cs:line 67 at Avalonia.Markup.Xaml.XamlIl.CompilerExtensions.AvaloniaXamlIlCompiler.ParseAndCompile(String xaml, String baseUri, IFileSource fileSource, IXamlTypeBuilder`1 tb, IXamlType overrideRootType) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/AvaloniaXamlIlCompiler.cs:line 110 at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.LoadSreCore(String xaml, Assembly localAssembly, Object rootInstance, Uri uri, Boolean isDesignMode) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/AvaloniaXamlIlRuntimeCompiler.cs:line 197 at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.LoadSre(String xaml, Assembly localAssembly, Object rootInstance, Uri uri, Boolean isDesignMode) in /_/src/Markup/Avalonia.Markup.Xaml.Loader/AvaloniaXamlIlRuntimeCompiler.cs:line 167 at Avalonia.DesignerSupport.DesignWindowLoader.LoadDesignerWindow(String xaml, String assemblyPath, String xamlFileProjectPath) in /_/src/Avalonia.DesignerSupport/DesignWindowLoader.cs:line 88 at Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.<>c__DisplayClass17_0.<OnTransportMessage>b__0() in /_/src/Avalonia.DesignerSupport/Remote/RemoteDesignerEntryPoint.cs:line 245
izaksuilov commented 2 years ago

Had the same problem, @squirrelfeng. The solution is to use xmlns:paz="clr-namespace:Avalonia.Controls.PanAndZoom;assembly=Avalonia.Controls.PanAndZoom" instead of xmlns:paz="using:Avalonia.Controls.PanAndZoom"

@wieslawsoltes you should update readme in section "Using PanAndZoom" and can close this issue.

squirrelfeng commented 2 years ago

Thanks a lot!