Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C# WPF 3.0 Binding Problem

Empfohlene Antworten

Veröffentlicht

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

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.