Browse Source

Merge pull request #1337 from jp2masa/dropdown-item-selection

Use nameof where possible
pull/1339/head
Steven Kirk 9 years ago
committed by GitHub
parent
commit
40dd5309e1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Avalonia.Controls/Carousel.cs
  2. 6
      src/Avalonia.Controls/ColumnDefinition.cs
  3. 2
      src/Avalonia.Controls/DropDown.cs
  4. 2
      src/Avalonia.Controls/Primitives/HeaderedContentControl.cs
  5. 2
      src/Avalonia.Controls/Primitives/TemplatedControl.cs
  6. 6
      src/Avalonia.Controls/Primitives/Thumb.cs
  7. 6
      src/Avalonia.Controls/RowDefinition.cs
  8. 4
      src/Avalonia.Controls/Shapes/Line.cs
  9. 2
      src/Avalonia.Controls/Shapes/Path.cs
  10. 8
      src/Avalonia.Controls/Shapes/Shape.cs
  11. 10
      src/Avalonia.Controls/TextBox.cs
  12. 2
      src/Avalonia.Diagnostics/Views/ControlDetailsView.cs
  13. 16
      src/Avalonia.HtmlRenderer/HtmlControl.cs
  14. 18
      src/Avalonia.Input/InputElement.cs
  15. 6
      src/Avalonia.Input/KeyBinding.cs
  16. 2
      src/Avalonia.Visuals/Media/Geometry.cs
  17. 2
      src/Avalonia.Visuals/Media/ImageBrush.cs
  18. 2
      src/Avalonia.Visuals/Media/MatrixTransform.cs
  19. 2
      src/Avalonia.Visuals/Media/RotateTransform.cs
  20. 4
      src/Avalonia.Visuals/Media/TranslateTransform.cs
  21. 2
      src/Avalonia.Visuals/Media/VisualBrush.cs
  22. 6
      tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_Direct.cs
  23. 2
      tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_GetSubject.cs
  24. 2
      tests/Avalonia.Base.UnitTests/DirectPropertyTests.cs
  25. 2
      tests/Avalonia.Markup.UnitTests/Data/ExpressionObserverTests_AttachedProperty.cs
  26. 2
      tests/Avalonia.Markup.Xaml.UnitTests/Data/BindingTests.cs
  27. 6
      tests/Avalonia.Markup.Xaml.UnitTests/Xaml/NonControl.cs
  28. 2
      tests/Avalonia.Styling.UnitTests/StyleTests.cs

2
src/Avalonia.Controls/Carousel.cs

@ -24,7 +24,7 @@ namespace Avalonia.Controls
/// Defines the <see cref="Transition"/> property. /// Defines the <see cref="Transition"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<IPageTransition> TransitionProperty = public static readonly StyledProperty<IPageTransition> TransitionProperty =
AvaloniaProperty.Register<Carousel, IPageTransition>("Transition"); AvaloniaProperty.Register<Carousel, IPageTransition>(nameof(Transition));
/// <summary> /// <summary>
/// The default value of <see cref="ItemsControl.ItemsPanelProperty"/> for /// The default value of <see cref="ItemsControl.ItemsPanelProperty"/> for

6
src/Avalonia.Controls/ColumnDefinition.cs

@ -12,19 +12,19 @@ namespace Avalonia.Controls
/// Defines the <see cref="MaxWidth"/> property. /// Defines the <see cref="MaxWidth"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<double> MaxWidthProperty = public static readonly StyledProperty<double> MaxWidthProperty =
AvaloniaProperty.Register<ColumnDefinition, double>("MaxWidth", double.PositiveInfinity); AvaloniaProperty.Register<ColumnDefinition, double>(nameof(MaxWidth), double.PositiveInfinity);
/// <summary> /// <summary>
/// Defines the <see cref="MinWidth"/> property. /// Defines the <see cref="MinWidth"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<double> MinWidthProperty = public static readonly StyledProperty<double> MinWidthProperty =
AvaloniaProperty.Register<ColumnDefinition, double>("MinWidth"); AvaloniaProperty.Register<ColumnDefinition, double>(nameof(MinWidth));
/// <summary> /// <summary>
/// Defines the <see cref="Width"/> property. /// Defines the <see cref="Width"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<GridLength> WidthProperty = public static readonly StyledProperty<GridLength> WidthProperty =
AvaloniaProperty.Register<ColumnDefinition, GridLength>("Width", new GridLength(1, GridUnitType.Star)); AvaloniaProperty.Register<ColumnDefinition, GridLength>(nameof(Width), new GridLength(1, GridUnitType.Star));
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ColumnDefinition"/> class. /// Initializes a new instance of the <see cref="ColumnDefinition"/> class.

