简体   繁体   中英

How to Bind Enum with a radio Button in Blend ?

I have two projects in my solution. One is WPF and another one is ClassLibrary. In my Class Library project I have an Enum and I bound it to my View in WPF project as Static Resources.

My Code Is :

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}}"/>

This work`s file in Visual Studio 2012. But Problem is when I Open it in Blend (Blend for Visual studio) then it say :

The name "SearchOptions" does not exist in the namespace "clr-namespace:DPOS.Core.Helpers;assembly=DPOS.Core"

I don`t understand what is happening.

Am I Missing something?

我通过使用Blend重新添加我的ClassLibrary项目引用来解决我的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM