The related settings work in Visual Designer, but I can not start the application

I am using Visual C # Studio 2010 Express and I have a problem with oakward. I wanted to associate several text fields with the application settings. I followed Paul Sheriff's decision to Paul Sheriff's decision . It works only in the visual designer - I can’t start the application because I got:

XmlParseException 'Provide a value in' System.Windows.StaticResourceExtension ', raised an exception.

How is it possible that it works in the visual designer (values ​​are correctly presented in TextBoxes), but there is an XmlParseException?

App.xaml:

<Application.Resources> <ObjectDataProvider x:Key="odpSettings" ObjectType="{x:Type setts:Settings}" /> </Application.Resources>` 

The setts namespace is defined as xmlns:setts="clr-namespace:DbCopier.Properties"

My opinion:

 <TextBox Text="{Binding Source={StaticResource odpSettings}, Path=Default.DbName}" Width="150" /> 
+4
source share
1 answer

I understood!

InnerException was quite confusing. Everything about the Property Scope file in the settings file. I noticed that it was changed to Application , so it was read-only. I just changed it to User so that it becomes writable. So easy and yet - such an annoying mistake.

0
source

All Articles