1
ļ»æ// Copyright Ā© Microsoft Corporation.
2
// This source is subject to the Microsoft Source License for Silverlight Controls (March 2008 Release).
3
// Please see http://go.microsoft.com/fwlink/?LinkID=111693 for details.
4
// All other rights reserved.
6
namespace System.Windows.Controlsb1
8
internal class DataGridDisplayData
12
private int _firstDisplayedFrozenCol;
14
private int _firstDisplayedScrollingCol;
15
private int _firstDisplayedScrollingRow;
16
private int _lastDisplayedFrozenCol;
18
private int _lastDisplayedScrollingRow;
19
private int _lastTotallyDisplayedScrollingCol;
20
private int _numDisplayedFrozenCols;
22
private int _numDisplayedScrollingCols;
23
private int _numDisplayedScrollingRows;
25
private int _numTotallyDisplayedScrollingRows;
29
public DataGridDisplayData()
32
_firstDisplayedFrozenCol = -1;
33
_firstDisplayedScrollingRow = -1;
34
_firstDisplayedScrollingCol = -1;
35
_lastTotallyDisplayedScrollingCol = -1;
36
_lastDisplayedScrollingRow = -1;
37
_lastDisplayedFrozenCol = -1;
39
OldFirstDisplayedScrollingRow = -1;
40
OldFirstDisplayedScrollingCol = -1;
43
#region Public Properties
45
public bool ColumnInsertionOccurred
57
public int FirstDisplayedFrozenCol
61
return this._firstDisplayedFrozenCol;
65
if (value != _firstDisplayedFrozenCol)
68
_firstDisplayedFrozenCol = value;
85
public int FirstDisplayedScrollingCol
89
return _firstDisplayedScrollingCol;
93
if (value != _firstDisplayedScrollingCol)
96
_firstDisplayedScrollingCol = value;
101
public int FirstDisplayedScrollingRow
105
return _firstDisplayedScrollingRow;
109
if (value != _firstDisplayedScrollingRow)
112
_firstDisplayedScrollingRow = value;
117
public int LastDisplayedFrozenCol
121
return _lastDisplayedFrozenCol;
125
if (value != _lastDisplayedFrozenCol)
128
_lastDisplayedFrozenCol = value;
145
public int LastDisplayedScrollingRow
149
return _lastDisplayedScrollingRow;
153
if (value != _lastDisplayedScrollingRow)
156
_lastDisplayedScrollingRow = value;
161
public int LastTotallyDisplayedScrollingCol
165
return _lastTotallyDisplayedScrollingCol;
169
if (value != _lastTotallyDisplayedScrollingCol)
172
_lastTotallyDisplayedScrollingCol = value;
177
public int NumDisplayedFrozenCols
181
return _numDisplayedFrozenCols;
185
if (value != _numDisplayedFrozenCols)
188
_numDisplayedFrozenCols = value;
209
public int NumDisplayedScrollingCols
213
return _numDisplayedScrollingCols;
217
if (value != _numDisplayedScrollingCols)
220
_numDisplayedScrollingCols = value;
225
public int NumDisplayedScrollingRows
229
return _numDisplayedScrollingRows;
233
if (value != _numDisplayedScrollingRows)
236
_numDisplayedScrollingRows = value;
257
public int NumTotallyDisplayedScrollingRows
261
return _numTotallyDisplayedScrollingRows;
265
if (value != _numTotallyDisplayedScrollingRows)
268
_numTotallyDisplayedScrollingRows = value;
273
public int OldFirstDisplayedScrollingCol
279
public int OldFirstDisplayedScrollingRow
291
public int OldNumDisplayedScrollingRows
297
public bool RowInsertionOccurred
305
#region Public Methods
307
public void CorrectColumnIndexAfterInsertion(int columnIndex, int insertionCount)
310
if (OldFirstDisplayedScrollingCol != -1 && columnIndex <= OldFirstDisplayedScrollingCol)
312
OldFirstDisplayedScrollingCol += insertionCount;
314
ColumnInsertionOccurred = true;
317
public void CorrectRowIndexAfterDeletion(int rowIndex)
320
if (OldFirstDisplayedScrollingRow != -1 && rowIndex <= OldFirstDisplayedScrollingRow)
322
OldFirstDisplayedScrollingRow--;
326
public void CorrectRowIndexAfterInsertion(int rowIndex, int insertionCount)
329
if (OldFirstDisplayedScrollingRow != -1 && rowIndex <= OldFirstDisplayedScrollingRow)
331
OldFirstDisplayedScrollingRow += insertionCount;
333
RowInsertionOccurred = true;
334
OldNumDisplayedScrollingRows += insertionCount;
338
public void EnsureDirtyState()
343
RowInsertionOccurred = false;
344
ColumnInsertionOccurred = false;
351
#region Private Methods
353
private void SetOldValues()
355
OldFirstDisplayedScrollingRow = _firstDisplayedScrollingRow;
356
OldFirstDisplayedScrollingCol = _firstDisplayedScrollingCol;
358
OldNumDisplayedScrollingRows = _numDisplayedScrollingRows;