开发者

WPF Data Binding an Enum

The public enum 'StocksGroupType' is in the namespace 'EquityTrades'.

Before the code at the base of this email, I have the code line:

xmlns:EquityTrades="clr-namespace:EquityTrades;assembly=EquityTrades"

The code fails to identify the 'StocksGroupType' enum at the line with:

It returns the error: "Type reference cannot find type named '{http://schemas.microsoft.com/winfx/2006/xaml/presentation}EquityTrades.StocksGroupType'."

I've tried deleting the ';assembly=EquityTrades', and other variations, according to what I've found on the internet. Nothing seems to work. Please help. I'm using VS2010.

<Window.Resources>
    <ObjectDataProvider x:Key="stocksGroupTypeName" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
        <ObjectDataProvider.MethodParameters>
            <x:Type TypeName="EquityTrades.StocksGroupType" />
        </ObjectDataProvid开发者_高级运维er.MethodParameters>
    </ObjectDataProvider>
</Window.Resources>


The following line is wrong.

<x:Type TypeName="EquityTrades.StocksGroupType" />

You have to change TypeName value from EquityTrades.StocksGroupType to EquityTrades:StocksGroupType.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