@@ -26,11 +26,9 @@ public partial class TableViewRow : ListViewItem
26
26
private ListViewItemPresenter ? _itemPresenter ;
27
27
private TableViewCellsPresenter ? _cellPresenter ;
28
28
private Border ? _selectionBackground ;
29
- #if WINDOWS
30
29
private bool _ensureCells = true ;
31
30
private Brush ? _cellPresenterBackground ;
32
- private Brush ? _cellPresenterForeground ;
33
- #endif
31
+ private Brush ? _cellPresenterForeground ;
34
32
35
33
/// <summary>
36
34
/// Initializes a new instance of the TableViewRow class.
@@ -121,21 +119,17 @@ protected override void OnIsSelectedChanged()
121
119
/// </summary>
122
120
private void OnForegroundChanged ( )
123
121
{
124
- #if WINDOWS
125
122
_cellPresenterForeground = Foreground ;
126
- EnsureAlternateColors ( ) ;
127
- #endif
123
+ EnsureAlternateColors ( ) ;
128
124
}
129
125
130
126
/// <summary>
131
127
/// Handles the Background property changed.
132
128
/// </summary>
133
129
private void OnBackgroundChanged ( )
134
130
{
135
- #if WINDOWS
136
131
_cellPresenterBackground = Background ;
137
- EnsureAlternateColors ( ) ;
138
- #endif
132
+ EnsureAlternateColors ( ) ;
139
133
}
140
134
141
135
/// <summary>
@@ -153,10 +147,8 @@ protected override void OnApplyTemplate()
153
147
{
154
148
base . OnApplyTemplate ( ) ;
155
149
156
- #if WINDOWS
157
150
_cellPresenterBackground = Background ;
158
- _cellPresenterForeground = Foreground ;
159
- #endif
151
+ _cellPresenterForeground = Foreground ;
160
152
_itemPresenter = GetTemplateChild ( "Root" ) as ListViewItemPresenter ;
161
153
162
154
if ( _itemPresenter is not null )
@@ -184,10 +176,10 @@ protected override void OnContentChanged(object oldContent, object newContent)
184
176
else
185
177
{
186
178
#endif
187
- foreach ( var cell in Cells )
188
- {
189
- cell . RefreshElement ( ) ;
190
- }
179
+ foreach ( var cell in Cells )
180
+ {
181
+ cell . RefreshElement ( ) ;
182
+ }
191
183
#if WINDOWS
192
184
}
193
185
#endif
@@ -243,8 +235,8 @@ internal void EnsureCells()
243
235
CellPresenter . Children . Clear ( ) ;
244
236
245
237
AddCells ( TableView . Columns . VisibleColumns ) ;
246
- _ensureCells = false ;
247
- }
238
+ _ensureCells = false ;
239
+ }
248
240
}
249
241
250
242
/// <summary>
@@ -516,7 +508,6 @@ internal void EnsureLayout()
516
508
}
517
509
}
518
510
519
- #if WINDOWS
520
511
/// <summary>
521
512
/// Ensures alternate colors are applied to the row.
522
513
/// </summary>
@@ -529,8 +520,7 @@ internal void EnsureAlternateColors()
529
520
530
521
CellPresenter . Foreground =
531
522
Index % 2 == 1 && TableView . AlternateRowForeground is not null ? TableView . AlternateRowForeground : _cellPresenterForeground ;
532
- }
533
- #endif
523
+ }
534
524
535
525
/// <summary>
536
526
/// Gets the list of cells in the row.
0 commit comments