Browse Source

Merge branch 'fixes/moreTextProcessingFixes' of https://github.com/Gillibald/Avalonia into fixes/moreTextProcessingFixes

pull/10784/head
Benedikt Stebner 3 years ago
parent
commit
a8a0577b53
  1. 2
      src/Avalonia.Base/Layout/Layoutable.cs
  2. 108
      src/Avalonia.Base/Threading/DispatcherPriority.cs
  3. 2
      src/Avalonia.Base/Visual.cs
  4. 2
      src/Avalonia.Controls.ItemsRepeater/Layout/UniformGridLayout.cs
  5. 104
      src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.Properties.cs
  6. 65
      src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.cs
  7. 2
      src/Avalonia.Controls/Primitives/ScrollBar.cs
  8. 2
      src/Avalonia.Controls/ScrollViewer.cs
  9. 2
      src/Avalonia.Controls/Slider.cs
  10. 2
      src/Avalonia.Controls/TopLevel.cs

2
src/Avalonia.Base/Layout/Layoutable.cs

@ -125,7 +125,7 @@ namespace Avalonia.Layout
AvaloniaProperty.Register<Layoutable, VerticalAlignment>(nameof(VerticalAlignment));
/// <summary>
/// Defines the <see cref="UseLayoutRoundingProperty"/> property.
/// Defines the <see cref="UseLayoutRounding"/> property.
/// </summary>
public static readonly StyledProperty<bool> UseLayoutRoundingProperty =
AvaloniaProperty.Register<Layoutable, bool>(nameof(UseLayoutRounding), defaultValue: true, inherits: true);

108
src/Avalonia.Base/Threading/DispatcherPriority.cs

