![](/img/trans.png)
[英]How can I bind a radio button group to an enum property using an enum from another project?
[英]How to Bind Enum with a radio Button in Blend ?
我的解决方案中有两个项目。 一个是WPF,另一个是ClassLibrary。 在我的类库项目中,我有一个枚举,并将其作为静态资源绑定到WPF项目中的View。
我的代码是:
namespace DPOS.Core.Helpers
{
public enum SearchOptions
{
SingleDate,
DateRange,
Name,
Amount,
Quantity,
All
}
}
xmlns:helpers="clr-namespace:DPOS.Core.Helpers;assembly=DPOS.Core"
RadioButton x:Name="RadioSingleDate" Content="{Binding SingleDateContent}"
Margin="0,21.54,0,0" TabIndex="2" VerticalAlignment="Top" Style="{DynamicResource RadioButtonStyle}"
IsChecked="{Binding SearchOptions, ConverterParameter={x:Static helpers:SearchOptions.SingleDate}, Converter={StaticResource EnumToBooleanConverter}}"/>
此工作文件在Visual Studio 2012中。但是问题是,当我在Blend(Visual Studio混合)中打开它时,它说:
名称“ SearchOptions”在命名空间“ clr-namespace:DPOS.Core.Helpers; assembly = DPOS.Core”中不存在
我不明白发生了什么事。
我想念什么吗?
我通过使用Blend重新添加我的ClassLibrary项目引用来解决我的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.