Browse Source

Merge pull request #1427 from sdoroff/auto-complete-box-control

Added AutoCompleteBox control
pull/1480/head
Steven Kirk 8 years ago
committed by GitHub
parent
commit
4d5d44a5c2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      samples/ControlCatalog/ControlCatalog.csproj
  2. 5
      samples/ControlCatalog/MainView.xaml
  3. 59
      samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml
  4. 143
      samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml.cs
  5. 2726
      src/Avalonia.Controls/AutoCompleteBox.cs
  6. 2
      src/Avalonia.Controls/TextBox.cs
  7. 64
      src/Avalonia.Controls/Utils/ISelectionAdapter.cs
  8. 342
      src/Avalonia.Controls/Utils/SelectingItemsControlSelectionAdapter.cs
  9. 2
      src/Avalonia.Input/KeyboardDevice.cs
  10. 43
      src/Avalonia.Themes.Default/AutoCompleteBox.xaml
  11. 3
      src/Avalonia.Themes.Default/DefaultTheme.xaml
  12. 2
      src/Avalonia.Visuals/Media/GradientBrush.cs
  13. 1042
      tests/Avalonia.Controls.UnitTests/AutoCompleteBoxTests.cs

6
samples/ControlCatalog/ControlCatalog.csproj

@ -41,6 +41,9 @@
<EmbeddedResource Include="Pages\DialogsPage.xaml">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Pages\AutoCompleteBoxPage.xaml">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Pages\BorderPage.xaml">
<SubType>Designer</SubType>
</EmbeddedResource>
@ -116,6 +119,9 @@
<Compile Include="Pages\BorderPage.xaml.cs">
<DependentUpon>BorderPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\AutoCompleteBoxPage.xaml.cs">
<DependentUpon>AutoCompleteBoxPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\ButtonPage.xaml.cs">
<DependentUpon>ButtonPage.xaml</DependentUpon>
</Compile>

5
samples/ControlCatalog/MainView.xaml

@ -5,10 +5,11 @@
<TabControl.Transition>
<CrossFade Duration="0.25"/>
</TabControl.Transition>
<TabItem Header="AutoCompleteBox"><pages:AutoCompleteBoxPage/></TabItem>
<TabItem Header="Border"><pages:BorderPage/></TabItem>
<TabItem Header="Button"><pages:ButtonPage/></TabItem>
<TabItem Header="ButtonSpinner"><pages:ButtonSpinnerPage/></TabItem>
<TabItem Header="Calendar"><pages:CalendarPage/></TabItem>
<TabItem Header="Calendar"><pages:CalendarPage/></TabItem>
<TabItem Header="Canvas"><pages:CanvasPage/></TabItem>
<TabItem Header="Carousel"><pages:CarouselPage/></TabItem>
<TabItem Header="CheckBox"><pages:CheckBoxPage/></TabItem>
@ -27,4 +28,4 @@
<TabItem Header="ToolTip"><pages:ToolTipPage/></TabItem>
<TabItem Header="TreeView"><pages:TreeViewPage/></TabItem>
</TabControl>
</UserControl>
</UserControl>

59
samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml

