title: Do I need two xmlns:local="clr-namespace"?
body: <p>Here's the setup I'd like to have for my Windows Phone app, using c# in visual studio 2010:</p>
  
  <p><code>**MainPage.xaml**</code> contains elements that have an attached property, whose values will be modifiable/savable by the user.</p>
  
  <pre><code>**MainPage.xaml.cs**       
  </code></pre>
  
  <p>first Namespace is PhoneApp ,inside it is a nested namespace called MyNamespace that declares the dependency property. it works(Thanks, Daniel)</p>
  
  <p><code>**SettingsSample.xaml**</code> that will allow users to change the values of the attached property in <code>MainPage.xaml</code> for any element and automatically save the change.</p>
  
  <p><code>**AppSettings.cs**</code> a class that exactly reproduces the first listing in this tutorial:
  <a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff769510%28v=vs.105%29.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff769510%28v=vs.105%29.aspx</a></p>
  
  <p>That page declares the same NameSpace as the MainPage.xaml.cs (PhoneApp), then a public class called AppSettings that is exactly like in the tutorial.</p>
  
  <p>To join everything together, I did:</p>
  
  <pre><code>**MainPage.xaml**
  
  xmlns:local="clr-namespace:PhoneApp.MyNamespace"
  </code></pre>
  
  <p>I needed this to use the attached property</p>
  
  <pre><code>&lt;phone:PhoneApplicationPage.Resources&gt;
      &lt;local:AppSettings x:Key="appSettings"&gt;&lt;/local:AppSettings&gt;
  &lt;/phone:PhoneApplicationPage.Resources&gt;
  </code></pre>
  
  <p>Confusion begins. On the tutorial, they put this on the settings page, but I guess because their settings page is also the one including the elements with the properties that are bound to the saved settings. Mine are on the mainpage, so I put this here. To recap, My settings page will only use methods to change/save these values(and the methods are in AppSettings.cs). Also in the tutorial they add this:</p>
  
  <pre><code>xmlns:local="clr-namespace:SettingsSample"
  </code></pre>
  
  <p>to the Setting Page(where "SettingsSample" is the Namespace containing declaration/get-Set methods of savable settings) but, for the same reason, I tried to put it on the mainpage, but only one declaration of xmlns:local can be done. I tried several things to put them one after the other, but it doesn't work. This is the key to the two errors I'll list below.</p>
  
  <p>Some elements of mainpage have this, for exemple:</p>
  
  <pre><code>local:MyClass.Son="{Binding Source={StaticResource appSettings}, Path=son1, Mode=TwoWay}" Style="{StaticResource pad}"
  </code></pre>
  
  <p>"Son" is the attached property</p>
  
  <p>Ok, so I tried different different things but it never worked. The best I could get was in MainPage.xaml that it couldn't create an instance of AppSettings. Now it's different, I have the two errors.</p>
  
  <p>-the type local:AppSettings was not found</p>
  
  <p>-the tag AppSettings does not exist in xml namespace PhoneApp.MyNamespace.</p>
  
  <p>I think this is because I didn't put the</p>
  
  <pre><code> xmlns:local="clr-namespace:PhoneApp"
  </code></pre>
  
  <p>But I already have </p>
  
  <pre><code>xmlns:local="clr-namespace:PhoneApp.MyNamespace"
  </code></pre>
  
  <p>and can't put both.(and to me, one is included in the other...) The reason I listed all the ins and out of the situation is because I kind of expect other troubles after I get through this.
   I hope this message is clear enough for someone to help me. I spent so much time on it that I begin to loose my mind, so I hope there's no stupid mistake. Of course, I can add any information needed. Thank you for reading anyway!</p>