Solitaire
Solitaire copied to clipboard
ResourceDictionaries can't be previewed without Desgin.PreviewWith
I'm looking at the Solitaire example to learn Avalonia and the above error is throwing me off.
Can you add the necessary <Design.PreviewWith> to all the items in the Styles directory? For example, ButtonCard.axaml:
<Design.PreviewWith>
<Border Padding="20" Background="Gray">
<Button Content="Button" />
</Border>
</Design.PreviewWith>
As an alternate approach, I suggest adding DevTools to the main Solitaire project via:
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
Run Solitaire.Desktop in debug mode and press F12 to launch. See the Developer Tools docs for details. This will help identify visual components, especially in the Visual Tree tab. Personally, I almost never use the previewer, but I can see why learners would want it.