Browse Source

Fixed field declarations which should be readonly.

pull/2124/head
José Pedro 7 years ago
parent
commit
88c05b1a19
No known key found for this signature in database GPG Key ID: B8247B9301707B83
  1. 2
      src/Avalonia.Controls/Calendar/CalendarItem.cs
  2. 2
      src/Avalonia.Controls/Primitives/AdornerLayer.cs
  3. 2
      src/Avalonia.Controls/Viewbox.cs
  4. 2
      src/Avalonia.Input/Cursors.cs
  5. 6
      src/Avalonia.Input/DataFormats.cs
  6. 10
      src/Avalonia.Input/DragDrop.cs
  7. 4
      src/Avalonia.Visuals/Media/GradientStop.cs
  8. 2
      src/Avalonia.Visuals/Media/Typeface.cs

2
src/Avalonia.Controls/Calendar/CalendarItem.cs

@ -52,7 +52,7 @@ namespace Avalonia.Controls.Primitives
internal Calendar Owner { get; set; }
internal CalendarDayButton CurrentButton { get; set; }
public static StyledProperty<IBrush> HeaderBackgroundProperty = Calendar.HeaderBackgroundProperty.AddOwner<CalendarItem>();
public static readonly StyledProperty<IBrush> HeaderBackgroundProperty = Calendar.HeaderBackgroundProperty.AddOwner<CalendarItem>();
public IBrush HeaderBackground
{
get { return GetValue(HeaderBackgroundProperty); }

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

@ -13,7 +13,7 @@ namespace Avalonia.Controls.Primitives
// TODO: Need to track position of adorned elements and move the adorner if they move.
public class AdornerLayer : Panel, ICustomSimpleHitTest
{
public static AttachedProperty<Visual> AdornedElementProperty =
public static readonly AttachedProperty<Visual> AdornedElementProperty =
AvaloniaProperty.RegisterAttached<AdornerLayer, Visual, Visual>("AdornedElement");
private static readonly AttachedProperty<AdornedElementInfo> s_adornedElementInfoProperty =

2
src/Avalonia.Controls/Viewbox.cs

@ -12,7 +12,7 @@ namespace Avalonia.Controls
/// <summary>
/// The stretch property
/// </summary>
public static AvaloniaProperty<Stretch> StretchProperty =
public static readonly AvaloniaProperty<Stretch> StretchProperty =
AvaloniaProperty.RegisterDirect<Viewbox, Stretch>(nameof(Stretch),
v => v.Stretch, (c, v) => c.Stretch = v, Stretch.Uniform);

2
src/Avalonia.Input/Cursors.cs

@ -47,7 +47,7 @@ namespace Avalonia.Input
public class Cursor
{
public static Cursor Default = new Cursor(StandardCursorType.Arrow);
public static readonly Cursor Default = new Cursor(StandardCursorType.Arrow);
internal Cursor(IPlatformHandle platformCursor)
{

6
src/Avalonia.Input/DataFormats.cs

@ -5,11 +5,11 @@
/// <summary>
/// Dataformat for plaintext
/// </summary>
public static string Text = nameof(Text);
public static readonly string Text = nameof(Text);
/// <summary>
/// Dataformat for one or more filenames
/// </summary>
public static string FileNames = nameof(FileNames);
public static readonly string FileNames = nameof(FileNames);
}
}
}

10
src/Avalonia.Input/DragDrop.cs

@ -9,21 +9,21 @@ namespace Avalonia.Input
/// <summary>
/// Event which is raised, when a drag-and-drop operation enters the element.
/// </summary>
public static RoutedEvent<DragEventArgs> DragEnterEvent = RoutedEvent.Register<DragEventArgs>("DragEnter", RoutingStrategies.Bubble, typeof(DragDrop));
public static readonly RoutedEvent<DragEventArgs> DragEnterEvent = RoutedEvent.Register<DragEventArgs>("DragEnter", RoutingStrategies.Bubble, typeof(DragDrop));
/// <summary>
/// Event which is raised, when a drag-and-drop operation leaves the element.
/// </summary>
public static RoutedEvent<RoutedEventArgs> DragLeaveEvent = RoutedEvent.Register<RoutedEventArgs>("DragLeave", RoutingStrategies.Bubble, typeof(DragDrop));
public static readonly RoutedEvent<RoutedEventArgs> DragLeaveEvent = RoutedEvent.Register<RoutedEventArgs>("DragLeave", RoutingStrategies.Bubble, typeof(DragDrop));
/// <summary>
/// Event which is raised, when a drag-and-drop operation is updated while over the element.
/// </summary>
public static RoutedEvent<DragEventArgs> DragOverEvent = RoutedEvent.Register<DragEventArgs>("DragOver", RoutingStrategies.Bubble, typeof(DragDrop));
public static readonly RoutedEvent<DragEventArgs> DragOverEvent = RoutedEvent.Register<DragEventArgs>("DragOver", RoutingStrategies.Bubble, typeof(DragDrop));
/// <summary>
/// Event which is raised, when a drag-and-drop operation should complete over the element.
/// </summary>
public static RoutedEvent<DragEventArgs> DropEvent = RoutedEvent.Register<DragEventArgs>("Drop", RoutingStrategies.Bubble, typeof(DragDrop));
public static readonly RoutedEvent<DragEventArgs> DropEvent = RoutedEvent.Register<DragEventArgs>("Drop", RoutingStrategies.Bubble, typeof(DragDrop));
public static AvaloniaProperty<bool> AllowDropProperty = AvaloniaProperty.RegisterAttached<Interactive, bool>("AllowDrop", typeof(DragDrop), inherits: true);
public static readonly AvaloniaProperty<bool> AllowDropProperty = AvaloniaProperty.RegisterAttached<Interactive, bool>("AllowDrop", typeof(DragDrop), inherits: true);
/// <summary>
/// Gets a value indicating whether the given element can be used as the target of a drag-and-drop operation.

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

@ -11,13 +11,13 @@ namespace Avalonia.Media
/// <summary>
/// Describes the <see cref="Offset"/> property.
/// </summary>
public static StyledProperty<double> OffsetProperty =
public static readonly StyledProperty<double> OffsetProperty =
AvaloniaProperty.Register<GradientStop, double>(nameof(Offset));
/// <summary>
/// Describes the <see cref="Color"/> property.
/// </summary>
public static StyledProperty<Color> ColorProperty =
public static readonly StyledProperty<Color> ColorProperty =
AvaloniaProperty.Register<GradientStop, Color>(nameof(Color));
/// <summary>

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

@ -7,7 +7,7 @@ namespace Avalonia.Media
/// </summary>
public class Typeface
{
public static Typeface Default = new Typeface(FontFamily.Default);
public static readonly Typeface Default = new Typeface(FontFamily.Default);
/// <summary>
/// Initializes a new instance of the <see cref="Typeface"/> class.

Loading…
Cancel
Save