0
テキストフィルタがうまく動作しますが、リストボックスをコンボボックスでフィルタ処理できないようです。文字列をカテゴリに変換できないという問題を解決するにはどうすればよいですか? StaffListView.xaml文字列をカテゴリに変換することができませんエラー
StaffController sc = (StaffController)Application.Current.FindResource("staffcontroller");
public StaffListView()
{
InitializeComponent();
StaffController sc = (StaffController)Application.Current.FindResource("staffcontroller");
}
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.RemovedItems.Count > 0)
{
//too much going on i think it sees the() as a method because of the ToString
sc.FilterBy(comboBox.SelectedItem.ToString());
//MessageBox.Show("Dropdown list used to select: " + e.AddedItems[0]);
}
}
StaffControlerのパート:
public void FilterBy(Category currCategoryFilter)
{
var selected = from Staff s in MasterStaffListBasic
where currCategoryFilter == Category.All || s.StaffCategory == currCategoryFilter
select s;
ViewableStaffList.Clear();
selected.ToList().ForEach(ViewableStaffList.Add);
}
EDIT:の
パート もちょうどカテゴリーを明確にすることは
投稿を誹謗中傷しないでください。 – dorukayhan