私は次のシナリオを持っている:年の月が含まれていSilverlightのコンボボックスとのSelectedItem
1リスト:のItemsSourceヶリストにバインドし、そのSelectedIndexを結合しているされて
public List<String> Months
{
get
{
return m_Months;
}
}
m_Months = new List<String>();
for (int i = 1; i <= 12; i++)
{
DateTime date = new DateTime(1900, i, 1);
m_Months.Add(date.ToString("MMM"));
}
1コンボボックス文字列であるプロパティ月、へ:私は分離コードから年に設定すると
public string Month
{
get
{
return m_Month;
}
set
{
if (value != m_Month)
{
m_Month = value;
NotifyPropertyChanged("Month");
}
}
}
<ComboBox SelectedItem="{Binding Month, Mode=TwoWay}" ItemsSource="{Binding Months}" />
、すなわち月=「月」、これが適切にコンボボックス、およびGETTに伝播されます月はアクセスされますが、ComboBoxは選択項目として 'May'を表示しません。
これはSilverlight 3のバグですか? TelerikのRadComboBoxを使用するとうまく動作します。
乾杯、 フランシス
うまくいけば、彼らはSilverlight 4で修正されましたが、この回答を投稿してくれてありがとう。 – Aligned
うわー、私たちはこれを理解しようと多くの時間を無駄にしました。答えを投稿してくれてありがとう! –
@KevinこれはSL4では修正されていません。 – Rob