Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir ! i have developed a simple wpf application using static resources in textblocks and stackpanel .
here's code of window1.xaml:
<window x:class="Resource_tutor.Window1" xmlns:x="#unknown">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="Resource Demo" Height="300" Width="300" removed="Lime">
<window.resources>
<sys:string x:key="strHelloworld" xmlns:sys="#unknown">Hello,world!

<stackpanel margin="10" removed="Lavender">
<textblock text="{staticResource strHelloworld}" fontsize="56">
<textblock>just another "<textblock text="{staticResource strHelloworld}">" example but with resources





--------------------------------------------------------------------
it is showing error:
''xmlns' is a duplicate attribute name. XML is not valid. C
Posted
Comments
[no name] 12-Aug-14 10:29am    
So remove the duplicate entry.

1 solution

You have:

VB
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"


The second
xmlns="http://schemas.microsoft.com/winfx/2006/xaml"
is a duplicate of the first. You can only have ONE root XML namespace which is the "xmlns" without any postfix. The offending line duplicates the next one which has the proper postfix (notice the :x)

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 
Share this answer
 

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