combo box bind to IEnumerable

 public class XXXType : IEnumerable

{

public string SetType = "Set XXXX";

public string NoXXX = "No XXXX;

public string Year= "Year";

public string Month= "Month";

public string Day= "Day";

public IEnumerator GetEnumerator()

{

yield return SetType ;

yield return NoXXX ;

yield return Year;

yield return Month;

yield return Day;

}

}

 

public XXXType XXXTypeData= new XXXType();

<ComboBox

ItemsSource="{Binding Path=XXXTypeData}

SelectedItem="{Binding Path=SelectedXXXTypeData.Value, Mode=TwoWay}"

/>

或者用 <ObjectProvider >

posted on 2009-03-10 19:22  oyl  阅读(173)  评论(0编辑  收藏  举报

导航