@ -16,64 +16,64 @@ namespace Avalonia.Threading
{
Value = value;
}
/// <summary>
/// Minimum possible priority that's actually dispatched, default value
/// </summary>
internal static readonly DispatcherPriority MinimumActiveValue = new(0);
/// <summary>
/// A dispatcher priority for jobs that shouldn't be executed yet
/// The lowest foreground dispatcher priority
/// </summary>
public static DispatcherPriority Inactive => new(MinimumActiveValue - 1);
internal static readonly DispatcherPriority Default = new(0);
/// <summary>
/// Minimum valid priority
/// The job will be processed with the same priority as input.
/// </summary>
internal static readonly DispatcherPriority MinValue = new(Inactive);
public static readonly DispatcherPriority Input = new(Default - 1);
/// <summary>
/// Used internally in dispatcher code
/// The job will be processed after other non-idle operations have completed.
/// </summary>
public static DispatcherPriority Invalid => new(MinimumActiveValue - 2);
public static readonly DispatcherPriority Background = new(Input - 1);
/// <summary>
/// The job will be processed after background operations have completed.
/// </summary>
public static readonly DispatcherPriority ContextIdle = new(Background - 1);
/// <summary>
/// The job will be processed when the system is idle.
/// The job will be processed when the application is idle.
/// </summary>
[Obsolete("WPF compatibility")] public static readonly DispatcherPriority SystemIdle = MinimumActiveValue;
public static readonly DispatcherPriority ApplicationIdle = new (ContextIdle - 1);
/// <summary>
/// The job will be processed when the application is idle.
/// The job will be processed when the system is idle.
/// </summary>
[Obsolete("WPF compatibility")] public static readonly DispatcherPriority ApplicationIdle = new (SystemIdle + 1);
public static readonly DispatcherPriority SystemIdle = new(ApplicationIdle - 1);
/// <summary>
/// The job will be processed after background operations have completed.
/// Minimum possible priority that's actually dispatched, default value
/// </summary>
[Obsolete("WPF compatibility")] public static readonly DispatcherPriority ContextIdle = new(ApplicationIdle + 1);
internal static readonly DispatcherPriority MinimumActiveValue = new(SystemIdle);
/// <summary>
/// The job will be processed with normal priority.
/// A dispatcher priority for jobs that shouldn't be executed yet
/// </summary>
#pragma warning disable CS0618
public static readonly DispatcherPriority Normal = new(ContextIdle + 1);
#pragma warning restore CS0618
public static readonly DispatcherPriority Inactive = new(MinimumActiveValue - 1);
/// <summary>
/// The job will be processed after other non-idle operations have completed.
/// Minimum valid priority
/// </summary>
public static readonly DispatcherPriority Background = new(MinValue + 1);
internal static readonly DispatcherPriority MinValue = new(Inactive);
/// <summary>
/// The job will be processed with the same priority as input.
/// Used internally in dispatcher code
/// </summary>
public static readonly DispatcherPriority Input = new(Background + 1);
public static readonly DispatcherPriority Invalid = new(MinimumActiveValue - 2);
/// <summary>
/// The job will be processed after layout and render but before input.
/// </summary>
public static readonly DispatcherPriority Loaded = new(Input + 1);
public static readonly DispatcherPriority Loaded = new(Default + 1);
/// <summary>
/// The job will be processed with the same priority as render.
@ -98,12 +98,19 @@ namespace Avalonia.Threading
/// <summary>
/// The job will be processed with the same priority as data binding.
/// </summary>
[Obsolete("WPF compatibility")] public static readonly DispatcherPriority DataBind = MinValue;
[Obsolete("WPF compatibility")] public static readonly DispatcherPriority DataBind = new(Layout);
/// <summary>
/// The job will be processed with normal priority.
/// </summary>
#pragma warning disable CS0618
public static readonly DispatcherPriority Normal = new(DataBind + 1);
#pragma warning restore CS0618
/// <summary>
/// The job will be processed before other asynchronous operations.
/// </summary>
public static readonly DispatcherPriority Send = new(Layout + 1);
public static readonly DispatcherPriority Send = new(Normal + 1);
/// <summary>
/// Maximum possible priority
@ -151,5 +158,42 @@ namespace Avalonia.Threading
if (priority < Inactive || priority > MaxValue)
throw new ArgumentException("Invalid DispatcherPriority value", parameterName);
}
#pragma warning disable CS0618
public override string ToString()
{
if (this == Invalid)
return nameof(Invalid);
if (this == Inactive)
return nameof(Inactive);
if (this == SystemIdle)
return nameof(SystemIdle);
if (this == ContextIdle)
return nameof(ContextIdle);
if (this == ApplicationIdle)
return nameof(ApplicationIdle);
if (this == Background)
return nameof(Background);
if (this == Input)
return nameof(Input);
if (this == Default)
return nameof(Default);
if (this == Loaded)
return nameof(Loaded);
if (this == Render)
return nameof(Render);
if (this == Composition)
return nameof(Composition);
if (this == PreComposition)
return nameof(PreComposition);
if (this == DataBind)
return nameof(DataBind);
if (this == Normal)
return nameof(Normal);
if (this == Send)
return nameof(Send);
return Value.ToString();
}
#pragma warning restore CS0618
}
}

2
src/Avalonia.Base/Visual.cs

@ -50,7 +50,7 @@ namespace Avalonia
AvaloniaProperty.Register<Visual, Geometry?>(nameof(Clip));
/// <summary>
/// Defines the <see cref="IsVisibleProperty"/> property.
/// Defines the <see cref="IsVisible"/> property.
/// </summary>
public static readonly StyledProperty<bool> IsVisibleProperty =
AvaloniaProperty.Register<Visual, bool>(nameof(IsVisible), true);

2
src/Avalonia.Controls.ItemsRepeater/Layout/UniformGridLayout.cs

@ -113,7 +113,7 @@ namespace Avalonia.Layout
AvaloniaProperty.Register<UniformGridLayout, double>(nameof(MinRowSpacing));
/// <summary>
/// Defines the <see cref="MaximumRowsOrColumnsProperty"/> property.
/// Defines the <see cref="MaximumRowsOrColumns"/> property.
/// </summary>
public static readonly StyledProperty<int> MaximumRowsOrColumnsProperty =
AvaloniaProperty.Register<UniformGridLayout, int>(nameof(MaximumRowsOrColumns));

104
src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.Properties.cs

