Skip to content

Fix property registrations #8114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Avalonia.Base/Layout/UniformGridLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class UniformGridLayout : VirtualizingLayout, IFlowLayoutAlgorithmDelegat
/// Defines the <see cref="MaximumRowsOrColumnsProperty"/> property.
/// </summary>
public static readonly StyledProperty<int> MaximumRowsOrColumnsProperty =
AvaloniaProperty.Register<UniformGridLayout, int>(nameof(MinItemWidth));
AvaloniaProperty.Register<UniformGridLayout, int>(nameof(MaximumRowsOrColumns));

/// <summary>
/// Defines the <see cref="Orientation"/> property.
Expand Down
4 changes: 2 additions & 2 deletions src/Avalonia.Base/Media/ConicGradientBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ public sealed class ConicGradientBrush : GradientBrush, IConicGradientBrush
/// Defines the <see cref="Center"/> property.
/// </summary>
public static readonly StyledProperty<RelativePoint> CenterProperty =
AvaloniaProperty.Register<RadialGradientBrush, RelativePoint>(
AvaloniaProperty.Register<ConicGradientBrush, RelativePoint>(
nameof(Center),
RelativePoint.Center);

/// <summary>
/// Defines the <see cref="Angle"/> property.
/// </summary>
public static readonly StyledProperty<double> AngleProperty =
AvaloniaProperty.Register<RadialGradientBrush, double>(
AvaloniaProperty.Register<ConicGradientBrush, double>(
nameof(Angle),
0);

Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/ContextMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class ContextMenu : MenuBase, ISetterValue, IPopupHostProvider
/// Defines the <see cref="PlacementRect"/> property.
/// </summary>
public static readonly StyledProperty<Rect?> PlacementRectProperty =
AvaloniaProperty.Register<Popup, Rect?>(nameof(PlacementRect));
Popup.PlacementRectProperty.AddOwner<ContextMenu>();

/// <summary>
/// Defines the <see cref="WindowManagerAddShadowHint"/> property.
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/DockPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class DockPanel : Panel
/// </summary>
public static readonly StyledProperty<bool> LastChildFillProperty =
AvaloniaProperty.Register<DockPanel, bool>(
nameof(LastChildFillProperty),
nameof(LastChildFill),
defaultValue: true);

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/MaskedTextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class MaskedTextBox : TextBox, IStyleable
AvaloniaProperty.Register<MaskedTextBox, string?>(nameof(Mask), string.Empty);

public static new readonly StyledProperty<char> PasswordCharProperty =
AvaloniaProperty.Register<TextBox, char>(nameof(PasswordChar), '\0');
AvaloniaProperty.Register<MaskedTextBox, char>(nameof(PasswordChar), '\0');

public static readonly StyledProperty<char> PromptCharProperty =
AvaloniaProperty.Register<MaskedTextBox, char>(nameof(PromptChar), '_');
Expand Down
6 changes: 3 additions & 3 deletions src/Avalonia.Controls/Presenters/TextPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ public class TextPresenter : Control
AvaloniaProperty.Register<TextPresenter, char>(nameof(PasswordChar));

public static readonly StyledProperty<IBrush?> SelectionBrushProperty =
AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(SelectionBrushProperty));
AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(SelectionBrush));

public static readonly StyledProperty<IBrush?> SelectionForegroundBrushProperty =
AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(SelectionForegroundBrushProperty));
AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(SelectionForegroundBrush));

public static readonly StyledProperty<IBrush?> CaretBrushProperty =
AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(CaretBrushProperty));
AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(CaretBrush));