@ -0,0 +1,59 @@
<UserControl xmlns="https://github.com/avaloniaui">
<StackPanel Orientation="Vertical" Gap="4">
<TextBlock Classes="h1">AutoCompleteBox</TextBlock>
<TextBlock Classes="h2">A control into which the user can input text</TextBlock>
<StackPanel Orientation="Horizontal"
Margin="0,16,0,0"
HorizontalAlignment="Center"
Gap="8">
<StackPanel Orientation="Vertical">
<TextBlock Text="MinimumPrefixLength: 1"/>
<AutoCompleteBox Width="200"
Margin="0,0,0,8"
MinimumPrefixLength="1"/>
<TextBlock Text="MinimumPrefixLength: 3"/>
<AutoCompleteBox Width="200"
Margin="0,0,0,8"
MinimumPrefixLength="3"/>
<TextBlock Text="MinimumPopulateDelay: 1 Second"/>
<AutoCompleteBox Width="200"
Margin="0,0,0,8"
MinimumPopulateDelay="1"/>
<TextBlock Text="MaxDropDownHeight: 60"/>
<AutoCompleteBox Width="200"
Margin="0,0,0,8"
MaxDropDownHeight="60"/>
<AutoCompleteBox Width="200"
Margin="0,0,0,8"
Watermark="Watermark"/>
<TextBlock Text="Disabled"/>
<AutoCompleteBox Width="200"
IsEnabled="False"/>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock Text="ValueMemeberSelector"/>
<AutoCompleteBox Width="200"
Margin="0,0,0,8"
ValueMemberSelector="Capital"/>
<TextBlock Text="ValueMemberBinding"/>
<AutoCompleteBox Width="200"
Margin="0,0,0,8"
ValueMemberBinding="{Binding Capital}"/>
<TextBlock Text="Multi-Binding"/>
<AutoCompleteBox Name="MultiBindingBox"
Width="200"
Margin="0,0,0,8"
FilterMode="Contains"/>
<TextBlock Text="Async Populate"/>
<AutoCompleteBox Name="AsyncBox"
Width="200"
Margin="0,0,0,8"
FilterMode="None"/>
</StackPanel>
</StackPanel>
</StackPanel>
</UserControl>

143
samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml.cs

