Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从App.xaml设置绑定到childproperty_C#_Wpf_Binding_Telerik_Inotifypropertychanged - Fatal编程技术网

C# 如何从App.xaml设置绑定到childproperty

C# 如何从App.xaml设置绑定到childproperty,c#,wpf,binding,telerik,inotifypropertychanged,C#,Wpf,Binding,Telerik,Inotifypropertychanged,绑定到ListBox控件时出现问题。 实际上,我在App.xaml.cs中有一个属性: public partial class App : Application, INotifyPropertyChanged { ObservableCollection<Panier> _panier = new ObservableCollection<Panier>(); public ObservableCollection<Panier> Pan

绑定到ListBox控件时出现问题。 实际上,我在App.xaml.cs中有一个属性:

public partial class App : Application, INotifyPropertyChanged
{
    ObservableCollection<Panier> _panier = new ObservableCollection<Panier>();

    public ObservableCollection<Panier> PanierProperty
    {
        get { return _panier; }
        set
        {
            if (this._panier != value)
            {
                this._panier = value;
                NotifyPropertyChanged("PanierProperty");
            }
        }
    }
    public event PropertyChangedEventHandler PropertyChanged;

    protected void NotifyPropertyChanged(String property)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(property));
        }
    }
}
在我的MainWindow.xaml页面中,我将我的列表框绑定到PanierProperty(父属性):


我的问题是PanierProperty绑定到我的Listbox,我在Listbox中看到类似Design.Panier的项 设计.窗格玻璃 设计.窗格玻璃 等 我不知道如何获取PanierProperty.Nom(Nom是子属性)以显示在列表框中


有人可以帮忙。

DisplayMemberPath
中,使用您只想显示的属性名称:

<telerik:RadListBox
    ...
    DisplayMemberPath="Nom"

非常感谢它让我发疯:s我只是在尝试使用{Binding Nom}不知道,谢谢:D
<telerik:RadListBox x:Name="PanierLB" Grid.Row="1" Height="200" Width="350" Margin="0 300 0 0"
    ItemsSource="{Binding PanierProperty, Source={x:Static Application.Current}}"
    DisplayMemberPath="{Binding Path=PanierProperty.Nom, Source={x:Static Application.Current}}">
</telerik:RadListBox>
<telerik:RadListBox
    ...
    DisplayMemberPath="Nom"