Skip to content

Troubleshooting

David Rettenbacher edited this page Nov 25, 2019 · 8 revisions

Xamarin.Forms: Templated Views Are Not Styled

Templated views need a workaround to be recognized by XamlCSS. Use the VisualTreeCell.Include attached property to "connect" the templated view to XamlCSS' UI tree.

<ListView ItemsSource="{Binding Items}">
    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell cssXF:VisualTreeCell.Include="True">
                ...
            </ViewCell>
         </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

or

<CollectionView ItemsSource="{Binding Items}">
    <CollectionView.ItemTemplate>
        <DataTemplate>
            <ContentView cssXF:VisualTreeCell.Include="True">
                ...
            </ContentView>
         </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

WPF/UWP/Xamarin.Forms (using LiveXAML): Designer/Previewer Doesn't Update

  • Check if there are any errors in your css (wrong selector, wrong variable-name,...)
  • Is your style defined as an resource in xaml so LiveXAML can pick is up?
  • Use "divide and conquer" until the view updates again
  • If your stylesheet is defined in another xaml file ** Is it referenced using a DynamicResource?

WPF/UWP Designer Doesn't Update

  • Restart the designer-process. Kill XDesProc.exe in your task-manager and click on "Reload designer" inside your designer window

LiveXAML Doesn't Update

  • Is the device-connection stable? (I had problems with adb over WLAN and flaky USB cable)
  • Is LiveXAML installed as stated on the official site?

I'm Getting An Exception On Startup

  • Did you call XamlCSS.<platform>.Css.Init(...) on the right place?

Imports Are Not Found

  • If it should be loaded from an embeded resource: Is the build-action set to Embedded Resource?
  • If it should be loaded from application's ResourceDictionary: Is the resource-key correct?
  • If it should be loaded from a file: Is the file under the given path and accessible?

"Method RemoveAttribute does not have an implementation"

XamlCSS 2.2.0 or higher:
This error is obsolete as of XamlCSS 2.2.0 as AngleSharp is no longer used!

XamlCSS 2.1.0 or lower:
Please check if the version of AngleSharp is the exact version that is listed on nuget
For XamlCSS 2.0.1 it is AngleSharp 0.9.8 (this can change in future versions).

UPDATE

XamlCSS 2.1.0 uses AngleSharp 0.9.9 and has fixed it to this version.