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

Using images that can't be found during design time crashes designer #543

Closed
bochelie1000 opened this issue Mar 9, 2018 · 8 comments
Closed
Assignees
Milestone

Comments

@bochelie1000
Copy link

bochelie1000 commented Mar 9, 2018

Hallo,

I tried to update from 6.0.0-dev0171 to a higher version and then I only get errrors. One of the errors I could detect is:
Severity Code Description Project File Line Suppression State
Error 'ComboBox' ControlTemplate TargetType does not match templated type 'ComboBox'.

I deleted all the Icons and now I get the Error:
Severity Code Description Project File Line Suppression State
Error Part URI cannot start with two forward slashes.

After this I removed all LargeIcons and then my project starts again. However it seems like it cant find any normal icon path.

I decided to try again and now I give the large Icon as:
LargeIcon=Images\past-48.png
This seems to work. However after debuging I still see an error:
Severity Code Description Project File Line Suppression State
Error Cannot locate resource 'images/past-48.png'.


Environment

  • from 6.0.0-dev0171 to higher
  • Windows 7
  • .NET Framework 4.5
@batzen
Copy link
Member

batzen commented Mar 9, 2018

Are your icons compiled as resource in your application assembly?

The converter which enables you to just say "images/myicon.png" checks if the file exists on disc, if the file is not on disc it just prepends "pack://application:,,,/" and tries to load that image.
As the images have to be sealed when being converted you get an exception if the resource could not be found.

You can always use the full resource syntax if you want to.
For example "pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/GrowFont.png"

@batzen
Copy link
Member

batzen commented Mar 9, 2018

If the images would not be sealed you risk getting this issue #493

@bochelie1000
Copy link
Author

bochelie1000 commented Mar 9, 2018

My images are on disk in my Images folder. If I use "pack://application:,,,/" in a DropDownButton which is the first control in a UserControl then it wont work either.
I guess this is the same issue #493.
I will wait until this is fixed prior to updating.

Thanks Batzen!

@batzen
Copy link
Member

batzen commented Mar 9, 2018

#493 is fixed and causes your issue. You only get that error during design-time, or?

@bochelie1000
Copy link
Author

It seems like that. As soon as the app starts the error is gone. When I stop the debug there it comes again.

@batzen
Copy link
Member

batzen commented Mar 10, 2018

Ok. Then in previous versions you just would have seen no icons in the designer. Will restore that behavior. Totally forgot about the designer on that one.

@batzen batzen added this to the 7.0.0 milestone Mar 10, 2018
@batzen batzen self-assigned this Mar 10, 2018
@batzen
Copy link
Member

batzen commented Mar 10, 2018

To clarify, this is a designer only issue.
@bochelie1000 How would you like the library to handle the case that an image could not be found during design time?
The options are:

  • Just show no image at all
  • Show a generic "missing image" image

@bochelie1000
Copy link
Author

bochelie1000 commented Mar 11, 2018

I think that showing a generic “missing image” will be more intuitive. Than you know its a recognized error.

@batzen batzen changed the title Error updating from 6.0.0-dev0171 to any higher version Using images that can't be found during design time crashes designer Mar 13, 2018
@batzen batzen closed this as completed in c286c7a Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants