简体   繁体   中英

Binding text to a textbox

I'm binding text to my textbox, but the name of my binding begins with an underscore. This is how it exists in the database. Problem is it doesn't seem to work. The data is there, but the binding name doesn't turn red in the XAML (it usually does). If I replace it with a different field (one that doesn't start with an underscore) it seems to work okay.

Can anyone recommend a good workaround for this? I'm not able to edit the database fields.

Thanks.

There is no technical issues in binding to a property starting with an underscore. I have created a small demo where I bind to a property starting with an underscore - you can download it here: http://dl.dropbox.com/u/4243120/demos/Binding%20to%20Property%20with%20Underscore.zip

In the output window in Visual Studio you can see any binding exceptions occurring in your app. As an alternative you can try to add a converter to your binding to see if it is hit at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM