wpf - VS2008 XAML Designer exception "Key cannot be null" when using default styles from a ResourceDictionary -


i am using a shared resource tool to define the default styles and Visual Studio Aksamel Designer 2008 I am struggling big. key can not be null merged into XAML design is visible to all efforts to show the footage can be

use dictionary App.xaml (all windows) And has many styles of default setting for control, so they shown without a key are below them. If you add X: the main feature for styles, they are no longer applicable by default. I do not want to put a clear style segment on every control, but it seems I can have to do this.

  & lt; ResourceDictionary xmlns = "http://schemas.microsoft.com/ Winfx / 2006 / xaml / Presentation" xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml" & gt; & Lt; Style x: key = "windowStyle" TargetType = "{x: type window}" & gt; & Lt; Setter property = "background" value = "light gray" /> & Lt; / Style & gt; & Lt; Style TargetType = "{x: type text box}" & gt; & Lt; Setter Property = "Background" Value = "Alice Blue" /> & Lt; Setter property = "height" value = "23" /> & Lt; / Style & gt; & Lt; / ResourceDictionary & gt;  

Full exception error message with stack:

  key can not be empty. Parameter name: System.Collections.Hashtable.get_Item (Object key MS.Internal.Xaml.AssemblyNode.For on MS.Internal.Xaml.ReflectionProjectNode.LoadAssembly) (assembly constituency, Boolean includeInternal) key (AssemblyName name, Boolean includeInternal) MS.Internal.Xaml.ReflectionProjectNode.BuildAssemblies () on MS.Internal.Xaml.ReflectionProjectNode.BuildSubsumption () MS.Internal.Xaml.ReflectionProjectNode.Subimming namespace (identifier identifier) ​​MS.Internal.Xaml.XmlElement.BuildScope on ( PrefixScope) MS.Internal.Xaml.XmlElement.FindElementType (Preefikssscop parent Scope MS.Internal.DocumentTrees.Markup.XamlSourceDocument.get_RootType () Microsoft, Aiprs Kansa Rules Context context) parents, Aipiarsii reference reference) .Design. Document. TS MarkupDocumentationTreeManager.Get_AroutType (Microsoft.Windows.Design.Documents.MarkupDocumentManager.get_LoadState at Microsoft.Windows.Design.Documents.MarkupDocumentManager.CalculateLoadErrorState ()) on MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load MS.Internal Designer.VSDesigner.Load () on MS.Internal.Host.Designer.Load () t MS.Internal.Host.PersistenceSubsystem.Load (()) MS.Internal on MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load. On Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner (IsolatedDesignerFactory Factory, IsolatedView View) on MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy (see IsolatedView). LoadDesigner MS.Internal.Designer.DesignerPane.LoadDesignerView at MS.Internal.Host.Isolation.IsolatedDesigner.Load ((See IsolatedDesignerFactory factory, IsolatedView) (at least)  

I'm not sure why this will be an important requirement, but you can try the following

  & Lt; Style X: key = "{x: type text box}" target type = "{x: type text box}" & gt;  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -