Browse Source

Merge pull request #9853 from workgroupengineering/fixes/Warnings/CS0618

fix: Obsolete
pull/9860/head
Max Katz 4 years ago
committed by GitHub
parent
commit
baf62cbad5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Avalonia.Base/Rendering/SceneGraph/VisualNode.cs
  2. 2
      src/Avalonia.Controls.DataGrid/DataGrid.cs
  3. 2
      src/Avalonia.Controls.DataGrid/DataGridColumn.cs
  4. 2
      src/Avalonia.Controls.DataGrid/DataGridColumnHeader.cs
  5. 2
      src/Avalonia.Controls.DataGrid/DataGridRow.cs
  6. 4
      src/Avalonia.Controls.DataGrid/DataGridRows.cs
  7. 4
      src/Avalonia.Controls/BorderVisual.cs

2
src/Avalonia.Base/Rendering/SceneGraph/VisualNode.cs

@ -303,7 +303,7 @@ namespace Avalonia.Rendering.SceneGraph
if (ClipToBounds) if (ClipToBounds)
{ {
context.Transform = Matrix.Identity; context.Transform = Matrix.Identity;
if (ClipToBoundsRadius.IsEmpty) if (ClipToBoundsRadius.IsDefault)
context.PushClip(ClipBounds); context.PushClip(ClipBounds);
else else
context.PushClip(new RoundedRect(ClipBounds, ClipToBoundsRadius)); context.PushClip(new RoundedRect(ClipBounds, ClipToBoundsRadius));

2
src/Avalonia.Controls.DataGrid/DataGrid.cs

@ -3299,7 +3299,7 @@ namespace Avalonia.Controls
newCell.IsVisible = column.IsVisible; newCell.IsVisible = column.IsVisible;
if (row.OwningGrid.CellTheme is {} cellTheme) if (row.OwningGrid.CellTheme is {} cellTheme)
{ {
newCell.SetValue(ThemeProperty, cellTheme, BindingPriority.TemplatedParent); newCell.SetValue(ThemeProperty, cellTheme, BindingPriority.Template);
} }
} }
row.Cells.Insert(column.Index, newCell); row.Cells.Insert(column.Index, newCell);

2
src/Avalonia.Controls.DataGrid/DataGridColumn.cs

@ -897,7 +897,7 @@ namespace Avalonia.Controls
result[!ContentControl.ContentTemplateProperty] = this[!HeaderTemplateProperty]; result[!ContentControl.ContentTemplateProperty] = this[!HeaderTemplateProperty];
if (OwningGrid.ColumnHeaderTheme is {} columnTheme) if (OwningGrid.ColumnHeaderTheme is {} columnTheme)
{ {
result.SetValue(StyledElement.ThemeProperty, columnTheme, BindingPriority.TemplatedParent); result.SetValue(StyledElement.ThemeProperty, columnTheme, BindingPriority.Template);
} }
return result; return result;

2
src/Avalonia.Controls.DataGrid/DataGridColumnHeader.cs

@ -673,7 +673,7 @@ namespace Avalonia.Controls
}; };
if (OwningGrid.ColumnHeaderTheme is {} columnHeaderTheme) if (OwningGrid.ColumnHeaderTheme is {} columnHeaderTheme)
{ {
dragIndicator.SetValue(ThemeProperty, columnHeaderTheme, BindingPriority.TemplatedParent); dragIndicator.SetValue(ThemeProperty, columnHeaderTheme, BindingPriority.Template);
} }
dragIndicator.PseudoClasses.Add(":dragIndicator"); dragIndicator.PseudoClasses.Add(":dragIndicator");

2
src/Avalonia.Controls.DataGrid/DataGridRow.cs

@ -253,7 +253,7 @@ namespace Avalonia.Controls
}; };
if (OwningGrid.CellTheme is {} cellTheme) if (OwningGrid.CellTheme is {} cellTheme)
{ {
_fillerCell.SetValue(ThemeProperty, cellTheme, BindingPriority.TemplatedParent); _fillerCell.SetValue(ThemeProperty, cellTheme, BindingPriority.Template);
} }
if (_cellsElement != null) if (_cellsElement != null)
{ {

4
src/Avalonia.Controls.DataGrid/DataGridRows.cs

@ -1029,7 +1029,7 @@ namespace Avalonia.Controls
dataGridRow.DataContext = dataContext; dataGridRow.DataContext = dataContext;
if (RowTheme is {} rowTheme) if (RowTheme is {} rowTheme)
{ {
dataGridRow.SetValue(ThemeProperty, rowTheme, BindingPriority.TemplatedParent); dataGridRow.SetValue(ThemeProperty, rowTheme, BindingPriority.Template);
} }
CompleteCellsCollection(dataGridRow); CompleteCellsCollection(dataGridRow);
@ -2743,7 +2743,7 @@ namespace Avalonia.Controls
groupHeader.Level = rowGroupInfo.Level; groupHeader.Level = rowGroupInfo.Level;
if (RowGroupTheme is {} rowGroupTheme) if (RowGroupTheme is {} rowGroupTheme)
{ {
groupHeader.SetValue(ThemeProperty, rowGroupTheme, BindingPriority.TemplatedParent); groupHeader.SetValue(ThemeProperty, rowGroupTheme, BindingPriority.Template);
} }
// Set the RowGroupHeader's PropertyName. Unfortunately, CollectionViewGroup doesn't have this // Set the RowGroupHeader's PropertyName. Unfortunately, CollectionViewGroup doesn't have this

4
src/Avalonia.Controls/BorderVisual.cs

@ -50,7 +50,7 @@ class CompositionBorderVisual : CompositionDrawListVisual
if (ClipToBounds) if (ClipToBounds)
{ {
var clipRect = Root!.SnapToDevicePixels(new Rect(new Size(Size.X, Size.Y))); var clipRect = Root!.SnapToDevicePixels(new Rect(new Size(Size.X, Size.Y)));
if (_cornerRadius.IsEmpty) if (_cornerRadius.IsDefault)
canvas.PushClip(clipRect); canvas.PushClip(clipRect);
else else
canvas.PushClip(new RoundedRect(clipRect, _cornerRadius)); canvas.PushClip(new RoundedRect(clipRect, _cornerRadius));
@ -73,4 +73,4 @@ class CompositionBorderVisual : CompositionDrawListVisual
protected override bool HandlesClipToBounds => true; protected override bool HandlesClipToBounds => true;
} }
} }

Loading…
Cancel
Save