Click here to Skip to main content
15,904,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
CSS
if the XAML file is closed and you open it, the following message appears in Design view of the WPF Designer:

An unhandled exception has occurred.

Click here to reload the designer

Details: System.NullReferenceException
Object reference not set to an instance of an object.
   at Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.<GetXmlNamespaceCompatibilityMappings>d__8.MoveNext()
   at MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption()
   at MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(Identifier identifier)
   at MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context)
   at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider)
   at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean convertToXamlWithErrors)
   at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem()
   at Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem()
   at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState()
   at MS.Internal.Host.PersistenceSubsystem.Load()
   at MS.Internal.Host.Designer.Load()
   at MS.Internal.Designer.VSDesigner.Load()
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.Load()
   at MS.Internal.Designer.DesignerPane.LoadDesignerView()
Posted

Just,I am install Visual Studio 2010 Service pack1 then my design form(XAML)page is loaded..
The problem is i am not install the Visual Studio 2010 Service pack1 that's way error is rise..thanku
 
Share this answer
 
v2
Hi. i guess you have a control that has some property like DataGrid.ItemsSource and you populate it in code behind. i suppose we are a DataGrid and its name is "MainDataGrid".your Xaml is like this(for example):

XML
<DataGrid x:Name="MainDataGrid" Loaded="MainDataGrid_Loaded">

       </DataGrid>


and in your codeBehind you must write:
using System.ComponentModel;

then:
XML
private void MainDataGrid_Loaded(object sender, RoutedEventArgs e)
        {
            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                MainDataGrid.ItemsSource=//a method that return a list or a List<yourSpecifiedType>
            }
        }


maybe your ItemsSource is filled by null.

good luck
 
Share this answer
 
v2
Comments
naveen kapavarapu 18-Feb-13 7:40am    
Sorry,Its not working sir ,thanku
aliwpf 18-Feb-13 10:29am    
do you have a ItemsContorl like DataGrid or ListBox in your application?
naveen kapavarapu 19-Feb-13 5:04am    
I am not installing visualStudio2010 Servivepack1,that way the problem is rise..Thank you sir

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900