lepoco / wpfui

WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
https://wpfui.lepo.co
MIT License
7.67k stars 748 forks source link

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

Open walterlv opened 2 years ago

walterlv commented 2 years ago

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

MajorXAML commented 2 years ago

Yep, I also noticed that.

pomianowski commented 2 years ago

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