microsoft / VSExtensibility

A repo for upcoming changes to extensibility in Visual Studio, the new extensibility model, and language server protocol.
MIT License
351 stars 42 forks source link

Images are not shown in xaml file #396

Closed behrouz-rad-snkeos closed 1 week ago

behrouz-rad-snkeos commented 1 week ago

I tried different ways to show images in a xaml file but no chance. Here are different ways I tried, tested in both cases when "Build Action" of done.png is set to "None" and "Resource".

<Image Source="pack://application:,,,/Images/done.png" />
<Image Source="Images/done.png" />
matteo-prosperi commented 1 week ago

Hello, I guess you are using Remote UI from an out-of-process extension, right? If that is the case, this is a known limitation of Remote UI. I guess you could discover the full path of where your image is installed next to the extension, have that in your data context and databind Source to it. I haven't tried but it may work. VS 17.11 will have proper support for this scenario so, if you can wait until then, this will be achievable in a much simpler fashion. We will add documentation for the release but you can see an example of how it will be done in our 17.11 samples branch here.