@ -0,0 +1,143 @@
using Avalonia.Controls;
using Avalonia.LogicalTree;
using Avalonia.Markup;
using Avalonia.Markup.Xaml;
using Avalonia.Markup.Xaml.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace ControlCatalog.Pages
{
public class AutoCompleteBoxPage : UserControl
{
public class StateData
{
public string Name { get; private set; }
public string Abbreviation { get; private set; }
public string Capital { get; private set; }
public StateData(string name, string abbreviatoin, string capital)
{
Name = name;
Abbreviation = abbreviatoin;
Capital = capital;
}
public override string ToString()
{
return Name;
}
}
private StateData[] BuildAllStates()
{
return new StateData[]
{
new StateData("Alabama","AL","Montgomery"),
new StateData("Alaska","AK","Juneau"),
new StateData("Arizona","AZ","Phoenix"),
new StateData("Arkansas","AR","Little Rock"),
new StateData("California","CA","Sacramento"),
new StateData("Colorado","CO","Denver"),
new StateData("Connecticut","CT","Hartford"),
new StateData("Delaware","DE","Dover"),
new StateData("Florida","FL","Tallahassee"),
new StateData("Georgia","GA","Atlanta"),
new StateData("Hawaii","HI","Honolulu"),
new StateData("Idaho","ID","Boise"),
new StateData("Illinois","IL","Springfield"),
new StateData("Indiana","IN","Indianapolis"),
new StateData("Iowa","IA","Des Moines"),
new StateData("Kansas","KS","Topeka"),
new StateData("Kentucky","KY","Frankfort"),
new StateData("Louisiana","LA","Baton Rouge"),
new StateData("Maine","ME","Augusta"),
new StateData("Maryland","MD","Annapolis"),
new StateData("Massachusetts","MA","Boston"),
new StateData("Michigan","MI","Lansing"),
new StateData("Minnesota","MN","St. Paul"),
new StateData("Mississippi","MS","Jackson"),
new StateData("Missouri","MO","Jefferson City"),
new StateData("Montana","MT","Helena"),
new StateData("Nebraska","NE","Lincoln"),
new StateData("Nevada","NV","Carson City"),
new StateData("New Hampshire","NH","Concord"),
new StateData("New Jersey","NJ","Trenton"),
new StateData("New Mexico","NM","Santa Fe"),
new StateData("New York","NY","Albany"),
new StateData("North Carolina","NC","Raleigh"),
new StateData("North Dakota","ND","Bismarck"),
new StateData("Ohio","OH","Columbus"),
new StateData("Oklahoma","OK","Oklahoma City"),
new StateData("Oregon","OR","Salem"),
new StateData("Pennsylvania","PA","Harrisburg"),
new StateData("Rhode Island","RI","Providence"),
new StateData("South Carolina","SC","Columbia"),
new StateData("South Dakota","SD","Pierre"),
new StateData("Tennessee","TN","Nashville"),
new StateData("Texas","TX","Austin"),
new StateData("Utah","UT","Salt Lake City"),
new StateData("Vermont","VT","Montpelier"),
new StateData("Virginia","VA","Richmond"),
new StateData("Washington","WA","Olympia"),
new StateData("West Virginia","WV","Charleston"),
new StateData("Wisconsin","WI","Madison"),
new StateData("Wyoming","WY","Cheyenne"),
};
}
public StateData[] States { get; private set; }
public AutoCompleteBoxPage()
{
this.InitializeComponent();
States = BuildAllStates();
foreach (AutoCompleteBox box in GetAllAutoCompleteBox())
{
box.Items = States;
}
var converter = new FuncMultiValueConverter<string, string>(parts =>
{
return String.Format("{0} ({1})", parts.ToArray());
});
var binding = new MultiBinding { Converter = converter };
binding.Bindings.Add(new Binding("Name"));
binding.Bindings.Add(new Binding("Abbreviation"));
var multibindingBox = this.FindControl<AutoCompleteBox>("MultiBindingBox");
multibindingBox.ValueMemberBinding = binding;
var asyncBox = this.FindControl<AutoCompleteBox>("AsyncBox");
asyncBox.AsyncPopulator = PopulateAsync;
}
private IEnumerable<AutoCompleteBox> GetAllAutoCompleteBox()
{
return
this.GetLogicalDescendants()
.OfType<AutoCompleteBox>();
}
private bool StringContains(string str, string query)
{
return str.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0;
}
private async Task<IEnumerable<object>> PopulateAsync(string searchText, CancellationToken cancellationToken)
{
await Task.Delay(TimeSpan.FromSeconds(1.5), cancellationToken);
return
States.Where(data => StringContains(data.Name, searchText) || StringContains(data.Capital, searchText))
.ToList();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
}

2726
src/Avalonia.Controls/AutoCompleteBox.cs

File diff suppressed because it is too large

2
src/Avalonia.Controls/TextBox.cs

@ -791,7 +791,7 @@ namespace Avalonia.Controls
int pos = 0;
int i;
for (i = 0; i < lines.Count; ++i)
for (i = 0; i < lines.Count - 1; ++i)
{
var line = lines[i];
pos += line.Length;

64
src/Avalonia.Controls/Utils/ISelectionAdapter.cs

@ -0,0 +1,64 @@
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
using System;
using System.Collections;
using Avalonia.Interactivity;
using Avalonia.Input;
namespace Avalonia.Controls.Utils
{
/// <summary>
/// Defines an item collection, selection members, and key handling for the
/// selection adapter contained in the drop-down portion of an
/// <see cref="T:Avalonia.Controls.AutoCompleteBox" /> control.
/// </summary>
public interface ISelectionAdapter
{
/// <summary>
/// Gets or sets the selected item.
/// </summary>
/// <value>The currently selected item.</value>
object SelectedItem { get; set; }
/// <summary>
/// Occurs when the
/// <see cref="P:Avalonia.Controls.Utils.ISelectionAdapter.SelectedItem" />
/// property value changes.
/// </summary>
event EventHandler<SelectionChangedEventArgs> SelectionChanged;
/// <summary>
/// Gets or sets a collection that is used to generate content for the
/// selection adapter.
/// </summary>
/// <value>The collection that is used to generate content for the
/// selection adapter.</value>
IEnumerable Items { get; set; }
/// <summary>
/// Occurs when a selected item is not cancelled and is committed as the
/// selected item.
/// </summary>
event EventHandler<RoutedEventArgs> Commit;
/// <summary>
/// Occurs when a selection has been canceled.
/// </summary>
event EventHandler<RoutedEventArgs> Cancel;
/// <summary>
/// Provides handling for the
/// <see cref="E:Avalonia.Input.InputElement.KeyDown" /> event that occurs
/// when a key is pressed while the drop-down portion of the
/// <see cref="T:Avalonia.Controls.AutoCompleteBox" /> has focus.
/// </summary>
/// <param name="e">A <see cref="T:Avalonia.Input.KeyEventArgs" />
/// that contains data about the
/// <see cref="E:Avalonia.Input.InputElement.KeyDown" /> event.</param>
void HandleKeyDown(KeyEventArgs e);
}
}

342
src/Avalonia.Controls/Utils/SelectingItemsControlSelectionAdapter.cs

@ -0,0 +1,342 @@
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using Avalonia.Controls.Primitives;
using Avalonia.Interactivity;
using Avalonia.Input;
using Avalonia.LogicalTree;
using System.Collections;
using System.Diagnostics;
namespace Avalonia.Controls.Utils
{
/// <summary>
/// Represents the selection adapter contained in the drop-down portion of
/// an <see cref="T:Avalonia.Controls.AutoCompleteBox" /> control.
/// </summary>
public class SelectingItemsControlSelectionAdapter : ISelectionAdapter
{
/// <summary>
/// The SelectingItemsControl instance.
/// </summary>
private SelectingItemsControl _selector;
/// <summary>
/// Gets or sets a value indicating whether the selection change event
/// should not be fired.
/// </summary>
private bool IgnoringSelectionChanged { get; set; }
/// <summary>
/// Gets or sets the underlying
/// <see cref="T:Avalonia.Controls.Primitives.SelectingItemsControl" />
/// control.
/// </summary>
/// <value>The underlying
/// <see cref="T:Avalonia.Controls.Primitives.SelectingItemsControl" />
/// control.</value>
public SelectingItemsControl SelectorControl
{
get { return _selector; }
set
{
if (_selector != null)
{
_selector.SelectionChanged -= OnSelectionChanged;
_selector.PointerReleased -= OnSelectorPointerReleased;
}
_selector = value;
if (_selector != null)
{
_selector.SelectionChanged += OnSelectionChanged;
_selector.PointerReleased += OnSelectorPointerReleased;
}
}
}
/// <summary>
/// Occurs when the
/// <see cref="P:Avalonia.Controls.Utils.SelectingItemsControlSelectionAdapter.SelectedItem" />
/// property value changes.
/// </summary>
public event EventHandler<SelectionChangedEventArgs> SelectionChanged;
/// <summary>
/// Occurs when an item is selected and is committed to the underlying
/// <see cref="T:Avalonia.Controls.Primitives.SelectingItemsControl" />
/// control.
/// </summary>
public event EventHandler<RoutedEventArgs> Commit;
/// <summary>
/// Occurs when a selection is canceled before it is committed.
/// </summary>
public event EventHandler<RoutedEventArgs> Cancel;
/// <summary>
/// Initializes a new instance of the
/// <see cref="T:Avalonia.Controls.Utils.SelectingItemsControlSelectionAdapter" />
/// class.
/// </summary>
public SelectingItemsControlSelectionAdapter()
{
}
/// <summary>
/// Initializes a new instance of the
/// <see cref="T:Avalonia.Controls.Utils.SelectingItemsControlSelectionAdapterr" />
/// class with the specified
/// <see cref="T:Avalonia.Controls.Primitives.SelectingItemsControl" />
/// control.
/// </summary>
/// <param name="selector">The
/// <see cref="T:Avalonia.Controls.Primitives.SelectingItemsControl" /> control
/// to wrap as a
/// <see cref="T:Avalonia.Controls.Utils.SelectingItemsControlSelectionAdapter" />.</param>
public SelectingItemsControlSelectionAdapter(SelectingItemsControl selector)
{
SelectorControl = selector;
}
/// <summary>
/// Gets or sets the selected item of the selection adapter.
/// </summary>
/// <value>The selected item of the underlying selection adapter.</value>
public object SelectedItem
{
get
{
return SelectorControl?.SelectedItem;
}
set
{
IgnoringSelectionChanged = true;
if (SelectorControl != null)
{
SelectorControl.SelectedItem = value;
}
// Attempt to reset the scroll viewer's position
if (value == null)
{
ResetScrollViewer();
}
IgnoringSelectionChanged = false;
}
}
/// <summary>
/// Gets or sets a collection that is used to generate the content of
/// the selection adapter.
/// </summary>
/// <value>The collection used to generate content for the selection
/// adapter.</value>
public IEnumerable Items
{
get
{
return SelectorControl?.Items;
}
set
{
if (SelectorControl != null)
{
SelectorControl.Items = value;
}
}
}
/// <summary>
/// If the control contains a ScrollViewer, this will reset the viewer
/// to be scrolled to the top.
/// </summary>
private void ResetScrollViewer()
{
if (SelectorControl != null)
{
ScrollViewer sv = SelectorControl.GetLogicalDescendants().OfType<ScrollViewer>().FirstOrDefault();
if (sv != null)
{
sv.Offset = new Vector(0, 0);
}
}
}
/// <summary>
/// Handles the mouse left button up event on the selector control.
/// </summary>
/// <param name="sender">The source object.</param>
/// <param name="e">The event data.</param>
private void OnSelectorPointerReleased(object sender, PointerReleasedEventArgs e)
{
if (e.MouseButton == MouseButton.Left)
{
OnCommit();
}
}
/// <summary>
/// Handles the SelectionChanged event on the SelectingItemsControl control.
/// </summary>
/// <param name="sender">The source object.</param>
/// <param name="e">The selection changed event data.</param>
private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (IgnoringSelectionChanged)
{
return;
}
SelectionChanged?.Invoke(sender, e);
}
/// <summary>
/// Increments the
/// <see cref="P:Avalonia.Controls.Primitives.SelectingItemsControl.SelectedIndex" />
/// property of the underlying
/// <see cref="T:Avalonia.Controls.Primitives.SelectingItemsControl" />
/// control.
/// </summary>
protected void SelectedIndexIncrement()
{
if (SelectorControl != null)
{
SelectorControl.SelectedIndex = SelectorControl.SelectedIndex + 1 >= SelectorControl.ItemCount ? -1 : SelectorControl.SelectedIndex + 1;
}
}
/// <summary>
/// Decrements the
/// <see cref="P:Avalonia.Controls.Primitives.SelectingItemsControl.SelectedIndex" />
/// property of the underlying
/// <see cref="T:Avalonia.Controls.Primitives.SelectingItemsControl" />
/// control.
/// </summary>
protected void SelectedIndexDecrement()
{
if (SelectorControl != null)
{
int index = SelectorControl.SelectedIndex;
if (index >= 0)
{
SelectorControl.SelectedIndex--;
}
else if (index == -1)
{
SelectorControl.SelectedIndex = SelectorControl.ItemCount - 1;
}
}
}
/// <summary>
/// Provides handling for the
/// <see cref="E:Avalonia.Input.InputElement.KeyDown" /> event that occurs
/// when a key is pressed while the drop-down portion of the
/// <see cref="T:Avalonia.Controls.AutoCompleteBox" /> has focus.
/// </summary>
/// <param name="e">A <see cref="T:Avalonia.Input.KeyEventArgs" />
/// that contains data about the
/// <see cref="E:Avalonia.Input.InputElement.KeyDown" /> event.</param>
public void HandleKeyDown(KeyEventArgs e)
{
switch (e.Key)
{
case Key.Enter:
OnCommit();
e.Handled = true;
break;
case Key.Up:
SelectedIndexDecrement();
e.Handled = true;
break;
case Key.Down:
if ((e.Modifiers & InputModifiers.Alt) == InputModifiers.None)
{
SelectedIndexIncrement();
e.Handled = true;
}
break;
case Key.Escape:
OnCancel();
e.Handled = true;
break;
default:
break;
}
}
/// <summary>
/// Raises the
/// <see cref="E:Avalonia.Controls.Utils.SelectingItemsControlSelectionAdapter.Commit" />
/// event.
/// </summary>
protected virtual void OnCommit()
{
OnCommit(this, new RoutedEventArgs());
}
/// <summary>
/// Fires the Commit event.
/// </summary>
/// <param name="sender">The source object.</param>
/// <param name="e">The event data.</param>
private void OnCommit(object sender, RoutedEventArgs e)
{
Commit?.Invoke(sender, e);
AfterAdapterAction();
}
/// <summary>
/// Raises the
/// <see cref="E:Avalonia.Controls.Utils.SelectingItemsControlSelectionAdapter.Cancel" />
/// event.
/// </summary>
protected virtual void OnCancel()
{
OnCancel(this, new RoutedEventArgs());
}
/// <summary>
/// Fires the Cancel event.
/// </summary>
/// <param name="sender">The source object.</param>
/// <param name="e">The event data.</param>
private void OnCancel(object sender, RoutedEventArgs e)
{
Cancel?.Invoke(sender, e);
AfterAdapterAction();
}
/// <summary>
/// Change the selection after the actions are complete.
/// </summary>
private void AfterAdapterAction()
{
IgnoringSelectionChanged = true;
if (SelectorControl != null)
{
SelectorControl.SelectedItem = null;
SelectorControl.SelectedIndex = -1;
}
IgnoringSelectionChanged = false;
}
}
}

2
src/Avalonia.Input/KeyboardDevice.cs

@ -46,13 +46,13 @@ namespace Avalonia.Input
if (element != FocusedElement)
{
var interactive = FocusedElement as IInteractive;
FocusedElement = element;
interactive?.RaiseEvent(new RoutedEventArgs
{
RoutedEvent = InputElement.LostFocusEvent,
});
FocusedElement = element;
interactive = element as IInteractive;
interactive?.RaiseEvent(new GotFocusEventArgs

43
src/Avalonia.Themes.Default/AutoCompleteBox.xaml

@ -0,0 +1,43 @@
<Styles xmlns="https://github.com/avaloniaui">
<Style Selector="AutoCompleteBox">
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/>
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/>
<Setter Property="Padding" Value="4"/>
<Setter Property="Template">
<ControlTemplate>
<Panel>
<TextBox Name="PART_TextBox"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
Watermark="{TemplateBinding Watermark}"
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" />
<Popup Name="PART_Popup"
MinWidth="{TemplateBinding Bounds.Width}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
PlacementTarget="{TemplateBinding}"
StaysOpen="False">
<Border BorderBrush="{DynamicResource ThemeBorderMidBrush}"
BorderThickness="1">
<ListBox Name="PART_SelectingItemsControl"
BorderThickness="0"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
ItemTemplate="{TemplateBinding ItemTemplate}"
MemberSelector="{TemplateBinding ValueMemberSelector}"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto" />
</Border>
</Popup>
</Panel>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="AutoCompleteBox ListBoxItem:pointerover">
<Setter Property="Background" Value="#ffd0d0d0"/>
</Style>
</Styles>

3
src/Avalonia.Themes.Default/DefaultTheme.xaml

@ -23,7 +23,7 @@
<StyleInclude Source="resm:Avalonia.Themes.Default.RadioButton.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.RepeatButton.xaml?assembly=Avalonia.Themes.Default" />
<StyleInclude Source="resm:Avalonia.Themes.Default.Separator.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.Slider.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.Slider.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ScrollBar.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ScrollViewer.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.TabStrip.xaml?assembly=Avalonia.Themes.Default"/>
@ -44,4 +44,5 @@
<StyleInclude Source="resm:Avalonia.Themes.Default.DatePicker.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ButtonSpinner.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.NumericUpDown.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.AutoCompleteBox.xaml?assembly=Avalonia.Themes.Default"/>
</Styles>

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

@ -22,7 +22,7 @@ namespace Avalonia.Media
/// Defines the <see cref="GradientStops"/> property.
/// </summary>
public static readonly StyledProperty<IList<GradientStop>> GradientStopsProperty =
AvaloniaProperty.Register<GradientBrush, IList<GradientStop>>(nameof(Opacity));
AvaloniaProperty.Register<GradientBrush, IList<GradientStop>>(nameof(GradientStops));
/// <summary>
/// Initializes a new instance of the <see cref="GradientBrush"/> class.

1042
tests/Avalonia.Controls.UnitTests/AutoCompleteBoxTests.cs

File diff suppressed because it is too large
Loading…
Cancel
Save