Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Some improvements that may be necessary #15

Open
ChasakisD opened this issue Nov 5, 2018 · 3 comments
Open

[Enhancement] Some improvements that may be necessary #15

ChasakisD opened this issue Nov 5, 2018 · 3 comments

Comments

@ChasakisD
Copy link

Hi @ylatuya,

I would like to say that this library is awesome and I would like to say thank you for that.

ControlTemplate

I am using ControlTemplate to some pages and it seems that it cannot find the getter. The stacktrace i've got in the screen is:

Xamarin.Forms.Xaml.XamlParseException: Position 2:635.
Property ControlTemplate is not found or does not have an accessible getter
at
Xamarin.Forms.Xaml.ApplyPropertiesVisitor.GetPropertyValye(System.Object xamlElement, Xamarin.Forms.Xaml.XmlName propertyName, Xamarin.Forms.Xaml.HydrationContext context, System.Xml.IXmlLineInfo lineInfo, System.Object& targetProperty) [0x00095] in D:\a\1\s\Xamarin.Forms.Xaml\ApplyPropertiesVisitor.cs:377
at
Xamarin.Forms.Xaml.ApplyPropertiesVisitor.TryAddToProperty (it got cut here)

DesignInstance

Furthermore, I am using Jetbrains Rider in order to get some Xaml Intellisense improvements and while I am setting the BindingContext at runtime(through a ViewModelLocator) i use

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DataContext="{d:DesignInstance typeHere}"
mc:Ignorable="d"

and i get this stacktrace on screen:

Xamarin.Forms.Xaml.XamlParseException: Position 2:774.
MarkupExtension not found for d:DesignIntance
at
Xamarin.Forms.Xaml.ExpandMarkupsVisitor+MarkupExpansionParser.Parse(System.String match, System.String& remaining, System.IServiceProvider serviceProvider) [0x000e4] in D:\a\1\s\Xamarin.Forms.Xaml\ExpandMarkupsVisitor.cs:144
at
Xamarin.Forms.Xaml.ExpandMarkupsVisitor.ParseExpression(System.String& expression, System.Xml.IXmlNamespaceResolver nsResolver, System.Xml.IXmlLineInfo (it got cut here)

FYI, i've got this binding warning with LogWarningsToApplicationOutput = true;

Binding: 'CloseCommand' property not found on 'XAMLator.Server.ErrorViewModel', target property: 'Xamarin.Forms.Button.Command'

I will take a look at the code and may contribute fixing those issues.

Last but not least, I have never worked with VS Extension Development but I would like to start and help to develop the XAMLator VS 2017 Extension, just to make the Xamarin Development much easier 🙂

Thanks again for all your effort

@ylatuya
Copy link
Owner

ylatuya commented Nov 5, 2018

Hi!
Thanks for your feedback!
I believe the CloseCommand error would be the easier one to fix. The ErrorViewModel is missing that command property and it should be set before the preview, here:
https://github.com/ylatuya/XAMLator/blob/master/XAMLator.Server.Shared/Previewer.cs#L62
Using the command created here:
https://github.com/ylatuya/XAMLator/blob/master/XAMLator.Server.Shared/Previewer.cs#L25

For the DesingInstance instance we might need to register that extension somehow but I don't know how to do it honestly.

For the ControlTemplate issue, it's probably because pages are previewed with the PreviewPage class, which might not be supporting it, we should find a way to support it correctly.

@ChasakisD
Copy link
Author

ChasakisD commented Nov 5, 2018

I will look to the binding warning, as far as I've got some free time.

During some research, ControlTemplate appears on the TemplatedPage which inherits from Page, while the PreviewPage is MultiPage< Page > and not MultiPage< TemplatedPage >

@ylatuya
Copy link
Owner

ylatuya commented Nov 5, 2018

A solution would be to add the bindable property to the PreviewPage and forward it to the child page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants