For example, is it possible to bind a Textblock's Text property to an element Name[2] of type String?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
if you mean that if we can bind array item with textBox then, yes
I'm not sure what you mean exactly by saying:an element Name[2] of type String, so here are two possible solutions to your problem: Array1 and String1. Array1 show bow to bind to element of an array and String1 shows how to display one single character in a string.
CODE:
XAML:
Hope that helps.
Yes you can. Following is the XAML approach. It is advisable to bind to an Observable collection if you want to update the UI automatically when the value changes.
XAML: Assuming the DataContext is set correctly:
Use ObservableCollection instead:
Xaml
I've added a button in xaml and subscribed "click" event.
Here is C# code.