这可能不是最好的方法,但这就是我解决它的方法:
public class MyCollectionViewModel : ObservableCollection<SomeObject>
{
private readonly SomeObject _totalRow;
public MyCollectionViewModel ()
{
_totalRow = new SomeObject() { IsTotalRow = true; };
base.Add(_totalRow );
}
public new void Add(SomeObject item)
{
int i = base.Count -1;
base.InsertItem(i, item);
}
}
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助任何人。
干杯
| 归档时间: |
|
| 查看次数: |
8034 次 |
| 最近记录: |