[{"data":1,"prerenderedAt":163},["ShallowReactive",2],{"tag-silverlight":3},{"tag":4,"articles":24},{"id":5,"title":6,"body":7,"description":14,"extension":15,"img":16,"meta":17,"name":18,"navigation":19,"path":20,"seo":21,"stem":22,"__hash__":23},"tags\u002Ftags\u002Fsilverlight.md","Silverlight",{"type":8,"value":9,"toc":10},"minimark",[],{"title":11,"searchDepth":12,"depth":12,"links":13},"",2,[],"Say no more.","md","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1598313183973-4effcded8d5e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80",{},"silverlight",true,"\u002Ftags\u002Fsilverlight",{"description":14},"tags\u002Fsilverlight","aLtzOSbx2leBhX5c__fGG4ZcqRvHO7p9rZCpLvRA0Bw",[25,76],{"id":26,"title":27,"author":28,"body":29,"createdAt":67,"description":68,"extension":15,"img":69,"meta":70,"navigation":19,"path":71,"seo":72,"stem":73,"tags":74,"updatedAt":67,"__hash__":75},"articles\u002Farticles\u002Fchange-silverlight-class-library-to-application.md","Change Silverlight Class Library to Application","[object Object]",{"type":8,"value":30,"toc":65},[31,35,43,53,56,59,62],[32,33,34],"p",{},"Add New Item to the Silverlight Class project > Silverlight Application Class (This adds app.xaml, app.xaml.cs files)",[32,36,37,38,42],{},"Open the class library project file and change ",[39,40,41],"silverlight-application",{},"false","\nto true (Unload the class library project and edit the csproj file)",[32,44,45,46],{},"Add new element XapOutputs to project file below the element",[39,47,48,49],{}," i.e. add ",[50,51,52],"xap-outputs",{},"true",[32,54,55],{},"Now open Project Properties of the Silverlight Class library and change to the > Silverlight tab > Change the starter object",[32,57,58],{},"Change the following Project Property > Silverlight tab > Set the Xap file name",[32,60,61],{},"In the related web application add project property > Silverlight tab > Add your Silverlight application",[32,63,64],{},"You have not changed a Silverlight class library to an application project where the xap will be output and copied to the respective web site ClientBin directory.",{"title":11,"searchDepth":12,"depth":12,"links":66},[],"2015-04-20T08:07:13.8700000-04:00","Changing class library type to application.","\u002Farticles\u002Fimages\u002Fm8gdjJD1VK.png",{},"\u002Farticles\u002Fchange-silverlight-class-library-to-application",{"title":27,"description":68},"articles\u002Fchange-silverlight-class-library-to-application",[18],"u_COjDxXgW8q1CXFUEeyO_rqVp2EzKopDX8j3mKRw2Y",{"id":77,"title":78,"author":28,"body":79,"createdAt":155,"description":156,"extension":15,"img":151,"meta":157,"navigation":19,"path":158,"seo":159,"stem":160,"tags":161,"updatedAt":155,"__hash__":162},"articles\u002Farticles\u002Felement-is-already-the-child-system-windows-markup-xamlparseexception-pivotcontrol-error.md","Element is already the child \u002F System.Windows.Markup.XamlParseException --> PivotControl Error",{"type":8,"value":80,"toc":153},[81],[32,82,83,84,87,88,90,91,87,93,95,96,100,101,104,106,107,109,110,112,113,115,116,118,119,121,122,87,124,87,126,128,129,87,131,133,134,87,136,138,139,87,141,143,144,87,146,148],{},"I have been working with Silverlight PivotViewer control and recently came across problem with the display of the control. \nI have a solution with multiple projects one of which is a Silverlight application.  Everything would compile without any error. \nWhen browsing to the form\u002Fpage with the control I would immediately get an exception on the InitializeComponent(); method within the Silverlight UserControl. \nThis method is called before loading any pivot cxml data.",[85,86],"br",{},"\n ",[85,89],{},"\nI have seen this component through odd errors or fail to load when there is javascript errors on the page or a failure of any ajax method. \nThe error that is thrown is as follows…",[85,92],{},[85,94],{},"\n{System.Windows.Markup.XamlParseException: Set property 'System.Windows.FrameworkElement.Style' threw an exception. ",[97,98,99],"span",{},"Line: 15 Position: 43"," ---> System.Windows.Markup.XamlParseException: Element is already the child of another element. ",[97,102,103],{},"Line: 0 Position: 0",[85,105],{},"\n   at MS.Internal.XcpImports.CreateFromXaml(UnmanagedMemoryStream stream, String sourceAssemblyName, Boolean createNamescope, Boolean requireDefaultNamespace, Boolean allowEventHandlers)",[85,108],{},"\n   at System.Windows.Controls.Control.GetBuiltInStyle(IntPtr nativeTarget, IntPtr& nativeStyle)",[85,111],{},"\n   --- End of inner exception stack trace ---",[85,114],{},"\n   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)",[85,117],{},"\n   at PivotView.Viewer.InitializeComponent()",[85,120],{},"\n   at PivotView.Viewer..ctor()}",[85,123],{},[85,125],{},[85,127],{},"\nIf searching Google you will see a number of posts on errors surrounding ‘XamlParseException’, ‘Styles’, ‘Element is already the child’ etc.  Without help from these posts, I finally came across the solution.  I found the error was the result of some missing references in the Silverlight project.  The components missing can be found in C:\\Program Files (x86)\\Microsoft SDKs\\Silverlight\\v4.0\\Toolkit\\Apr10\\Bin (which is installed as part of the most recent Silverlight Toolkit).  References to the following components was necessary.",[85,130],{},[85,132],{},"\nSystem.Windows.Controls.Layout.Toolkit.dll\nSystem.Windows.Controls.Toolkit.dll\nSystem.Windows.Controls.Toolkit.Internals.dll",[85,135],{},[85,137],{},"\nIf you're having issues, rename the xap file (adding .zip) and take a look to ensure those dlls are included.",[85,140],{},[85,142],{},"\nI thought I would post this information for others as well as a reminder to myself.  If you have any questions, let me know.",[85,145],{},[85,147],{},[149,150],"img",{"src":151,"alt":11,"style":152},"\u002Farticles\u002Fimages\u002Fpivotviewer.jpg","display:none;",{"title":11,"searchDepth":12,"depth":12,"links":154},[],"2015-04-20T08:07:13.7700000-04:00",null,{},"\u002Farticles\u002Felement-is-already-the-child-system-windows-markup-xamlparseexception-pivotcontrol-error",{"title":78,"description":156},"articles\u002Felement-is-already-the-child-system-windows-markup-xamlparseexception-pivotcontrol-error",[18],"MwzE74POWqzTSnbetCRmaz5deTYzJG440Jb4tLUMo7w",1781574760164]