I\'m trying to bind a TextBlock to a specific element in an ObservableCollection. This is what I do right now:
private ObservableCollection arr
No need for the converter. You can bind directly to Arr[0] like this
The elements in Arr would need to implement INotifyPropertyChanged though in order to dynamically update.
Update: To elaborate a bit more:
public class MyDouble : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private double _Value;
public double Value
{
get { return _Value; }
set { _Value = value; OnPropertyChanged("Value"); }
}
void OnPropertyChanged(string propertyName)
{
var handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
and then
ObservableCollection Arr { get; set; }
and bind to