2012-04-08 16 views
4

kann nicht Collectioneine Collection Bindung an ObservableCollection

docProps binden, ist ein öffentliches Eigentum

public ObservableCollection<DocProp> DocProps1 

Datacontext Selbst

<ListBox Grid.Row="0" Grid.Column="0" ItemsSource="{Binding Path=DocProps1}"> 

I Dies funktioniert

DataContext="{Binding RelativeSource={RelativeSource self}}" 

ist kann eine Collection nicht verdrahten zu sortieren Das nicht einmal bekommen DocProps1

<ListBox Grid.Row="0" Grid.Column="0"> 
     <ListBox.ItemsSource> 
      <Binding> 
       <Binding.Source> 
        <CollectionViewSource Source="{Binding Path=DocProps1}"> 
         <CollectionViewSource.SortDescriptions> 
          <scm:SortDescription PropertyName="Name" /> 
         </CollectionViewSource.SortDescriptions> 
        </CollectionViewSource> 
       </Binding.Source> 
      </Binding> 
     </ListBox.ItemsSource> 

Wie binde ich eine Collection an ein öffentliches Eigentum?

Dank

Antwort

Verwandte Themen