有代码有J8:

UI


VM:

DelegateCommand<ListBox> _SelectionChangedCmd = null;
public DelegateCommand<ListBox> SelectionChangedCmd
{
    get
    {
        if (this._SelectionChangedCmd == null)
        {
            this._SelectionChangedCmd = new DelegateCommand<ListBox>(SelectionChanged);
        }

        return this._SelectionChangedCmd;
    }
}
void SelectionChanged(ListBox lst)
{
    SelectedUser = lst.SelectedItem as User;
}
//这个就是选中项啦。User是自定义类
public User SelectedUser { get; set; }


相关文章:

  • 2021-08-07
  • 2021-11-16
  • 2022-12-23
  • 2021-09-25
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
相关资源
相似解决方案