Binding Properties.Settings to Textbox fails
Posted
by
user268098
on Stack Overflow
See other posts from Stack Overflow
or by user268098
Published on 2012-06-18T21:02:49Z
Indexed on
2012/06/18
21:16 UTC
Read the original article
Hit count: 235
I would like to define a key & value in Settings.settings and bind the value by declaration in the XAML (not in the code behind by command).
Here's what I've been trying in vain:
- Create a WPF project "Exp1" with Visual Studio Express 2010.
- Set one key named "TextFromSettings" to the value "Some Text from Setting".
- Add the attribute
xmlns:p="clr-namespace:Exp1.Properties;assembly=Exp1"
to the tag. - Add
Text="{Binding Path=TextFromSettings, Mode=TwoWay, Source={x:Static p:Settings.Default}}"
to the tag
Now, the preview window shows the text, however, the compiler fails:
"Error 1 Cannot find the type 'Settings'. Note that type names are case sensitive."
Where am I going wrong?
© Stack Overflow or respective owner