レコードが変更されたときに、ListViewに古い値と新しい値を表示する必要があります。つまり、各セルは新しい値と古い値を表示する必要があります。今のところ私はそうしています:
<GridViewColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding MyValue}"/>
<TextBlock Margin="7,0,0,0" Text="{Binding old.MyValue}"/>
</StackPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
次の列は次のようになります。
<GridViewColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding MySecondValue}"/>
<TextBlock Margin="7,0,0,0" Text="{Binding old.MySecondValue}"/>
</StackPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
しかし、私には10の列があり、これは10の列すべてに多くのコピーアンドペーストを作成するのにそれほど面白くありません。
これをよりコンパクトに、より良くする方法はありますか?
私が欲しい理想的なバリアントは次のようなものです:
<GridViewColumn.CellTemplate>
<DataTemplate>
<MySpecialWhatever NewValueText="{Binding MyValue}" OldValueText="{Binding old.MyValue}" >
</MySpecialWhatever>
</DataTemplate>
</GridViewColumn.CellTemplate>