0
我的解決方案中有兩個項目。一個是WPF,另一個是ClassLibrary。在我的類庫項目中,我有一個枚舉,並將其作爲靜態資源綁定到我在WPF項目中的視圖。如何在Blend中綁定一個單選按鈕的枚舉?
我的代碼是:
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}}"/>
這work`s文件在Visual Studio 2012 但問題是,當我在Blend中打開它(混合爲Visual Studio),那麼它說:
命名空間「clr-namespace:DPOS.Core.Helpers;程序集= DPOS.Core」中不存在名稱「SearchOptions」
我不明白髮生了什麼。
我錯過了什麼嗎?