void BindData(Model model) { model.certificates.ForEach(cert => { bool isEnabled = cert.enabled; CertificateDescr cdescr = new CertificateDescr(cert); certificates.Add(cdescr); }); certificateslist.SelectionChanged += new SelectionChangedEventHandler((obj, value) => { if (certificateslist.SelectedItem != null) { //detailsValue.Text = certificateslist.SelectedItem.ToString(); ((DelegateCommand)DeleteCommand).RaiseCanExecuteChanged(); } }); certificateslist.CreateBinding(ListBox.ItemsSourceProperty, this, x => x.certificates); }
void BindData(Model model) { model.certificates.ForEach(cert => { bool isEnabled = cert.enabled; CertificateDescr cdescr = new CertificateDescr(cert); certificates.Add(cdescr); }); certificateslist.SelectionChanged+=new SelectionChangedEventHandler((obj, value)=>{ if (certificateslist.SelectedItem != null) { //detailsValue.Text = certificateslist.SelectedItem.ToString(); ((DelegateCommand)DeleteCommand).RaiseCanExecuteChanged(); } }); certificateslist.CreateBinding(ListBox.ItemsSourceProperty, this, x => x.certificates); }