2
src/Avalonia.Controls/DropDown.cs

@ -38,7 +38,7 @@ namespace Avalonia.Controls
/// Defines the <see cref="SelectionBoxItem"/> property. /// Defines the <see cref="SelectionBoxItem"/> property.
/// </summary> /// </summary>
public static readonly DirectProperty<DropDown, object> SelectionBoxItemProperty = public static readonly DirectProperty<DropDown, object> SelectionBoxItemProperty =
AvaloniaProperty.RegisterDirect<DropDown, object>("SelectionBoxItem", o => o.SelectionBoxItem); AvaloniaProperty.RegisterDirect<DropDown, object>(nameof(SelectionBoxItem), o => o.SelectionBoxItem);
private bool _isDropDownOpen; private bool _isDropDownOpen;
private Popup _popup; private Popup _popup;

2
src/Avalonia.Controls/Primitives/HeaderedContentControl.cs

@ -12,7 +12,7 @@ namespace Avalonia.Controls.Primitives
/// Defines the <see cref="Header"/> property. /// Defines the <see cref="Header"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<object> HeaderProperty = public static readonly StyledProperty<object> HeaderProperty =
AvaloniaProperty.Register<ContentControl, object>("Header"); AvaloniaProperty.Register<ContentControl, object>(nameof(Header));
/// <summary> /// <summary>
/// Gets or sets the header content. /// Gets or sets the header content.

2
src/Avalonia.Controls/Primitives/TemplatedControl.cs

@ -75,7 +75,7 @@ namespace Avalonia.Controls.Primitives
/// Defines the <see cref="Template"/> property. /// Defines the <see cref="Template"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<IControlTemplate> TemplateProperty = public static readonly StyledProperty<IControlTemplate> TemplateProperty =
AvaloniaProperty.Register<TemplatedControl, IControlTemplate>("Template"); AvaloniaProperty.Register<TemplatedControl, IControlTemplate>(nameof(Template));
/// <summary> /// <summary>
/// Defines the IsTemplateFocusTarget attached property. /// Defines the IsTemplateFocusTarget attached property.

6
src/Avalonia.Controls/Primitives/Thumb.cs

