External global and named Styles not displaying in Blend at design time


first, i've created dll storing styles, controltemplates, and other resources brushes , fonts.  dll not contain custom controls, within assembly.  assembly strictly control styles.  now, i've set project every control encapsulated 1 xaml file a resourcedictionary ease of organization.  button.base.xaml, tabcontrol.base.xaml, button.green.xaml, etc. 

now, in root of project single file named default.xaml, nothing more merge resources together.  have done couple reasons; 1) can merged default.xaml file application.resources merged dictionaries 1 line of code.  2) if ever skinning application, simple changes in brush resources, can create root file called green.xaml or red.xaml, point.  when application starts up, code can determine root xaml file merge application's resources.


example of default.xaml in the ui.resources.dll

<resourcedictionary   
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">  
 
 <resourcedictionary.mergeddictionaries> 
    <resourcedictionary source="resources/styles/brushes.controls.xaml" /> 
    <resourcedictionary source="resources/styles/brushes.shared.xaml" /> 
    <resourcedictionary source="resources/styles/button.base.xaml" /> 
    <resourcedictionary source="resources/styles/button.green.xaml" /> 
    <resourcedictionary source="resources/styles/checkbox.base.xaml" /> 
    <resourcedictionary source="resources/styles/typography.base.xaml" /> 
</resourcedictionary.mergeddictionaries> 
   
</resourcedictionary> 
 


and in app.xaml file of wpf application:

 <application.resources> 
  <resourcedictionary> 
   <resourcedictionary.mergeddictionaries> 
    <resourcedictionary source="pack://application:,,,/ui.resources;component/default.xaml" /> 
   </resourcedictionary.mergeddictionaries> 
  </resourcedictionary> 
 </application.resources> 


i'm trying move our teams designer/developer collaboration model.  in the designer/integrator/developer, integrator (a senior-level developer design background).  take designer's concepts (from either blend or ps or ai) , build out control styles; global styles core set , bunch of named styles variations.  developers add button or checkbox xaml, maybe reference staticresource style, , presto.  however, developers not great @ making screens good, , shouldn't concerned that.  thus, wpf , separation of ui/ux business logic.  trying our designers move blend world , start building screens developers don't have worry laying out pixel perfect visuals.  thus, problem...

i've set project in blend 1) reference the ui.resources.dll, 2) merge resources same way in application (see above).  when create simple window has nothing more than:

<grid>
    <button>test</button>
</grid>

...and run it, looks correct , displays our custom style button.  however, in blend designer window still see standard windows/wpf button visuals, project compiles successfully, , errors in app.xaml stating things "cannot locate resource typography.base.xmal."

how blend show correct visuals gloabl styles during design time? 

i have got working, copying on individual control style files project turns them "local" resources.  problem because 1) anytime update style or controltemplate made, or new style added, there's more work designer maintain these files rather replace dll. 2) have several xaml files (50+) and i've noticed blend starts dragging when add these merged dictionaries collection.

suggestions?

at run-time, able wire datacontext for user control using simple staticresource (e.g. clr object 1 property) defined in app.xaml , works great expected.

however, @ design-time in blend 3, user control displays error saying resource cannot found. believe bug in previous versions of blend why surprised see still exists in blend 3.

please see here same bug report year ago:
https://connect.microsoft.com/expression/feedback/viewfeedback.aspx?feedbackid=349905&wa=wsignin1.0

i agree user -- *critical* bug. requires me jump thru hoops both run-time , design-time data working. choice define object local staticresource, not intuitive or desirable in many situations.



Expression  >  Expression Blend + SketchFlow



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'