arkasında koduyla "{Binding}" Ben aşağıdaki özellik Temp2
: (benim UserControl INotifyPropertyChanged uygulayan)seti xaml kodu ItemsSource =
ObservableCollection<Person> _Temp2;
public ObservableCollection<Person> Temp2
{
get
{
return _Temp2;
}
set
{
_Temp2 = value;
OnPropertyChanged("Temp2");
}
}
public event PropertyChangedEventHandler PropertyChanged = delegate { };
private void OnPropertyChanged(string propertyName)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
Dinamik bir liste görünümü oluşturmanız gerekir. Ben XAML aşağıdaki liste görünümü vardır: C# ile liste görünümü liste görünümü doldurulan almaz doldurmak zaman
ListView listView1 = new ListView();
listView1.DataContext = Temp2;
listView1.ItemsSource = Temp2; // new Binding(); // ????? how do I have to implement this line
listView1.IsSynchronizedWithCurrentItem = true;
//.. etc
:
<ListView
Name="listView1"
DataContext="{Binding Temp2}"
ItemsSource="{Binding}"
IsSynchronizedWithCurrentItem="True">
<ListView.View>
.... etc
Şimdi C# ile aynı listview oluşturmaya çalışıyorum. Neyi yanlış yapıyorum?
Çalışmıyor Neden bilmiyor musunuz? –