CTom Geschrieben 26. Januar 2010 Geschrieben 26. Januar 2010 Hi Leute, ich hab ein ganz komisches Problem. Es handelt sich um ein Binding, welches ich in einem DataGridControl (XAML) anwende. Das Binding scheint zwar korrekt zu sein, leider bekommt die gebundene Property keinen Wert und ist immer null. Hier der relevante Code: XAML-File: <uc:TableGrid DockPanel.Dock="Top" Grid.Row="0" ItemsSource="{Binding Source={StaticResource cvs_list}}" BindableSelectedItems="{Binding CurrentItems}" ReadOnly="True" > .CS-File: public List<branch> CurrentItems { get { return _targetList; } set { _targetList = value; OnPropertyChanged("CurrentItems"); } } Das DependencyProperty "BindableSelectedItems" besitzt aber einen Wert. Ich habe das getestet anhand eines CollectionChanged-Events, in dem ich die Anzahl der Listenelemente in "BindableSelectedItems" auf die Console schrieb. Auch hab ich es schon mit "trace level" versucht jedoch ist hier die Ausgabe wie folgt: System.Windows.Data Warning: 52 : Created BindingExpression (hash=58410703) for Binding (hash=43772780) System.Windows.Data Warning: 54 : Path: 'CurrentItems' System.Windows.Data Warning: 56 : BindingExpression (hash=58410703): Default mode resolved to OneWay System.Windows.Data Warning: 57 : BindingExpression (hash=58410703): Default update trigger resolved to PropertyChanged System.Windows.Data Warning: 58 : BindingExpression (hash=58410703): Attach to Infrastructure.UI.Controls.TableGrid.BindableSelectedItems (hash=59093860) System.Windows.Data Warning: 63 : BindingExpression (hash=58410703): Resolving source System.Windows.Data Warning: 66 : BindingExpression (hash=58410703): Found data context element: TableGrid (hash=59093860) (OK) System.Windows.Data Warning: 67 : BindingExpression (hash=58410703): DataContext is null System.Windows.Data Warning: 61 : BindingExpression (hash=58410703): Resolve source deferred System.Windows.Data Warning: 75 : BindingExpression (hash=58410703): Deactivate System.Windows.Data Warning: 59 : BindingExpression (hash=58410703): Detach Ich sollte hinzufügen, das ich mich diesen Code (Beitrag 4) bedient habe um im DataGridControl an die SelectedItems Binden zu können. Xceed Community - Selected Items property not available in Xaml Hoffentlich kann mir jemand helfen. MfG CTom
Empfohlene Beiträge
Erstelle ein Benutzerkonto oder melde Dich an, um zu kommentieren
Du musst ein Benutzerkonto haben, um einen Kommentar verfassen zu können
Benutzerkonto erstellen
Neues Benutzerkonto für unsere Community erstellen. Es ist einfach!
Neues Benutzerkonto erstellenAnmelden
Du hast bereits ein Benutzerkonto? Melde Dich hier an.
Jetzt anmelden