locked
Xamarin Forms previewer does not preview if I use custom control RRS feed

  • Question

  • User71545 posted

    Just installed latest bits of Xamarin Studio v6.1 which supports and provides Xamarin Forms Previewer.

    When I open up a XAML file where I have used a simple custom control and it gives me error (does not go away if I clean / rebuild / build)

    Reason to post this and ask is because I read this line in updates announcements - "In addition to the standard controls, the Previewer has support for loading and executing custom controls and custom renderers live."

    https://blog.xamarin.com/major-updates-ios-10-android-nougat-and-other-tasty-bits/

    Attached screenshots for details.

    Any one?

    Wednesday, September 14, 2016 1:39 AM

Answers

  • User150584 posted

    @Jsinh Glad I could help :smile:

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, September 22, 2016 3:24 PM

All replies

  • User150584 posted

    I'm seeing the exact same problem. I found there were 2 issues, both related to my App.xaml file:

    1) I'd missed the ;assembly=[assemblyname] part off the local namespace 2) I had to change references to resources defined in App.xaml from {StaticResource} to {DynamicResource}.

    The form then rendered.

    The first issue is fair enough, it couldn't resolve the type, but I don't know why the resources must be referenced using {DynamicResource}. That seems odd.

    Wednesday, September 14, 2016 12:43 PM
  • User71545 posted

    Hello @JohnDB thanks for the hint, it helps to resolve basic issues for previewer to work.

    Now I am stuck at second level. Previewer is not showing custom control, instead show blank space in that region. Eg: xmlns:xamControls="clr-namespace:ImageCircle.Forms.Plugin.Abstractions;assembly=ImageCircle.Forms.Plugin.Abstractions"

    Any further hints? Anyone facing similar issues? Callout for help, thanks!

    Tuesday, September 20, 2016 11:18 PM
  • User71545 posted

    To add to previous comment. It was my mistake. If I do not have design data available to bind with it will offcourse show blank space instead. After setting up some mock data to consume at design time. I was able to see preview properly.

    Thanks again @JohnDB for the answer.

    I do not see any options to accept your reply as answer. Not sure how to close this thread / question.

    Thursday, September 22, 2016 3:14 PM
  • User150584 posted

    @Jsinh Glad I could help :smile:

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, September 22, 2016 3:24 PM