@ -11,13 +11,13 @@ namespace Avalonia.Controls.Primitives
public class Thumb : TemplatedControl public class Thumb : TemplatedControl
{ {
public static readonly RoutedEvent<VectorEventArgs> DragStartedEvent = public static readonly RoutedEvent<VectorEventArgs> DragStartedEvent =
RoutedEvent.Register<Thumb, VectorEventArgs>("DragStarted", RoutingStrategies.Bubble); RoutedEvent.Register<Thumb, VectorEventArgs>(nameof(DragStarted), RoutingStrategies.Bubble);
public static readonly RoutedEvent<VectorEventArgs> DragDeltaEvent = public static readonly RoutedEvent<VectorEventArgs> DragDeltaEvent =
RoutedEvent.Register<Thumb, VectorEventArgs>("DragDelta", RoutingStrategies.Bubble); RoutedEvent.Register<Thumb, VectorEventArgs>(nameof(DragDelta), RoutingStrategies.Bubble);
public static readonly RoutedEvent<VectorEventArgs> DragCompletedEvent = public static readonly RoutedEvent<VectorEventArgs> DragCompletedEvent =
RoutedEvent.Register<Thumb, VectorEventArgs>("DragCompleted", RoutingStrategies.Bubble); RoutedEvent.Register<Thumb, VectorEventArgs>(nameof(DragCompleted), RoutingStrategies.Bubble);
private Point? _lastPoint; private Point? _lastPoint;

6
src/Avalonia.Controls/RowDefinition.cs

@ -12,19 +12,19 @@ namespace Avalonia.Controls
/// Defines the <see cref="MaxHeight"/> property. /// Defines the <see cref="MaxHeight"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<double> MaxHeightProperty = public static readonly StyledProperty<double> MaxHeightProperty =
AvaloniaProperty.Register<RowDefinition, double>("MaxHeight", double.PositiveInfinity); AvaloniaProperty.Register<RowDefinition, double>(nameof(MaxHeight), double.PositiveInfinity);
/// <summary> /// <summary>
/// Defines the <see cref="MinHeight"/> property. /// Defines the <see cref="MinHeight"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<double> MinHeightProperty = public static readonly StyledProperty<double> MinHeightProperty =
AvaloniaProperty.Register<RowDefinition, double>("MinHeight"); AvaloniaProperty.Register<RowDefinition, double>(nameof(MinHeight));
/// <summary> /// <summary>
/// Defines the <see cref="Height"/> property. /// Defines the <see cref="Height"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<GridLength> HeightProperty = public static readonly StyledProperty<GridLength> HeightProperty =
AvaloniaProperty.Register<RowDefinition, GridLength>("Height", new GridLength(1, GridUnitType.Star)); AvaloniaProperty.Register<RowDefinition, GridLength>(nameof(Height), new GridLength(1, GridUnitType.Star));
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="RowDefinition"/> class. /// Initializes a new instance of the <see cref="RowDefinition"/> class.

4
src/Avalonia.Controls/Shapes/Line.cs

@ -8,10 +8,10 @@ namespace Avalonia.Controls.Shapes
public class Line : Shape public class Line : Shape
{ {
public static readonly StyledProperty<Point> StartPointProperty = public static readonly StyledProperty<Point> StartPointProperty =
AvaloniaProperty.Register<Line, Point>("StartPoint"); AvaloniaProperty.Register<Line, Point>(nameof(StartPoint));
public static readonly StyledProperty<Point> EndPointProperty = public static readonly StyledProperty<Point> EndPointProperty =
AvaloniaProperty.Register<Line, Point>("EndPoint"); AvaloniaProperty.Register<Line, Point>(nameof(EndPoint));
static Line() static Line()
{ {

2
src/Avalonia.Controls/Shapes/Path.cs

@ -9,7 +9,7 @@ namespace Avalonia.Controls.Shapes
public class Path : Shape public class Path : Shape
{ {
public static readonly StyledProperty<Geometry> DataProperty = public static readonly StyledProperty<Geometry> DataProperty =
AvaloniaProperty.Register<Path, Geometry>("Data"); AvaloniaProperty.Register<Path, Geometry>(nameof(Data));
static Path() static Path()
{ {

8
src/Avalonia.Controls/Shapes/Shape.cs

@ -12,19 +12,19 @@ namespace Avalonia.Controls.Shapes
public abstract class Shape : Control public abstract class Shape : Control
{ {
public static readonly StyledProperty<IBrush> FillProperty = public static readonly StyledProperty<IBrush> FillProperty =
AvaloniaProperty.Register<Shape, IBrush>("Fill"); AvaloniaProperty.Register<Shape, IBrush>(nameof(Fill));
public static readonly StyledProperty<Stretch> StretchProperty = public static readonly StyledProperty<Stretch> StretchProperty =
AvaloniaProperty.Register<Shape, Stretch>("Stretch"); AvaloniaProperty.Register<Shape, Stretch>(nameof(Stretch));
public static readonly StyledProperty<IBrush> StrokeProperty = public static readonly StyledProperty<IBrush> StrokeProperty =
AvaloniaProperty.Register<Shape, IBrush>("Stroke"); AvaloniaProperty.Register<Shape, IBrush>(nameof(Stroke));
public static readonly StyledProperty<AvaloniaList<double>> StrokeDashArrayProperty = public static readonly StyledProperty<AvaloniaList<double>> StrokeDashArrayProperty =
AvaloniaProperty.Register<Shape, AvaloniaList<double>>("StrokeDashArray"); AvaloniaProperty.Register<Shape, AvaloniaList<double>>("StrokeDashArray");
public static readonly StyledProperty<double> StrokeThicknessProperty = public static readonly StyledProperty<double> StrokeThicknessProperty =
AvaloniaProperty.Register<Shape, double>("StrokeThickness"); AvaloniaProperty.Register<Shape, double>(nameof(StrokeThickness));
private Matrix _transform = Matrix.Identity; private Matrix _transform = Matrix.Identity;
private Geometry _definingGeometry; private Geometry _definingGeometry;

10
src/Avalonia.Controls/TextBox.cs

@ -21,13 +21,13 @@ namespace Avalonia.Controls
public class TextBox : TemplatedControl, UndoRedoHelper<TextBox.UndoRedoState>.IUndoRedoHost public class TextBox : TemplatedControl, UndoRedoHelper<TextBox.UndoRedoState>.IUndoRedoHost
{ {
public static readonly StyledProperty<bool> AcceptsReturnProperty = public static readonly StyledProperty<bool> AcceptsReturnProperty =
AvaloniaProperty.Register<TextBox, bool>("AcceptsReturn"); AvaloniaProperty.Register<TextBox, bool>(nameof(AcceptsReturn));
public static readonly StyledProperty<bool> AcceptsTabProperty = public static readonly StyledProperty<bool> AcceptsTabProperty =
AvaloniaProperty.Register<TextBox, bool>("AcceptsTab"); AvaloniaProperty.Register<TextBox, bool>(nameof(AcceptsTab));
public static readonly DirectProperty<TextBox, bool> CanScrollHorizontallyProperty = public static readonly DirectProperty<TextBox, bool> CanScrollHorizontallyProperty =
AvaloniaProperty.RegisterDirect<TextBox, bool>("CanScrollHorizontally", o => o.CanScrollHorizontally); AvaloniaProperty.RegisterDirect<TextBox, bool>(nameof(CanScrollHorizontally), o => o.CanScrollHorizontally);
public static readonly DirectProperty<TextBox, int> CaretIndexProperty = public static readonly DirectProperty<TextBox, int> CaretIndexProperty =
AvaloniaProperty.RegisterDirect<TextBox, int>( AvaloniaProperty.RegisterDirect<TextBox, int>(
@ -69,10 +69,10 @@ namespace Avalonia.Controls
TextBlock.TextWrappingProperty.AddOwner<TextBox>(); TextBlock.TextWrappingProperty.AddOwner<TextBox>();
public static readonly StyledProperty<string> WatermarkProperty = public static readonly StyledProperty<string> WatermarkProperty =
AvaloniaProperty.Register<TextBox, string>("Watermark"); AvaloniaProperty.Register<TextBox, string>(nameof(Watermark));
public static readonly StyledProperty<bool> UseFloatingWatermarkProperty = public static readonly StyledProperty<bool> UseFloatingWatermarkProperty =
AvaloniaProperty.Register<TextBox, bool>("UseFloatingWatermark"); AvaloniaProperty.Register<TextBox, bool>(nameof(UseFloatingWatermark));
struct UndoRedoState : IEquatable<UndoRedoState> struct UndoRedoState : IEquatable<UndoRedoState>
{ {

2
src/Avalonia.Diagnostics/Views/ControlDetailsView.cs

@ -14,7 +14,7 @@ namespace Avalonia.Diagnostics.Views
internal class ControlDetailsView : UserControl internal class ControlDetailsView : UserControl
{ {
private static readonly StyledProperty<ControlDetailsViewModel> ViewModelProperty = private static readonly StyledProperty<ControlDetailsViewModel> ViewModelProperty =
AvaloniaProperty.Register<ControlDetailsView, ControlDetailsViewModel>("ViewModel"); AvaloniaProperty.Register<ControlDetailsView, ControlDetailsViewModel>(nameof(ViewModel));
private SimpleGrid _grid; private SimpleGrid _grid;
public ControlDetailsView() public ControlDetailsView()

16
src/Avalonia.HtmlRenderer/HtmlControl.cs

@ -74,29 +74,29 @@ namespace Avalonia.Controls.Html
protected Point _lastScrollOffset; protected Point _lastScrollOffset;
public static readonly AvaloniaProperty AvoidImagesLateLoadingProperty = public static readonly AvaloniaProperty AvoidImagesLateLoadingProperty =
PropertyHelper.Register<HtmlControl, bool>("AvoidImagesLateLoading", false, OnAvaloniaProperty_valueChanged); PropertyHelper.Register<HtmlControl, bool>(nameof(AvoidImagesLateLoading), false, OnAvaloniaProperty_valueChanged);
public static readonly AvaloniaProperty IsSelectionEnabledProperty = public static readonly AvaloniaProperty IsSelectionEnabledProperty =
PropertyHelper.Register<HtmlControl, bool>("IsSelectionEnabled", true, OnAvaloniaProperty_valueChanged); PropertyHelper.Register<HtmlControl, bool>(nameof(IsSelectionEnabled), true, OnAvaloniaProperty_valueChanged);
public static readonly AvaloniaProperty IsContextMenuEnabledProperty = public static readonly AvaloniaProperty IsContextMenuEnabledProperty =
PropertyHelper.Register<HtmlControl, bool>("IsContextMenuEnabled", true, OnAvaloniaProperty_valueChanged); PropertyHelper.Register<HtmlControl, bool>(nameof(IsContextMenuEnabled), true, OnAvaloniaProperty_valueChanged);
public static readonly AvaloniaProperty BaseStylesheetProperty = public static readonly AvaloniaProperty BaseStylesheetProperty =
PropertyHelper.Register<HtmlControl, string>("BaseStylesheet", null, OnAvaloniaProperty_valueChanged); PropertyHelper.Register<HtmlControl, string>(nameof(BaseStylesheet), null, OnAvaloniaProperty_valueChanged);
public static readonly AvaloniaProperty TextProperty = public static readonly AvaloniaProperty TextProperty =
PropertyHelper.Register<HtmlControl, string>("Text", null, OnAvaloniaProperty_valueChanged); PropertyHelper.Register<HtmlControl, string>(nameof(Text), null, OnAvaloniaProperty_valueChanged);
public static readonly StyledProperty<IBrush> BackgroundProperty = public static readonly StyledProperty<IBrush> BackgroundProperty =
Border.BackgroundProperty.AddOwner<HtmlControl>(); Border.BackgroundProperty.AddOwner<HtmlControl>();
public static readonly AvaloniaProperty BorderThicknessProperty = public static readonly AvaloniaProperty BorderThicknessProperty =
AvaloniaProperty.Register<HtmlControl, Thickness>("BorderThickness", new Thickness(0)); AvaloniaProperty.Register<HtmlControl, Thickness>(nameof(BorderThickness), new Thickness(0));
public static readonly AvaloniaProperty BorderBrushProperty = public static readonly AvaloniaProperty BorderBrushProperty =
AvaloniaProperty.Register<HtmlControl, IBrush>("BorderBrush"); AvaloniaProperty.Register<HtmlControl, IBrush>(nameof(BorderBrush));
public static readonly AvaloniaProperty PaddingProperty = public static readonly AvaloniaProperty PaddingProperty =
AvaloniaProperty.Register<HtmlControl, Thickness>("Padding", new Thickness(0)); AvaloniaProperty.Register<HtmlControl, Thickness>(nameof(Padding), new Thickness(0));
public static readonly RoutedEvent LoadCompleteEvent = public static readonly RoutedEvent LoadCompleteEvent =
RoutedEvent.Register<RoutedEventArgs>("LoadComplete", RoutingStrategies.Bubble, typeof(HtmlControl)); RoutedEvent.Register<RoutedEventArgs>("LoadComplete", RoutingStrategies.Bubble, typeof(HtmlControl));

18
src/Avalonia.Input/InputElement.cs

@ -31,43 +31,43 @@ namespace Avalonia.Input
/// Defines the <see cref="IsEnabledCore"/> property. /// Defines the <see cref="IsEnabledCore"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<bool> IsEnabledCoreProperty = public static readonly StyledProperty<bool> IsEnabledCoreProperty =
AvaloniaProperty.Register<InputElement, bool>("IsEnabledCore", true); AvaloniaProperty.Register<InputElement, bool>(nameof(IsEnabledCore), true);
/// <summary> /// <summary>
/// Gets or sets associated mouse cursor. /// Gets or sets associated mouse cursor.
/// </summary> /// </summary>
public static readonly StyledProperty<Cursor> CursorProperty = public static readonly StyledProperty<Cursor> CursorProperty =
AvaloniaProperty.Register<InputElement, Cursor>("Cursor", null, true); AvaloniaProperty.Register<InputElement, Cursor>(nameof(Cursor), null, true);
/// <summary> /// <summary>
/// Defines the <see cref="IsFocused"/> property. /// Defines the <see cref="IsFocused"/> property.
/// </summary> /// </summary>
public static readonly DirectProperty<InputElement, bool> IsFocusedProperty = public static readonly DirectProperty<InputElement, bool> IsFocusedProperty =
AvaloniaProperty.RegisterDirect<InputElement, bool>("IsFocused", o => o.IsFocused); AvaloniaProperty.RegisterDirect<InputElement, bool>(nameof(IsFocused), o => o.IsFocused);
/// <summary> /// <summary>
/// Defines the <see cref="IsHitTestVisible"/> property. /// Defines the <see cref="IsHitTestVisible"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<bool> IsHitTestVisibleProperty = public static readonly StyledProperty<bool> IsHitTestVisibleProperty =
AvaloniaProperty.Register<InputElement, bool>("IsHitTestVisible", true); AvaloniaProperty.Register<InputElement, bool>(nameof(IsHitTestVisible), true);
/// <summary> /// <summary>
/// Defines the <see cref="IsPointerOver"/> property. /// Defines the <see cref="IsPointerOver"/> property.
/// </summary> /// </summary>
public static readonly DirectProperty<InputElement, bool> IsPointerOverProperty = public static readonly DirectProperty<InputElement, bool> IsPointerOverProperty =
AvaloniaProperty.RegisterDirect<InputElement, bool>("IsPointerOver", o => o.IsPointerOver); AvaloniaProperty.RegisterDirect<InputElement, bool>(nameof(IsPointerOver), o => o.IsPointerOver);
/// <summary> /// <summary>
/// Defines the <see cref="GotFocus"/> event. /// Defines the <see cref="GotFocus"/> event.
/// </summary> /// </summary>
public static readonly RoutedEvent<GotFocusEventArgs> GotFocusEvent = public static readonly RoutedEvent<GotFocusEventArgs> GotFocusEvent =
RoutedEvent.Register<InputElement, GotFocusEventArgs>("GotFocus", RoutingStrategies.Bubble); RoutedEvent.Register<InputElement, GotFocusEventArgs>(nameof(GotFocus), RoutingStrategies.Bubble);
/// <summary> /// <summary>
/// Defines the <see cref="LostFocus"/> event. /// Defines the <see cref="LostFocus"/> event.
/// </summary> /// </summary>
public static readonly RoutedEvent<RoutedEventArgs> LostFocusEvent = public static readonly RoutedEvent<RoutedEventArgs> LostFocusEvent =
RoutedEvent.Register<InputElement, RoutedEventArgs>("LostFocus", RoutingStrategies.Bubble); RoutedEvent.Register<InputElement, RoutedEventArgs>(nameof(LostFocus), RoutingStrategies.Bubble);
/// <summary> /// <summary>
/// Defines the <see cref="KeyDown"/> event. /// Defines the <see cref="KeyDown"/> event.
@ -97,13 +97,13 @@ namespace Avalonia.Input
/// Defines the <see cref="PointerEnter"/> event. /// Defines the <see cref="PointerEnter"/> event.
/// </summary> /// </summary>
public static readonly RoutedEvent<PointerEventArgs> PointerEnterEvent = public static readonly RoutedEvent<PointerEventArgs> PointerEnterEvent =
RoutedEvent.Register<InputElement, PointerEventArgs>("PointerEnter", RoutingStrategies.Direct); RoutedEvent.Register<InputElement, PointerEventArgs>(nameof(PointerEnter), RoutingStrategies.Direct);
/// <summary> /// <summary>
/// Defines the <see cref="PointerLeave"/> event. /// Defines the <see cref="PointerLeave"/> event.
/// </summary> /// </summary>
public static readonly RoutedEvent<PointerEventArgs> PointerLeaveEvent = public static readonly RoutedEvent<PointerEventArgs> PointerLeaveEvent =
RoutedEvent.Register<InputElement, PointerEventArgs>("PointerLeave", RoutingStrategies.Direct); RoutedEvent.Register<InputElement, PointerEventArgs>(nameof(PointerLeave), RoutingStrategies.Direct);
/// <summary> /// <summary>
/// Defines the <see cref="PointerMoved"/> event. /// Defines the <see cref="PointerMoved"/> event.

6
src/Avalonia.Input/KeyBinding.cs

@ -10,7 +10,7 @@ namespace Avalonia.Input
public class KeyBinding : AvaloniaObject public class KeyBinding : AvaloniaObject
{ {
public static readonly StyledProperty<ICommand> CommandProperty = public static readonly StyledProperty<ICommand> CommandProperty =
AvaloniaProperty.Register<KeyBinding, ICommand>("Command"); AvaloniaProperty.Register<KeyBinding, ICommand>(nameof(Command));
public ICommand Command public ICommand Command
{ {
@ -19,7 +19,7 @@ namespace Avalonia.Input
} }
public static readonly StyledProperty<object> CommandParameterProperty = public static readonly StyledProperty<object> CommandParameterProperty =
AvaloniaProperty.Register<KeyBinding, object>("CommandParameter"); AvaloniaProperty.Register<KeyBinding, object>(nameof(CommandParameter));
public object CommandParameter public object CommandParameter
{ {
@ -28,7 +28,7 @@ namespace Avalonia.Input
} }
public static readonly StyledProperty<KeyGesture> GestureProperty = public static readonly StyledProperty<KeyGesture> GestureProperty =
AvaloniaProperty.Register<KeyBinding, KeyGesture>("Gesture"); AvaloniaProperty.Register<KeyBinding, KeyGesture>(nameof(Gesture));
public KeyGesture Gesture public KeyGesture Gesture
{ {

2
src/Avalonia.Visuals/Media/Geometry.cs

@ -15,7 +15,7 @@ namespace Avalonia.Media
/// Defines the <see cref="Transform"/> property. /// Defines the <see cref="Transform"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<Transform> TransformProperty = public static readonly StyledProperty<Transform> TransformProperty =
AvaloniaProperty.Register<Geometry, Transform>("Transform"); AvaloniaProperty.Register<Geometry, Transform>(nameof(Transform));
/// <summary> /// <summary>
/// Initializes static members of the <see cref="Geometry"/> class. /// Initializes static members of the <see cref="Geometry"/> class.

2
src/Avalonia.Visuals/Media/ImageBrush.cs

@ -14,7 +14,7 @@ namespace Avalonia.Media
/// Defines the <see cref="Visual"/> property. /// Defines the <see cref="Visual"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<IBitmap> SourceProperty = public static readonly StyledProperty<IBitmap> SourceProperty =
AvaloniaProperty.Register<ImageBrush, IBitmap>("Source"); AvaloniaProperty.Register<ImageBrush, IBitmap>(nameof(Source));
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ImageBrush"/> class. /// Initializes a new instance of the <see cref="ImageBrush"/> class.

2
src/Avalonia.Visuals/Media/MatrixTransform.cs

@ -15,7 +15,7 @@ namespace Avalonia.Media
/// Defines the <see cref="Matrix"/> property. /// Defines the <see cref="Matrix"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<Matrix> MatrixProperty = public static readonly StyledProperty<Matrix> MatrixProperty =
AvaloniaProperty.Register<MatrixTransform, Matrix>("Matrix", Matrix.Identity); AvaloniaProperty.Register<MatrixTransform, Matrix>(nameof(Matrix), Matrix.Identity);
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="MatrixTransform"/> class. /// Initializes a new instance of the <see cref="MatrixTransform"/> class.

2
src/Avalonia.Visuals/Media/RotateTransform.cs

@ -15,7 +15,7 @@ namespace Avalonia.Media
/// Defines the <see cref="Angle"/> property. /// Defines the <see cref="Angle"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<double> AngleProperty = public static readonly StyledProperty<double> AngleProperty =
AvaloniaProperty.Register<RotateTransform, double>("Angle"); AvaloniaProperty.Register<RotateTransform, double>(nameof(Angle));
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="RotateTransform"/> class. /// Initializes a new instance of the <see cref="RotateTransform"/> class.

4
src/Avalonia.Visuals/Media/TranslateTransform.cs

@ -15,13 +15,13 @@ namespace Avalonia.Media
/// Defines the <see cref="X"/> property. /// Defines the <see cref="X"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<double> XProperty = public static readonly StyledProperty<double> XProperty =
AvaloniaProperty.Register<TranslateTransform, double>("X"); AvaloniaProperty.Register<TranslateTransform, double>(nameof(X));
/// <summary> /// <summary>
/// Defines the <see cref="Y"/> property. /// Defines the <see cref="Y"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<double> YProperty = public static readonly StyledProperty<double> YProperty =
AvaloniaProperty.Register<TranslateTransform, double>("Y"); AvaloniaProperty.Register<TranslateTransform, double>(nameof(Y));
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="TranslateTransform"/> class. /// Initializes a new instance of the <see cref="TranslateTransform"/> class.

2
src/Avalonia.Visuals/Media/VisualBrush.cs

@ -14,7 +14,7 @@ namespace Avalonia.Media
/// Defines the <see cref="Visual"/> property. /// Defines the <see cref="Visual"/> property.
/// </summary> /// </summary>
public static readonly StyledProperty<IVisual> VisualProperty = public static readonly StyledProperty<IVisual> VisualProperty =
AvaloniaProperty.Register<VisualBrush, IVisual>("Visual"); AvaloniaProperty.Register<VisualBrush, IVisual>(nameof(Visual));
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="VisualBrush"/> class. /// Initializes a new instance of the <see cref="VisualBrush"/> class.

6
tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_Direct.cs

@ -506,17 +506,17 @@ namespace Avalonia.Base.UnitTests
{ {
public static readonly DirectProperty<Class1, string> FooProperty = public static readonly DirectProperty<Class1, string> FooProperty =
AvaloniaProperty.RegisterDirect<Class1, string>( AvaloniaProperty.RegisterDirect<Class1, string>(
"Foo", nameof(Foo),
o => o.Foo, o => o.Foo,
(o, v) => o.Foo = v, (o, v) => o.Foo = v,
unsetValue: "unset"); unsetValue: "unset");
public static readonly DirectProperty<Class1, string> BarProperty = public static readonly DirectProperty<Class1, string> BarProperty =
AvaloniaProperty.RegisterDirect<Class1, string>("Bar", o => o.Bar); AvaloniaProperty.RegisterDirect<Class1, string>(nameof(Bar), o => o.Bar);
public static readonly DirectProperty<Class1, int> BazProperty = public static readonly DirectProperty<Class1, int> BazProperty =
AvaloniaProperty.RegisterDirect<Class1, int>( AvaloniaProperty.RegisterDirect<Class1, int>(
"Bar", nameof(Baz),
o => o.Baz, o => o.Baz,
(o, v) => o.Baz = v, (o, v) => o.Baz = v,
unsetValue: -1); unsetValue: -1);

2
tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_GetSubject.cs

@ -37,7 +37,7 @@ namespace Avalonia.Base.UnitTests
private class Class1 : AvaloniaObject private class Class1 : AvaloniaObject
{ {
public static readonly StyledProperty<string> FooProperty = public static readonly StyledProperty<string> FooProperty =
AvaloniaProperty.Register<Class1, string>("Foo", "foodefault"); AvaloniaProperty.Register<Class1, string>(nameof(Foo), "foodefault");
public string Foo public string Foo
{ {

2
tests/Avalonia.Base.UnitTests/DirectPropertyTests.cs

@ -85,7 +85,7 @@ namespace Avalonia.Base.UnitTests
private class Class1 : AvaloniaObject private class Class1 : AvaloniaObject
{ {
public static readonly DirectProperty<Class1, string> FooProperty = public static readonly DirectProperty<Class1, string> FooProperty =
AvaloniaProperty.RegisterDirect<Class1, string>("Foo", o => o.Foo, (o, v) => o.Foo = v); AvaloniaProperty.RegisterDirect<Class1, string>(nameof(Foo), o => o.Foo, (o, v) => o.Foo = v);
private string _foo = "foo"; private string _foo = "foo";

2
tests/Avalonia.Markup.UnitTests/Data/ExpressionObserverTests_AttachedProperty.cs

@ -136,7 +136,7 @@ namespace Avalonia.Markup.UnitTests.Data
private class Class1 : AvaloniaObject private class Class1 : AvaloniaObject
{ {
public static readonly StyledProperty<Class1> NextProperty = public static readonly StyledProperty<Class1> NextProperty =
AvaloniaProperty.Register<Class1, Class1>("Next"); AvaloniaProperty.Register<Class1, Class1>(nameof(Next));
public Class1 Next public Class1 Next
{ {

2
tests/Avalonia.Markup.Xaml.UnitTests/Data/BindingTests.cs

@ -558,7 +558,7 @@ namespace Avalonia.Markup.Xaml.UnitTests.Data
private class InheritanceTest : Decorator private class InheritanceTest : Decorator
{ {
public static readonly StyledProperty<int> BazProperty = public static readonly StyledProperty<int> BazProperty =
AvaloniaProperty.Register<InheritanceTest, int>("Baz", defaultValue: 6, inherits: true); AvaloniaProperty.Register<InheritanceTest, int>(nameof(Baz), defaultValue: 6, inherits: true);
public int Baz public int Baz
{ {

6
tests/Avalonia.Markup.Xaml.UnitTests/Xaml/NonControl.cs

@ -8,10 +8,10 @@ namespace Avalonia.Markup.Xaml.UnitTests.Xaml
public class NonControl : AvaloniaObject public class NonControl : AvaloniaObject
{ {
public static readonly StyledProperty<Control> ControlProperty = public static readonly StyledProperty<Control> ControlProperty =
AvaloniaProperty.Register<NonControl, Control>("Control"); AvaloniaProperty.Register<NonControl, Control>(nameof(Control));
public static readonly StyledProperty<string> StringProperty = public static readonly StyledProperty<string> StringProperty =
AvaloniaProperty.Register<NonControl, string>("String"); AvaloniaProperty.Register<NonControl, string>(nameof(String));
//No getter or setter Avalonia property //No getter or setter Avalonia property
public static readonly StyledProperty<int> FooProperty = public static readonly StyledProperty<int> FooProperty =
@ -19,7 +19,7 @@ namespace Avalonia.Markup.Xaml.UnitTests.Xaml
//getter only Avalonia property //getter only Avalonia property
public static readonly StyledProperty<string> BarProperty = public static readonly StyledProperty<string> BarProperty =
AvaloniaProperty.Register<NonControl, string>("Bar"); AvaloniaProperty.Register<NonControl, string>(nameof(Bar));
public Control Control public Control Control
{ {

2
tests/Avalonia.Styling.UnitTests/StyleTests.cs

@ -170,7 +170,7 @@ namespace Avalonia.Styling.UnitTests
private class Class1 : Control private class Class1 : Control
{ {
public static readonly StyledProperty<string> FooProperty = public static readonly StyledProperty<string> FooProperty =
AvaloniaProperty.Register<Class1, string>("Foo", "foodefault"); AvaloniaProperty.Register<Class1, string>(nameof(Foo), "foodefault");
public string Foo public string Foo
{ {

Loading…
Cancel
Save