私はそれが動作わからないんだけど、あなたはおそらくGridView.Columns
がObservableCollection
であるという事実を利用することができます:あなたはCollectionChanged
イベントをサブスクライブして= Move
Action
GridView gridView = (GridView)listView.View;
gridView.Columns.CollectionChanged += gridView_CollectionChanged;
private void gridView_CollectionChanged(object sender, CollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Move)
{
string msg = string.Format("Column moved from position {0} to position {1}", e.OldIndex, e.NewIndex);
MessageBox.Show(msg);
}
}
ケース作品罰金を扱うことができますこれまでのところ。構文が少し変わった。 NotifyCollectionChangedEventArgs、e.OldStartingIndexおよびe.NewStartingIndexを使用してください。 – TalkingCode
@TalkingCodeありがとうございます!この変更は.NET4でこのコードを使用するために必要でした。 –