简体   繁体   中英

Visual Studio Custom Window for VSIX using WPF Can't find theme in other project

I developed a stand alone WPF project with the ShinyBlue.xaml theme which works fine. Now I want to create a VSIX project to include some user controls from that project right in Visual Studio.

在此处输入图片说明

Problem

The VSIX project XAML shows the error above. Where poc:UCMAIN is a user control in the first project that works perfect!

Possible Solutions

  1. Get rid of my styling in first project that required a static resource due to the stlye based on property. I don't want that because I won't get the color. Not a good solution.
  2. Copy the theme into the VSIX project and try to get is found there. Problem with that is there is not app.config file in VSIX projects. I can add a merged dictionary to the VSIX project main window but.... it still doen't locate the BlueButton Resource.

Question

Why does VSIX project show the error above? How do I fix it?

Solution VSIX custom windows doesn't appear to reach into the other included Project's XAML resource directories. Even when the merged dictionary points to the theme.

I was using global styling with the targetType parameter and the basedOn parameter specifying a key I placed into the theme to "grab" that color for those buttons.

  1. I removed the key value
  2. I moved command parameter bindings from the resources styling area to be contained in each button.
  3. Themes may be used but the Main.XAML control must merge the theme dictionary instead of the app.config file which is not present in VSIX Tool Window solutions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM