arklumpus / AvaloniaColorPicker

A color picker for Avalonia
GNU Lesser General Public License v3.0
79 stars 6 forks source link

1.3.1 doesn't work #5

Closed INTERNALINTERFERENCE closed 2 years ago

INTERNALINTERFERENCE commented 2 years ago

I tried to use color picker but I got the error - System.InvalidOperationException: This operation is not supported for a relative URI. How to fix it? image

INTERNALINTERFERENCE commented 2 years ago

https://github.com/arklumpus/AvaloniaColorPicker/blob/main/AvaloniaColorPicker/Colours.cs#L97-L107 I don't have <FluentTheme Mode="Light"/> in my code that is why I get System.InvalidOperationException: This operation is not supported for a relative URI.

arklumpus commented 2 years ago

Hi, thanks for noticing this!

The real issue is that you must have a StyleInclude in the App.xaml file, that references a style file using a relative source Uri (e.g., you have <StyleInclude Source="/Asset.xaml"/> instead of <StyleInclude Source="avares://YourAssemblyName/Asset.xaml"/>). As a result, when that code tries to access the AbsoluteUri property of the Source Uri object, an exception is thrown.

This should be fixed in version 1.3.2, please have a look at that!

INTERNALINTERFERENCE commented 2 years ago

works good! Thanks for quick fix, I appreciate that