public static readonly DirectProperty<TextPresenter, int> SelectionStartProperty =
TextBox.SelectionStartProperty.AddOwner<TextPresenter>(
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/Primitives/Popup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Popup : Control, IVisualTreeHost, IPopupHostProvider
#pragma warning restore CS0612 // Type or member is obsolete
{
public static readonly StyledProperty<bool> WindowManagerAddShadowHintProperty =
AvaloniaProperty.Register<PopupRoot, bool>(nameof(WindowManagerAddShadowHint), false);
AvaloniaProperty.Register<Popup, bool>(nameof(WindowManagerAddShadowHint), false);

/// <summary>
/// Defines the <see cref="Child"/> property.
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/Primitives/SelectingItemsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class SelectingItemsControl : ItemsControl
/// Defines the <see cref="IsTextSearchEnabled"/> property.
/// </summary>
public static readonly StyledProperty<bool> IsTextSearchEnabledProperty =
AvaloniaProperty.Register<ItemsControl, bool>(nameof(IsTextSearchEnabled), false);
AvaloniaProperty.Register<SelectingItemsControl, bool>(nameof(IsTextSearchEnabled), false);

/// <summary>
/// Event that should be raised by items that implement <see cref="ISelectable"/> to
Expand Down
6 changes: 3 additions & 3 deletions src/Avalonia.Controls/Primitives/Track.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class Track : Control
AvaloniaProperty.Register<Track, bool>(nameof(IsDirectionReversed));

public static readonly StyledProperty<bool> IgnoreThumbDragProperty =
AvaloniaProperty.Register<Track, bool>(nameof(IsThumbDragHandled));
AvaloniaProperty.Register<Track, bool>(nameof(IgnoreThumbDrag));

private double _minimum;
private double _maximum = 100.0;
Expand Down Expand Up @@ -118,7 +118,7 @@ public bool IsDirectionReversed
set { SetValue(IsDirectionReversedProperty, value); }
}

public bool IsThumbDragHandled
public bool IgnoreThumbDrag
{
get { return GetValue(IgnoreThumbDragProperty); }
set { SetValue(IgnoreThumbDragProperty, value); }
Expand Down Expand Up @@ -442,7 +442,7 @@ private void ButtonChanged(AvaloniaPropertyChangedEventArgs e)

private void ThumbDragged(object? sender, VectorEventArgs e)
{
if (IsThumbDragHandled)
if (IgnoreThumbDrag)
return;

Value = MathUtilities.Clamp(
Expand Down
4 changes: 2 additions & 2 deletions src/Avalonia.Controls/Slider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class Slider : RangeBase
/// Defines the <see cref="TickPlacement"/> property.
/// </summary>
public static readonly StyledProperty<TickPlacement> TickPlacementProperty =
AvaloniaProperty.Register<TickBar, TickPlacement>(nameof(TickPlacement), 0d);
AvaloniaProperty.Register<Slider, TickPlacement>(nameof(TickPlacement), 0d);

/// <summary>
/// Defines the <see cref="TicksProperty"/> property.
Expand Down Expand Up @@ -197,7 +197,7 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)

if (_track != null)
{
_track.IsThumbDragHandled = true;
_track.IgnoreThumbDrag = true;
}

if (_decreaseButton != null)
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/SplitView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Pseudo classes & combos
/// Defines the <see cref="PaneTemplate"/> property.
/// </summary>
public static readonly StyledProperty<IDataTemplate> PaneTemplateProperty =
AvaloniaProperty.Register<HeaderedContentControl, IDataTemplate>(nameof(PaneTemplate));
AvaloniaProperty.Register<SplitView, IDataTemplate>(nameof(PaneTemplate));

/// <summary>
/// Defines the <see cref="UseLightDismissOverlayMode"/> property
Expand Down
6 changes: 3 additions & 3 deletions src/Avalonia.Controls/TextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ public class TextBox : TemplatedControl, UndoRedoHelper<TextBox.UndoRedoState>.I
AvaloniaProperty.Register<TextBox, char>(nameof(PasswordChar));

public static readonly StyledProperty<IBrush?> SelectionBrushProperty =
AvaloniaProperty.Register<TextBox, IBrush?>(nameof(SelectionBrushProperty));
AvaloniaProperty.Register<TextBox, IBrush?>(nameof(SelectionBrush));

public static readonly StyledProperty<IBrush?> SelectionForegroundBrushProperty =
AvaloniaProperty.Register<TextBox, IBrush?>(nameof(SelectionForegroundBrushProperty));
AvaloniaProperty.Register<TextBox, IBrush?>(nameof(SelectionForegroundBrush));

public static readonly StyledProperty<IBrush?> CaretBrushProperty =
AvaloniaProperty.Register<TextBox, IBrush?>(nameof(CaretBrushProperty));
AvaloniaProperty.Register<TextBox, IBrush?>(nameof(CaretBrush));

public static readonly DirectProperty<TextBox, int> SelectionStartProperty =
AvaloniaProperty.RegisterDirect<TextBox, int>(
Expand Down