@ -52,34 +52,32 @@ namespace Avalonia.Controls
/// </summary>
/// <value>The identifier for the <see cref="IsTextCompletionEnabled" /> property.</value>
public static readonly StyledProperty<bool> IsTextCompletionEnabledProperty =
AvaloniaProperty.Register<AutoCompleteBox, bool>(nameof(IsTextCompletionEnabled));
AvaloniaProperty.Register<AutoCompleteBox, bool>(
nameof(IsTextCompletionEnabled));
/// <summary>
/// Identifies the <see cref="ItemTemplate" /> property.
/// </summary>
/// <value>The identifier for the <see cref="ItemTemplate" /> property.</value>
public static readonly StyledProperty<IDataTemplate> ItemTemplateProperty =
AvaloniaProperty.Register<AutoCompleteBox, IDataTemplate>(nameof(ItemTemplate));
AvaloniaProperty.Register<AutoCompleteBox, IDataTemplate>(
nameof(ItemTemplate));
/// <summary>
/// Identifies the <see cref="IsDropDownOpen" /> property.
/// </summary>
/// <value>The identifier for the <see cref="IsDropDownOpen" /> property.</value>
public static readonly DirectProperty<AutoCompleteBox, bool> IsDropDownOpenProperty =
AvaloniaProperty.RegisterDirect<AutoCompleteBox, bool>(
nameof(IsDropDownOpen),
o => o.IsDropDownOpen,
(o, v) => o.IsDropDownOpen = v);
public static readonly StyledProperty<bool> IsDropDownOpenProperty =
AvaloniaProperty.Register<AutoCompleteBox, bool>(
nameof(IsDropDownOpen));
/// <summary>
/// Identifies the <see cref="SelectedItem" /> property.
/// </summary>
/// <value>The identifier the <see cref="SelectedItem" /> property.</value>
public static readonly DirectProperty<AutoCompleteBox, object?> SelectedItemProperty =
AvaloniaProperty.RegisterDirect<AutoCompleteBox, object?>(
public static readonly StyledProperty<object?> SelectedItemProperty =
AvaloniaProperty.Register<AutoCompleteBox, object?>(
nameof(SelectedItem),
o => o.SelectedItem,
(o, v) => o.SelectedItem = v,
defaultBindingMode: BindingMode.TwoWay,
enableDataValidation: true);
@ -115,58 +113,50 @@ namespace Avalonia.Controls
/// Identifies the <see cref="ItemFilter" /> property.
/// </summary>
/// <value>The identifier for the <see cref="ItemFilter" /> property.</value>
public static readonly DirectProperty<AutoCompleteBox, AutoCompleteFilterPredicate<object?>?> ItemFilterProperty =
AvaloniaProperty.RegisterDirect<AutoCompleteBox, AutoCompleteFilterPredicate<object?>?>(
nameof(ItemFilter),
o => o.ItemFilter,
(o, v) => o.ItemFilter = v);
public static readonly StyledProperty<AutoCompleteFilterPredicate<object?>?> ItemFilterProperty =
AvaloniaProperty.Register<AutoCompleteBox, AutoCompleteFilterPredicate<object?>?>(
nameof(ItemFilter));
/// <summary>
/// Identifies the <see cref="TextFilter" /> property.
/// </summary>
/// <value>The identifier for the <see cref="TextFilter" /> property.</value>
public static readonly DirectProperty<AutoCompleteBox, AutoCompleteFilterPredicate<string?>?> TextFilterProperty =
AvaloniaProperty.RegisterDirect<AutoCompleteBox, AutoCompleteFilterPredicate<string?>?>(
public static readonly StyledProperty<AutoCompleteFilterPredicate<string?>?> TextFilterProperty =
AvaloniaProperty.Register<AutoCompleteBox, AutoCompleteFilterPredicate<string?>?>(
nameof(TextFilter),
o => o.TextFilter,
(o, v) => o.TextFilter = v,
unsetValue: AutoCompleteSearch.GetFilter(AutoCompleteFilterMode.StartsWith));
defaultValue: AutoCompleteSearch.GetFilter(AutoCompleteFilterMode.StartsWith));
/// <summary>
/// Identifies the <see cref="ItemSelector" /> property.
/// </summary>
/// <value>The identifier for the <see cref="ItemSelector" /> property.</value>
public static readonly DirectProperty<AutoCompleteBox, AutoCompleteSelector<object>?> ItemSelectorProperty =
AvaloniaProperty.RegisterDirect<AutoCompleteBox, AutoCompleteSelector<object>?>(
nameof(ItemSelector),
o => o.ItemSelector,
(o, v) => o.ItemSelector = v);
public static readonly StyledProperty<AutoCompleteSelector<object>?> ItemSelectorProperty =
AvaloniaProperty.Register<AutoCompleteBox, AutoCompleteSelector<object>?>(
nameof(ItemSelector));
/// <summary>
/// Identifies the <see cref="TextSelector" /> property.
/// </summary>
/// <value>The identifier for the <see cref="TextSelector" /> property.</value>
public static readonly DirectProperty<AutoCompleteBox, AutoCompleteSelector<string?>?> TextSelectorProperty =
AvaloniaProperty.RegisterDirect<AutoCompleteBox, AutoCompleteSelector<string?>?>(
nameof(TextSelector),
o => o.TextSelector,
(o, v) => o.TextSelector = v);
public static readonly StyledProperty<AutoCompleteSelector<string?>?> TextSelectorProperty =
AvaloniaProperty.Register<AutoCompleteBox, AutoCompleteSelector<string?>?>(
nameof(TextSelector));
/// <summary>
/// Identifies the <see cref="Items" /> property.
/// </summary>
/// <value>The identifier for the <see cref="Items" /> property.</value>
public static readonly DirectProperty<AutoCompleteBox, IEnumerable?> ItemsProperty =
AvaloniaProperty.RegisterDirect<AutoCompleteBox, IEnumerable?>(
nameof(Items),
o => o.Items,
(o, v) => o.Items = v);
public static readonly StyledProperty<IEnumerable?> ItemsProperty =
AvaloniaProperty.Register<AutoCompleteBox, IEnumerable?>(
nameof(Items));
public static readonly DirectProperty<AutoCompleteBox, Func<string?, CancellationToken, Task<IEnumerable<object>>>?> AsyncPopulatorProperty =
AvaloniaProperty.RegisterDirect<AutoCompleteBox, Func<string?, CancellationToken, Task<IEnumerable<object>>>?>(
nameof(AsyncPopulator),
o => o.AsyncPopulator,
(o, v) => o.AsyncPopulator = v);
/// <summary>
/// Identifies the <see cref="AsyncPopulator" /> property.
/// </summary>
/// <value>The identifier for the <see cref="AsyncPopulator" /> property.</value>
public static readonly StyledProperty<Func<string?, CancellationToken, Task<IEnumerable<object>>>?> AsyncPopulatorProperty =
AvaloniaProperty.Register<AutoCompleteBox, Func<string?, CancellationToken, Task<IEnumerable<object>>>?>(
nameof(AsyncPopulator));
/// <summary>
/// Gets or sets the minimum number of characters required to be entered
@ -265,8 +255,8 @@ namespace Avalonia.Controls
/// </value>
public bool IsDropDownOpen
{
get => _isDropDownOpen;
set => SetAndRaise(IsDropDownOpenProperty, ref _isDropDownOpen, value);
get => GetValue(IsDropDownOpenProperty);
set => SetValue(IsDropDownOpenProperty, value);
}
/// <summary>
@ -303,8 +293,8 @@ namespace Avalonia.Controls
/// </remarks>
public object? SelectedItem
{
get => _selectedItem;
set => SetAndRaise(SelectedItemProperty, ref _selectedItem, value);
get => GetValue(SelectedItemProperty);
set => SetValue(SelectedItemProperty, value);
}
/// <summary>
@ -388,8 +378,8 @@ namespace Avalonia.Controls
/// </remarks>
public AutoCompleteFilterPredicate<object?>? ItemFilter
{
get => _itemFilter;
set => SetAndRaise(ItemFilterProperty, ref _itemFilter, value);
get => GetValue(ItemFilterProperty);
set => SetValue(ItemFilterProperty, value);
}
/// <summary>
@ -406,8 +396,8 @@ namespace Avalonia.Controls
/// </remarks>
public AutoCompleteFilterPredicate<string?>? TextFilter
{
get => _textFilter;
set => SetAndRaise(TextFilterProperty, ref _textFilter, value);
get => GetValue(TextFilterProperty);
set => SetValue(TextFilterProperty, value);
}
/// <summary>
@ -420,8 +410,8 @@ namespace Avalonia.Controls
/// </value>
public AutoCompleteSelector<object>? ItemSelector
{
get => _itemSelector;
set => SetAndRaise(ItemSelectorProperty, ref _itemSelector, value);
get => GetValue(ItemSelectorProperty);
set => SetValue(ItemSelectorProperty, value);
}
/// <summary>
@ -436,14 +426,14 @@ namespace Avalonia.Controls
/// </value>
public AutoCompleteSelector<string?>? TextSelector
{
get => _textSelector;
set => SetAndRaise(TextSelectorProperty, ref _textSelector, value);
get => GetValue(TextSelectorProperty);
set => SetValue(TextSelectorProperty, value);
}
public Func<string?, CancellationToken, Task<IEnumerable<object>>>? AsyncPopulator
{
get => _asyncPopulator;
set => SetAndRaise(AsyncPopulatorProperty, ref _asyncPopulator, value);
get => GetValue(AsyncPopulatorProperty);
set => SetValue(AsyncPopulatorProperty, value);
}
/// <summary>
@ -454,8 +444,8 @@ namespace Avalonia.Controls
/// drop-down portion of the <see cref="AutoCompleteBox" /> control.</value>
public IEnumerable? Items
{
get => _itemsEnumerable;
set => SetAndRaise(ItemsProperty, ref _itemsEnumerable, value);
get => GetValue(ItemsProperty);
set => SetValue(ItemsProperty, value);
}
}
}

