English 中文(简体)
WPF - List items notprofile in Blend when show MembersPath is used
原标题:WPF - List items not visible in Blend when DisplayMemberPath is used

我们现在重新研究如何实施多国机器和I ve ,以达到我在Blend安装的MVVER轻型工具箱的位置,并能够具体说明在Blend供应的 du数据。 所有这一切都是好的。

我编制了一个数据清单。 清单中包含6个非常简单的类别,称为“DummyItem”,有年龄和姓名。

这里是我的DummyList阶级的主要法典:

public class DummyItem{

    public string Name;
    public int Age;

    public DummyItem(string name, int age){
        this.Name = name;
        this.Age = age;
    }
}

public class DummyList : ArrayList
{
    public DummyList()
    {
        this.Add(new DummyItem("Dummy1", 00));
        this.Add(new DummyItem("Dummy2", 01));
        this.Add(new DummyItem("Dummy3", 02));
        this.Add(new DummyItem("Dummy4", 03));
        this.Add(new DummyItem("Dummy5", 04));
        this.Add(new DummyItem("Dummy6", 05));
    }
}

这里是我的XAML执行部分。 数据栏确实可行,指出了正确的观点。

<Grid x:Name="LayoutRoot">
    <ListBox x:Name="ListViewBox"
        DataContext="{Binding Source={StaticResource Locator}, Path=ListViewModel}"
        ItemsSource="{Binding TheList}"
        DisplayMemberPath="Name">
    </ListBox>
</Grid>

问题在于,正如我前面所说的那样,当我补充显示“成员”时,我再也无法看到Blend所列项目。 如果我去除党员,那么我看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一 一切照旧。 仅仅在Blend本身,我不能在我使用显示“成员”。

任何人都知道,我为什么可以把物品放在内。 当我使用显示会人吗?

感谢!

页: 1

最佳回答

姓名和年龄特性:

public class DummyItem
{  
    public string Name {get; set; }
    public int Age {get; set;}

    public DummyItem(string name, int age)
    { 
        this.Name = name; 
        this.Age = age; 
    } 
}
问题回答

暂无回答




相关问题
WPF convert 2d mouse click into 3d space

I have several geometry meshes in my Viewport3D, these have bounds of (w:1800, h:500, d:25). When a user clicks in the middle of the mesh, I want the Point3D of (900, 500, 25)... How can I achieve ...

Editing a xaml icons or images

Is it possible to edit a xaml icons or images in the expression design or using other tools? Is it possible to import a xaml images (that e.g you have exported) in the expression designer for editing?...

WPF: writing smoke tests using ViewModels

I am considering to write smoke tests for our WPF application. The question that I am faced is: should we use UI automation( or some other technology that creates a UI script), or is it good enough to ...

WPF - MVVM - NHibernate Validation

Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on ...

How do WPF Markup Extensions raise compile errors?

Certain markup extensions raise compile errors. For example StaticExtension (x:Static) raises a compile error if the referenced class cannot be found. Anyone know the mechanism for this? Is it baked ...

WPF design-time context menu

I am trying to create a custom wpf control, I m wondering how I can add some design-time features. I ve googled and can t seem to get to my goal. So here s my simple question, how can I add an entry ...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签