-2
我試圖做的組合框,可以顯示一些2類, - 員工 - 僱主 顯然,這兩個類有一個可編輯變量C#做的ObservableCollection <T>在Tamplate
private ObservableCollection<Employer> _itemsEmployer
private ObservableCollection<Employee> _itemsEmployee
public ObservableCollection<T> Items, where T : Employee, Employer
{
get
{
return _itemsEmployee;
}
set
{
if (_itemsEmployee == value)
{
return;
}
_itemsEmployee = value;
}
}
組合框:
<ComboBox x:Name="cbx"
IsTextSearchEnabled="True"
TextSearch.Text="EditAble"
ItemsSource="{Binding Items}" IsEditable="True"
DisplayMemberPath="EditAble"
Text="{Binding AddedText,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
Canvas.Left="78" Canvas.Top="48" Width="259">
你的問題是什麼? – niksofteng