65
src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.cs

@ -94,8 +94,6 @@ namespace Avalonia.Controls
/// </summary>
private const string ElementTextBox = "PART_TextBox";
private IEnumerable? _itemsEnumerable;
/// <summary>
/// Gets or sets a local cached copy of the items data.
/// </summary>
@ -188,24 +186,15 @@ namespace Avalonia.Controls
/// </summary>
private IDisposable? _collectionChangeSubscription;
private Func<string?, CancellationToken, Task<IEnumerable<object>>>? _asyncPopulator;
private CancellationTokenSource? _populationCancellationTokenSource;
private bool _itemTemplateIsFromValueMemberBinding = true;
private bool _settingItemTemplateFromValueMemberBinding;
private object? _selectedItem;
private bool _isDropDownOpen;
private bool _isFocused = false;
private string? _searchText = string.Empty;
private AutoCompleteFilterPredicate<object?>? _itemFilter;
private AutoCompleteFilterPredicate<string?>? _textFilter = AutoCompleteSearch.GetFilter(AutoCompleteFilterMode.StartsWith);
private AutoCompleteSelector<object>? _itemSelector;
private AutoCompleteSelector<string?>? _textSelector;
private readonly EventHandler _populateDropDownHandler;
/// <summary>
@ -264,7 +253,7 @@ namespace Avalonia.Controls
bool isEnabled = (bool)e.NewValue!;
if (!isEnabled)
{
IsDropDownOpen = false;
SetCurrentValue(IsDropDownOpenProperty, false);
}
}
@ -388,7 +377,7 @@ namespace Avalonia.Controls
{
// Reset the old value before it was incorrectly written
_ignorePropertyChange = true;
SetValue(e.Property, e.OldValue);
SetCurrentValue(e.Property, e.OldValue);
throw new InvalidOperationException("Cannot set read-only property SearchText.");
}
@ -403,7 +392,7 @@ namespace Avalonia.Controls
AutoCompleteFilterMode mode = (AutoCompleteFilterMode)e.NewValue!;
// Sets the filter predicate for the new value
TextFilter = AutoCompleteSearch.GetFilter(mode);
SetCurrentValue(TextFilterProperty, AutoCompleteSearch.GetFilter(mode));
}
/// <summary>
@ -417,12 +406,12 @@ namespace Avalonia.Controls
// If null, revert to the "None" predicate
if (value == null)
{
FilterMode = AutoCompleteFilterMode.None;
SetCurrentValue(FilterModeProperty, AutoCompleteFilterMode.None);
}
else
{
FilterMode = AutoCompleteFilterMode.Custom;
TextFilter = null;
SetCurrentValue(FilterModeProperty, AutoCompleteFilterMode.Custom);
SetCurrentValue(TextFilterProperty, null);
}
}
@ -442,7 +431,7 @@ namespace Avalonia.Controls
}
private void OnValueMemberBindingChanged(IBinding? value)
{
if(_itemTemplateIsFromValueMemberBinding)
if (_itemTemplateIsFromValueMemberBinding)
{
var template =
new FuncDataTemplate(
@ -456,7 +445,7 @@ namespace Avalonia.Controls
});
_settingItemTemplateFromValueMemberBinding = true;
ItemTemplate = template;
SetCurrentValue(ItemTemplateProperty, template);
_settingItemTemplateFromValueMemberBinding = false;
}
}
@ -713,7 +702,7 @@ namespace Avalonia.Controls
// The drop down is not open, the Down key will toggle it open.
if (e.Key == Key.Down)
{
IsDropDownOpen = true;
SetCurrentValue(IsDropDownOpenProperty, true);
e.Handled = true;
}
}
@ -722,7 +711,7 @@ namespace Avalonia.Controls
switch (e.Key)
{
case Key.F4:
IsDropDownOpen = !IsDropDownOpen;
SetCurrentValue(IsDropDownOpenProperty, !IsDropDownOpen);
e.Handled = true;
break;
@ -827,7 +816,7 @@ namespace Avalonia.Controls
}
else
{
IsDropDownOpen = false;
SetCurrentValue(IsDropDownOpenProperty, false);
_userCalledPopulate = false;
ClearTextBoxSelection();
}
@ -1021,7 +1010,7 @@ namespace Avalonia.Controls
if (args.Cancel)
{
_ignorePropertyChange = true;
SetValue(IsDropDownOpenProperty, oldValue);
SetCurrentValue(IsDropDownOpenProperty, oldValue);
}
else
{
@ -1046,7 +1035,7 @@ namespace Avalonia.Controls
if (args.Cancel)
{
_ignorePropertyChange = true;
SetValue(IsDropDownOpenProperty, oldValue);
SetCurrentValue(IsDropDownOpenProperty, oldValue);
}
else
{
@ -1066,7 +1055,7 @@ namespace Avalonia.Controls
// Force the drop down dependency property to be false.
if (IsDropDownOpen)
{
IsDropDownOpen = false;
SetCurrentValue(IsDropDownOpenProperty, false);
}
// Fire the DropDownClosed event
@ -1088,7 +1077,7 @@ namespace Avalonia.Controls
// Update the prefix/search text.
SearchText = Text;
if(TryPopulateAsync(SearchText))
if (TryPopulateAsync(SearchText))
{
return;
}
@ -1110,7 +1099,7 @@ namespace Avalonia.Controls
_populationCancellationTokenSource?.Dispose();
_populationCancellationTokenSource = null;
if(_asyncPopulator == null)
if (AsyncPopulator == null)
{
return false;
}
@ -1127,7 +1116,7 @@ namespace Avalonia.Controls
try
{
IEnumerable<object> result = await _asyncPopulator!.Invoke(searchText, cancellationToken);
IEnumerable<object> result = await AsyncPopulator!.Invoke(searchText, cancellationToken);
var resultList = result.ToList();
if (cancellationToken.IsCancellationRequested)
@ -1139,7 +1128,7 @@ namespace Avalonia.Controls
{
if (!cancellationToken.IsCancellationRequested)
{
Items = resultList;
SetCurrentValue(ItemsProperty, resultList);
PopulateComplete();
}
});
@ -1199,7 +1188,7 @@ namespace Avalonia.Controls
private string? FormatValue(object? value, bool clearDataContext)
{
string? result = FormatValue(value);
if(clearDataContext && _valueBindingEvaluator != null)
if (clearDataContext && _valueBindingEvaluator != null)
{
_valueBindingEvaluator.ClearDataContext();
}
@ -1332,7 +1321,7 @@ namespace Avalonia.Controls
// 1. Minimum prefix length
// 2. If a delay timer is in use, use it
bool populateReady = newText.Length >= MinimumPrefixLength && MinimumPrefixLength >= 0;
if(populateReady && MinimumPrefixLength == 0 && String.IsNullOrEmpty(newText) && String.IsNullOrEmpty(SearchText))
if (populateReady && MinimumPrefixLength == 0 && String.IsNullOrEmpty(newText) && String.IsNullOrEmpty(SearchText))
{
populateReady = false;
}
@ -1361,10 +1350,12 @@ namespace Avalonia.Controls
{
_skipSelectedItemTextUpdate = true;
}
SelectedItem = null;
SetCurrentValue(SelectedItemProperty, null);
if (IsDropDownOpen)
{
IsDropDownOpen = false;
SetCurrentValue(IsDropDownOpenProperty, false);
}
}
}
@ -1600,7 +1591,7 @@ namespace Avalonia.Controls
if (isDropDownOpen != IsDropDownOpen)
{
_ignorePropertyChange = true;
IsDropDownOpen = isDropDownOpen;
SetCurrentValue(IsDropDownOpenProperty, isDropDownOpen);
}
if (IsDropDownOpen)
{
@ -1688,7 +1679,7 @@ namespace Avalonia.Controls
{
_skipSelectedItemTextUpdate = true;
}
SelectedItem = newSelectedItem;
SetCurrentValue(SelectedItemProperty, newSelectedItem);
// Restore updates for TextSelection
if (_ignoreTextSelectionChange)
@ -1784,7 +1775,7 @@ namespace Avalonia.Controls
/// <param name="e">The selection changed event data.</param>
private void OnAdapterSelectionChanged(object? sender, SelectionChangedEventArgs e)
{
SelectedItem = _adapter!.SelectedItem;
SetCurrentValue(SelectedItemProperty, _adapter!.SelectedItem);
}
//TODO Check UpdateTextCompletion
@ -1795,7 +1786,7 @@ namespace Avalonia.Controls
/// <param name="e">The event data.</param>
private void OnAdapterSelectionComplete(object? sender, RoutedEventArgs e)
{
IsDropDownOpen = false;
SetCurrentValue(IsDropDownOpenProperty, false);
// Completion will update the selected value
//UpdateTextCompletion(false);

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

@ -49,7 +49,7 @@ namespace Avalonia.Controls.Primitives
AvaloniaProperty.Register<ScrollBar, Orientation>(nameof(Orientation), Orientation.Vertical);
/// <summary>
/// Defines the <see cref="IsExpandedProperty"/> property.
/// Defines the <see cref="IsExpanded"/> property.
/// </summary>
public static readonly DirectProperty<ScrollBar, bool> IsExpandedProperty =
AvaloniaProperty.RegisterDirect<ScrollBar, bool>(

2
src/Avalonia.Controls/ScrollViewer.cs

@ -200,7 +200,7 @@ namespace Avalonia.Controls
ScrollBarVisibility.Auto);
/// <summary>
/// Defines the <see cref="IsExpandedProperty"/> property.
/// Defines the <see cref="IsExpanded"/> property.
/// </summary>
public static readonly DirectProperty<ScrollViewer, bool> IsExpandedProperty =
ScrollBar.IsExpandedProperty.AddOwner<ScrollViewer>(o => o.IsExpanded);

2
src/Avalonia.Controls/Slider.cs

@ -80,7 +80,7 @@ namespace Avalonia.Controls
AvaloniaProperty.Register<Slider, TickPlacement>(nameof(TickPlacement), 0d);
/// <summary>
/// Defines the <see cref="TicksProperty"/> property.
/// Defines the <see cref="Ticks"/> property.
/// </summary>
public static readonly StyledProperty<AvaloniaList<double>?> TicksProperty =
TickBar.TicksProperty.AddOwner<Slider>();

2
src/Avalonia.Controls/TopLevel.cs

@ -75,7 +75,7 @@ namespace Avalonia.Controls
unsetValue: WindowTransparencyLevel.None);
/// <summary>
/// Defines the <see cref="TransparencyBackgroundFallbackProperty"/> property.
/// Defines the <see cref="TransparencyBackgroundFallback"/> property.
/// </summary>
public static readonly StyledProperty<IBrush> TransparencyBackgroundFallbackProperty =
AvaloniaProperty.Register<TopLevel, IBrush>(nameof(TransparencyBackgroundFallback), Brushes.White);

Loading…
Cancel
Save