wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

Visual Studio will not show resource names intelligence when using the new resource merging style

Open walterlv opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

In the previous version 1.2.7, we merge resources using the ResourceDictionary:

<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Styles/Theme/Dark.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Styles/Wpf.Ui.xaml" />

After upgrading the WPFUI to 2.0.1, it introduced a new style like this:

<winui:Resources Theme="Dark" />

But the Visual Studio does not recognize it so we will not get the resource names in the intelligence.

d:ResourceDictionary is not supported right now so the workaround below is invalid:

<d:ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Styles/Theme/Dark.xaml" />
<d:ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Styles/Wpf.Ui.xaml" />
<winui:Resources Theme="Dark" />

Describe the solution you'd like

Idk. Maybe we have to give up the new style?

Describe alternatives you've considered

Additional context

It now only contains the resources that are defined in my project only.

image

walterlv avatar Jun 24 '22 04:06 walterlv

Yep, I also noticed that.

MajorXAML avatar Jun 24 '22 15:06 MajorXAML

I'll try to somehow improve this Resource class. It is not essential, you don't even have to use it, but in my opinion it is much more elegant and easy to understand for beginners. If I can't do anything to have it automatically load DynamicResource, we'll roll back to the old method

pomianowski avatar Jun 24 '22 15:06 pomianowski