diff --git a/samples/ControlCatalog/App.xaml b/samples/ControlCatalog/App.xaml
index fab4622303..b228e72f72 100644
--- a/samples/ControlCatalog/App.xaml
+++ b/samples/ControlCatalog/App.xaml
@@ -5,6 +5,13 @@
x:CompileBindings="True"
Name="Avalonia ControlCatalog"
x:Class="ControlCatalog.App">
+
+
+
+
+
+
+
-
diff --git a/samples/ControlCatalog/Pages/ExpanderPage.xaml b/samples/ControlCatalog/Pages/ExpanderPage.xaml
index cef473af04..f9ae1c7a3c 100644
--- a/samples/ControlCatalog/Pages/ExpanderPage.xaml
+++ b/samples/ControlCatalog/Pages/ExpanderPage.xaml
@@ -8,26 +8,31 @@
Margin="0,16,0,0"
HorizontalAlignment="Center"
Spacing="16">
-
+
Expanded content
-
+
Expanded content
-
+
Expanded content
-
+
Expanded content
-
+ Rounded
+
diff --git a/samples/ControlCatalog/Pages/ExpanderPage.xaml.cs b/samples/ControlCatalog/Pages/ExpanderPage.xaml.cs
index 52166d1a5f..e8a080899a 100644
--- a/samples/ControlCatalog/Pages/ExpanderPage.xaml.cs
+++ b/samples/ControlCatalog/Pages/ExpanderPage.xaml.cs
@@ -1,5 +1,6 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
+using ControlCatalog.ViewModels;
namespace ControlCatalog.Pages
{
@@ -8,6 +9,7 @@ namespace ControlCatalog.Pages
public ExpanderPage()
{
this.InitializeComponent();
+ DataContext = new ExpanderPageViewModel();
}
private void InitializeComponent()
diff --git a/samples/ControlCatalog/ViewModels/ExpanderPageViewModel.cs b/samples/ControlCatalog/ViewModels/ExpanderPageViewModel.cs
new file mode 100644
index 0000000000..aa7f710ee0
--- /dev/null
+++ b/samples/ControlCatalog/ViewModels/ExpanderPageViewModel.cs
@@ -0,0 +1,27 @@
+using Avalonia;
+using MiniMvvm;
+
+namespace ControlCatalog.ViewModels
+{
+ public class ExpanderPageViewModel : ViewModelBase
+ {
+ private object _cornerRadius = AvaloniaProperty.UnsetValue;
+ private bool _rounded;
+
+ public object CornerRadius
+ {
+ get => _cornerRadius;
+ private set => RaiseAndSetIfChanged(ref _cornerRadius, value);
+ }
+
+ public bool Rounded
+ {
+ get => _rounded;
+ set
+ {
+ if (RaiseAndSetIfChanged(ref _rounded, value))
+ CornerRadius = _rounded ? new CornerRadius(25) : AvaloniaProperty.UnsetValue;
+ }
+ }
+ }
+}
diff --git a/samples/SampleControls/HamburgerMenu/HamburgerMenu.xaml b/samples/SampleControls/HamburgerMenu/HamburgerMenu.xaml
index 1d58c465a0..fbc51414e3 100644
--- a/samples/SampleControls/HamburgerMenu/HamburgerMenu.xaml
+++ b/samples/SampleControls/HamburgerMenu/HamburgerMenu.xaml
@@ -1,6 +1,6 @@
-
+
@@ -20,25 +20,136 @@
-
- 40
- 220
- 36
- 36
- 32
- 12,0,0,0
- 52,0,0,0
- 212,0,0,0
- 1 1 1 1 #2000, 0 0 1 1 #2fff
- 0 0 1 1 #2000
-
+ 40
+ 220
+ 36
+ 36
+ 32
+ 12,0,0,0
+ 52,0,0,0
+ 212,0,0,0
+ 1 1 1 1 #2000, 0 0 1 1 #2fff
+ 0 0 1 1 #2000
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/Avalonia.Base/Input/Cursor.cs b/src/Avalonia.Base/Input/Cursor.cs
index 122838f682..98c4258a90 100644
--- a/src/Avalonia.Base/Input/Cursor.cs
+++ b/src/Avalonia.Base/Input/Cursor.cs
@@ -32,10 +32,7 @@ namespace Avalonia.Input
DragCopy,
DragLink,
None,
-
- [Obsolete("Use BottomSide")]
- BottomSize = BottomSide
-
+
// Not available in GTK directly, see http://www.pixelbeat.org/programming/x_cursors/
// We might enable them later, preferably, by loading pixmax directly from theme with fallback image
// SizeNorthWestSouthEast,
diff --git a/src/Avalonia.Base/Input/DragEventArgs.cs b/src/Avalonia.Base/Input/DragEventArgs.cs
index 22ca8358ff..0e613c0f21 100644
--- a/src/Avalonia.Base/Input/DragEventArgs.cs
+++ b/src/Avalonia.Base/Input/DragEventArgs.cs
@@ -13,9 +13,6 @@ namespace Avalonia.Input
public IDataObject Data { get; private set; }
- [Obsolete("Use KeyModifiers")]
- public InputModifiers Modifiers { get; private set; }
-
public KeyModifiers KeyModifiers { get; private set; }
public Point GetPosition(IVisual relativeTo)
@@ -35,17 +32,6 @@ namespace Avalonia.Input
return point;
}
- [Obsolete("Use constructor taking KeyModifiers")]
- public DragEventArgs(RoutedEvent routedEvent, IDataObject data, Interactive target, Point targetLocation, InputModifiers modifiers)
- : base(routedEvent)
- {
- Data = data;
- _target = target;
- _targetLocation = targetLocation;
- Modifiers = modifiers;
- KeyModifiers = (KeyModifiers)(((int)modifiers) & 0xF);
- }
-
public DragEventArgs(RoutedEvent routedEvent, IDataObject data, Interactive target, Point targetLocation, KeyModifiers keyModifiers)
: base(routedEvent)
{
@@ -53,10 +39,6 @@ namespace Avalonia.Input
_target = target;
_targetLocation = targetLocation;
KeyModifiers = keyModifiers;
-#pragma warning disable CS0618 // Type or member is obsolete
- Modifiers = (InputModifiers)keyModifiers;
-#pragma warning restore CS0618 // Type or member is obsolete
}
-
}
}
diff --git a/src/Avalonia.Base/Input/GotFocusEventArgs.cs b/src/Avalonia.Base/Input/GotFocusEventArgs.cs
index 9d958823fe..5cce138ee0 100644
--- a/src/Avalonia.Base/Input/GotFocusEventArgs.cs
+++ b/src/Avalonia.Base/Input/GotFocusEventArgs.cs
@@ -1,4 +1,3 @@
-using System;
using Avalonia.Interactivity;
namespace Avalonia.Input
@@ -13,16 +12,6 @@ namespace Avalonia.Input
///
public NavigationMethod NavigationMethod { get; set; }
- ///
- /// Gets or sets any input modifiers active at the time of focus.
- ///
- [Obsolete("Use KeyModifiers")]
- public InputModifiers InputModifiers
- {
- get => (InputModifiers)KeyModifiers;
- set => KeyModifiers = (KeyModifiers)((int)value & 0xF);
- }
-
///
/// Gets or sets any key modifiers active at the time of focus.
///
diff --git a/src/Avalonia.Base/Input/IInputRoot.cs b/src/Avalonia.Base/Input/IInputRoot.cs
index 7edc69df52..344a4eefd7 100644
--- a/src/Avalonia.Base/Input/IInputRoot.cs
+++ b/src/Avalonia.Base/Input/IInputRoot.cs
@@ -27,10 +27,5 @@ namespace Avalonia.Input
/// Gets or sets a value indicating whether access keys are shown in the window.
///
bool ShowAccessKeys { get; set; }
-
- ///
- /// Gets associated mouse device
- ///
- IMouseDevice? MouseDevice { get; }
}
}
diff --git a/src/Avalonia.Base/Input/IKeyboardDevice.cs b/src/Avalonia.Base/Input/IKeyboardDevice.cs
index 80aebc02bc..0b7b5aaecc 100644
--- a/src/Avalonia.Base/Input/IKeyboardDevice.cs
+++ b/src/Avalonia.Base/Input/IKeyboardDevice.cs
@@ -4,19 +4,6 @@ using Avalonia.Metadata;
namespace Avalonia.Input
{
- [Flags, Obsolete("Use KeyModifiers and PointerPointProperties")]
- public enum InputModifiers
- {
- None = 0,
- Alt = 1,
- Control = 2,
- Shift = 4,
- Windows = 8,
- LeftMouseButton = 16,
- RightMouseButton = 32,
- MiddleMouseButton = 64
- }
-
[Flags]
public enum KeyModifiers
{
diff --git a/src/Avalonia.Base/Input/IMouseDevice.cs b/src/Avalonia.Base/Input/IMouseDevice.cs
index 2d66397d63..00c436bf21 100644
--- a/src/Avalonia.Base/Input/IMouseDevice.cs
+++ b/src/Avalonia.Base/Input/IMouseDevice.cs
@@ -1,4 +1,3 @@
-using System;
using Avalonia.Metadata;
namespace Avalonia.Input
@@ -9,16 +8,5 @@ namespace Avalonia.Input
[NotClientImplementable]
public interface IMouseDevice : IPointerDevice
{
- ///
- /// Gets the mouse position, in screen coordinates.
- ///
- [Obsolete("Use PointerEventArgs.GetPosition")]
- PixelPoint Position { get; }
-
- [Obsolete]
- void TopLevelClosed(IInputRoot root);
-
- [Obsolete]
- void SceneInvalidated(IInputRoot root, Rect rect);
}
}
diff --git a/src/Avalonia.Base/Input/IPointerDevice.cs b/src/Avalonia.Base/Input/IPointerDevice.cs
index 0993835feb..e0aebda9c5 100644
--- a/src/Avalonia.Base/Input/IPointerDevice.cs
+++ b/src/Avalonia.Base/Input/IPointerDevice.cs
@@ -1,5 +1,3 @@
-using System;
-using Avalonia.VisualTree;
using Avalonia.Input.Raw;
using Avalonia.Metadata;
@@ -8,18 +6,6 @@ namespace Avalonia.Input
[NotClientImplementable]
public interface IPointerDevice : IInputDevice
{
- ///
- [Obsolete("Use IPointer")]
- IInputElement? Captured { get; }
-
- ///
- [Obsolete("Use IPointer")]
- void Capture(IInputElement? control);
-
- ///
- [Obsolete("Use PointerEventArgs.GetPosition")]
- Point GetPosition(IVisual relativeTo);
-
///
/// Gets a pointer for specific event args.
///
diff --git a/src/Avalonia.Base/Input/KeyEventArgs.cs b/src/Avalonia.Base/Input/KeyEventArgs.cs
index 67cd5a520a..b8291e9096 100644
--- a/src/Avalonia.Base/Input/KeyEventArgs.cs
+++ b/src/Avalonia.Base/Input/KeyEventArgs.cs
@@ -9,8 +9,6 @@ namespace Avalonia.Input
public Key Key { get; set; }
- [Obsolete("Use KeyModifiers")]
- public InputModifiers Modifiers => (InputModifiers)KeyModifiers;
public KeyModifiers KeyModifiers { get; set; }
}
}
diff --git a/src/Avalonia.Base/Input/KeyGesture.cs b/src/Avalonia.Base/Input/KeyGesture.cs
index 3b7a828b86..e79e9341a9 100644
--- a/src/Avalonia.Base/Input/KeyGesture.cs
+++ b/src/Avalonia.Base/Input/KeyGesture.cs
@@ -15,13 +15,6 @@ namespace Avalonia.Input
{ "+", Key.OemPlus }, { "-", Key.OemMinus }, { ".", Key.OemPeriod }, { ",", Key.OemComma }
};
- [Obsolete("Use constructor taking KeyModifiers")]
- public KeyGesture(Key key, InputModifiers modifiers)
- {
- Key = key;
- KeyModifiers = (KeyModifiers)(((int)modifiers) & 0xf);
- }
-
public KeyGesture(Key key, KeyModifiers modifiers = KeyModifiers.None)
{
Key = key;
@@ -63,10 +56,7 @@ namespace Avalonia.Input
}
public Key Key { get; }
-
- [Obsolete("Use KeyModifiers")]
- public InputModifiers Modifiers => (InputModifiers)KeyModifiers;
-
+
public KeyModifiers KeyModifiers { get; }
public static KeyGesture Parse(string gesture)
diff --git a/src/Avalonia.Base/Input/MouseDevice.cs b/src/Avalonia.Base/Input/MouseDevice.cs
index 5f8ab24b79..055c9cf1fd 100644
--- a/src/Avalonia.Base/Input/MouseDevice.cs
+++ b/src/Avalonia.Base/Input/MouseDevice.cs
@@ -21,7 +21,6 @@ namespace Avalonia.Input
private readonly Pointer _pointer;
private bool _disposed;
- private PixelPoint? _position;
private MouseButton _lastMouseDownButton;
public MouseDevice(Pointer? pointer = null)
@@ -29,43 +28,6 @@ namespace Avalonia.Input
_pointer = pointer ?? new Pointer(Pointer.GetNextFreeId(), PointerType.Mouse, true);
}
- [Obsolete("Use IPointer instead")]
- public IInputElement? Captured => _pointer.Captured;
-
- [Obsolete("Use events instead")]
- public PixelPoint Position
- {
- get => _position ?? new PixelPoint(-1, -1);
- protected set => _position = value;
- }
-
- [Obsolete("Use IPointer instead")]
- public void Capture(IInputElement? control)
- {
- _pointer.Capture(control);
- }
-
- ///
- /// Gets the mouse position relative to a control.
- ///
- /// The control.
- /// The mouse position in the control's coordinates.
- public Point GetPosition(IVisual relativeTo)
- {
- relativeTo = relativeTo ?? throw new ArgumentNullException(nameof(relativeTo));
-
- if (relativeTo.VisualRoot == null)
- {
- throw new InvalidOperationException("Control is not attached to visual tree.");
- }
-
-#pragma warning disable CS0618 // Type or member is obsolete
- var rootPoint = relativeTo.VisualRoot.PointToClient(Position);
-#pragma warning restore CS0618 // Type or member is obsolete
- var transform = relativeTo.VisualRoot.TransformToVisual(relativeTo);
- return rootPoint * transform!.Value;
- }
-
public void ProcessRawEvent(RawInputEventArgs e)
{
if (!e.Handled && e is RawPointerEventArgs margs)
@@ -96,7 +58,6 @@ namespace Avalonia.Input
if(mouse._disposed)
return;
- _position = e.Root.PointToScreen(e.Position);
var props = CreateProperties(e);
var keyModifiers = e.InputModifiers.ToKeyModifiers();
switch (e.Type)
@@ -145,7 +106,6 @@ namespace Avalonia.Input
private void LeaveWindow()
{
- _position = null;
}
PointerPointProperties CreateProperties(RawPointerEventArgs args)
@@ -324,19 +284,7 @@ namespace Avalonia.Input
_disposed = true;
_pointer?.Dispose();
}
-
- [Obsolete]
- public void TopLevelClosed(IInputRoot root)
- {
- // no-op
- }
-
- [Obsolete]
- public void SceneInvalidated(IInputRoot root, Rect rect)
- {
- // no-op
- }
-
+
public IPointer? TryGetPointer(RawPointerEventArgs ev)
{
return _pointer;
diff --git a/src/Avalonia.Base/Input/PenDevice.cs b/src/Avalonia.Base/Input/PenDevice.cs
index d22b48562c..f5f0e90a45 100644
--- a/src/Avalonia.Base/Input/PenDevice.cs
+++ b/src/Avalonia.Base/Input/PenDevice.cs
@@ -1,10 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Reactive.Linq;
using Avalonia.Input.Raw;
using Avalonia.Platform;
-using Avalonia.VisualTree;
namespace Avalonia.Input
{
@@ -14,7 +12,6 @@ namespace Avalonia.Input
public class PenDevice : IPenDevice, IDisposable
{
private readonly Dictionary _pointers = new();
- private readonly Dictionary _lastPositions = new();
private int _clickCount;
private Rect _lastClickRect;
private ulong _lastClickTime;
@@ -41,9 +38,7 @@ namespace Avalonia.Input
_pointers[e.RawPointerId] = pointer = new Pointer(Pointer.GetNextFreeId(),
PointerType.Pen, _pointers.Count == 0);
}
-
- _lastPositions[e.RawPointerId] = e.Root.PointToScreen(e.Position);
-
+
var props = new PointerPointProperties(e.InputModifiers, e.Type.ToUpdateKind(),
e.Point.Twist, e.Point.Pressure, e.Point.XTilt, e.Point.YTilt);
var keyModifiers = e.InputModifiers.ToKeyModifiers();
@@ -69,7 +64,6 @@ namespace Avalonia.Input
{
pointer.Dispose();
_pointers.Remove(e.RawPointerId);
- _lastPositions.Remove(e.RawPointerId);
}
}
@@ -153,17 +147,6 @@ namespace Avalonia.Input
p.Dispose();
}
- [Obsolete]
- IInputElement? IPointerDevice.Captured => _pointers.Values
- .FirstOrDefault(p => p.IsPrimary)?.Captured;
-
- [Obsolete]
- void IPointerDevice.Capture(IInputElement? control) => _pointers.Values
- .FirstOrDefault(p => p.IsPrimary)?.Capture(control);
-
- [Obsolete]
- Point IPointerDevice.GetPosition(IVisual relativeTo) => new Point(-1, -1);
-
public IPointer? TryGetPointer(RawPointerEventArgs ev)
{
return _pointers.TryGetValue(ev.RawPointerId, out var pointer)
diff --git a/src/Avalonia.Base/Input/PointerEventArgs.cs b/src/Avalonia.Base/Input/PointerEventArgs.cs
index 058c2f9cc1..1f3c726e7b 100644
--- a/src/Avalonia.Base/Input/PointerEventArgs.cs
+++ b/src/Avalonia.Base/Input/PointerEventArgs.cs
@@ -11,7 +11,7 @@ namespace Avalonia.Input
private readonly IVisual? _rootVisual;
private readonly Point _rootVisualPosition;
private readonly PointerPointProperties _properties;
- private Lazy?>? _previousPoints;
+ private readonly Lazy?>? _previousPoints;
public PointerEventArgs(RoutedEvent routedEvent,
IInteractive? source,
@@ -43,29 +43,6 @@ namespace Avalonia.Input
{
_previousPoints = previousPoints;
}
-
-
- class EmulatedDevice : IPointerDevice
- {
- private readonly PointerEventArgs _ev;
-
- public EmulatedDevice(PointerEventArgs ev)
- {
- _ev = ev;
- }
-
- public void ProcessRawEvent(RawInputEventArgs ev) => throw new NotSupportedException();
-
- public IInputElement? Captured => _ev.Pointer.Captured;
- public void Capture(IInputElement? control)
- {
- _ev.Pointer.Capture(control);
- }
-
- public Point GetPosition(IVisual relativeTo) => _ev.GetPosition(relativeTo);
-
- public IPointer? TryGetPointer(RawPointerEventArgs ev) => _ev.Pointer;
- }
///
/// Gets specific pointer generated by input device.
@@ -77,28 +54,6 @@ namespace Avalonia.Input
///
public ulong Timestamp { get; }
- private IPointerDevice? _device;
-
- [Obsolete("Use Pointer to get pointer-specific information")]
- public IPointerDevice Device => _device ?? (_device = new EmulatedDevice(this));
-
- [Obsolete("Use KeyModifiers and PointerPointProperties")]
- public InputModifiers InputModifiers
- {
- get
- {
- var mods = (InputModifiers)KeyModifiers;
- if (_properties.IsLeftButtonPressed)
- mods |= InputModifiers.LeftMouseButton;
- if (_properties.IsMiddleButtonPressed)
- mods |= InputModifiers.MiddleMouseButton;
- if (_properties.IsRightButtonPressed)
- mods |= InputModifiers.RightMouseButton;
-
- return mods;
- }
- }
-
///
/// Gets a value that indicates which key modifiers were active at the time that the pointer event was initiated.
///
@@ -120,9 +75,6 @@ namespace Avalonia.Input
/// The pointer position in the control's coordinates.
public Point GetPosition(IVisual? relativeTo) => GetPosition(_rootVisualPosition, relativeTo);
- [Obsolete("Use GetCurrentPoint")]
- public PointerPoint GetPointerPoint(IVisual? relativeTo) => GetCurrentPoint(relativeTo);
-
///
/// Returns the PointerPoint associated with the current event
///
@@ -171,8 +123,6 @@ namespace Avalonia.Input
public class PointerPressedEventArgs : PointerEventArgs
{
- private readonly int _clickCount;
-
public PointerPressedEventArgs(
IInteractive source,
IPointer pointer,
@@ -184,13 +134,10 @@ namespace Avalonia.Input
: base(InputElement.PointerPressedEvent, source, pointer, rootVisual, rootVisualPosition,
timestamp, properties, modifiers)
{
- _clickCount = clickCount;
+ ClickCount = clickCount;
}
- public int ClickCount => _clickCount;
-
- [Obsolete("Use PointerPressedEventArgs.GetCurrentPoint(this).Properties")]
- public MouseButton MouseButton => Properties.PointerUpdateKind.GetMouseButton();
+ public int ClickCount { get; }
}
public class PointerReleasedEventArgs : PointerEventArgs
@@ -210,9 +157,6 @@ namespace Avalonia.Input
/// Gets the mouse button that triggered the corresponding PointerPressed event
///
public MouseButton InitialPressMouseButton { get; }
-
- [Obsolete("Use InitialPressMouseButton")]
- public MouseButton MouseButton => InitialPressMouseButton;
}
public class PointerCaptureLostEventArgs : RoutedEventArgs
diff --git a/src/Avalonia.Base/Input/PointerOverPreProcessor.cs b/src/Avalonia.Base/Input/PointerOverPreProcessor.cs
index 67d1eea7e3..a95d66346a 100644
--- a/src/Avalonia.Base/Input/PointerOverPreProcessor.cs
+++ b/src/Avalonia.Base/Input/PointerOverPreProcessor.cs
@@ -15,6 +15,8 @@ namespace Avalonia.Input
_inputRoot = inputRoot ?? throw new ArgumentNullException(nameof(inputRoot));
}
+ public PixelPoint? LastPosition => _lastPointer?.position;
+
public void OnCompleted()
{
ClearPointerOver();
diff --git a/src/Avalonia.Base/Input/Raw/RawDragEvent.cs b/src/Avalonia.Base/Input/Raw/RawDragEvent.cs
index 652bad7115..c903aad684 100644
--- a/src/Avalonia.Base/Input/Raw/RawDragEvent.cs
+++ b/src/Avalonia.Base/Input/Raw/RawDragEvent.cs
@@ -8,8 +8,6 @@ namespace Avalonia.Input.Raw
public IDataObject Data { get; }
public DragDropEffects Effects { get; set; }
public RawDragEventType Type { get; }
- [Obsolete("Use KeyModifiers")]
- public InputModifiers Modifiers { get; }
public KeyModifiers KeyModifiers { get; }
public RawDragEvent(IDragDropDevice inputDevice, RawDragEventType type,
@@ -21,9 +19,6 @@ namespace Avalonia.Input.Raw
Data = data;
Effects = effects;
KeyModifiers = modifiers.ToKeyModifiers();
-#pragma warning disable CS0618 // Type or member is obsolete
- Modifiers = (InputModifiers)modifiers;
-#pragma warning restore CS0618 // Type or member is obsolete
}
}
}
diff --git a/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs b/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs
index 6706a45f48..3e842e6e3f 100644
--- a/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs
+++ b/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs
@@ -19,8 +19,5 @@ namespace Avalonia.Input.Raw
{
RawPointerId = rawPointerId;
}
-
- [Obsolete("Use RawPointerId")]
- public long TouchPointId { get => RawPointerId; set => RawPointerId = value; }
}
}
diff --git a/src/Avalonia.Base/Input/TouchDevice.cs b/src/Avalonia.Base/Input/TouchDevice.cs
index e914d860fd..1d5b1d6bbf 100644
--- a/src/Avalonia.Base/Input/TouchDevice.cs
+++ b/src/Avalonia.Base/Input/TouchDevice.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using Avalonia.Input.Raw;
using Avalonia.Platform;
-using Avalonia.VisualTree;
namespace Avalonia.Input
{
@@ -20,9 +19,6 @@ namespace Avalonia.Input
private int _clickCount;
private Rect _lastClickRect;
private ulong _lastClickTime;
- private Pointer? _lastPointer;
-
- IInputElement? IPointerDevice.Captured => _lastPointer?.Captured;
RawInputModifiers GetModifiers(RawInputModifiers modifiers, bool isLeftButtonDown)
{
@@ -32,10 +28,6 @@ namespace Avalonia.Input
return rv;
}
- void IPointerDevice.Capture(IInputElement? control) => _lastPointer?.Capture(control);
-
- Point IPointerDevice.GetPosition(IVisual relativeTo) => default;
-
public void ProcessRawEvent(RawInputEventArgs ev)
{
if (ev.Handled || _disposed)
@@ -51,7 +43,6 @@ namespace Avalonia.Input
PointerType.Touch, _pointers.Count == 0);
pointer.Capture(hit);
}
- _lastPointer = pointer;
var target = pointer.Captured ?? args.Root;
var updateKind = args.Type.ToUpdateKind();
@@ -96,7 +87,6 @@ namespace Avalonia.Input
new PointerPointProperties(GetModifiers(args.InputModifiers, false), updateKind),
keyModifier, MouseButton.Left));
}
- _lastPointer = null;
}
if (args.Type == RawPointerEventType.TouchCancel)
@@ -104,7 +94,6 @@ namespace Avalonia.Input
_pointers.Remove(args.RawPointerId);
using (pointer)
pointer.Capture(null);
- _lastPointer = null;
}
if (args.Type == RawPointerEventType.TouchUpdate)
diff --git a/src/Avalonia.Base/StyledElement.cs b/src/Avalonia.Base/StyledElement.cs
index ecf5d95ffc..3a42e9bdfe 100644
--- a/src/Avalonia.Base/StyledElement.cs
+++ b/src/Avalonia.Base/StyledElement.cs
@@ -873,9 +873,12 @@ namespace Avalonia
if (applied.Source == styles[i])
{
- applied.Dispose();
_appliedStyles.RemoveAt(j);
+ applied.Dispose();
}
+
+ if (j > _appliedStyles.Count)
+ j = _appliedStyles.Count;
}
}
}
diff --git a/src/Avalonia.Controls/Chrome/CaptionButtons.cs b/src/Avalonia.Controls/Chrome/CaptionButtons.cs
index d5923a8b37..6d7e542bb2 100644
--- a/src/Avalonia.Controls/Chrome/CaptionButtons.cs
+++ b/src/Avalonia.Controls/Chrome/CaptionButtons.cs
@@ -8,10 +8,10 @@ namespace Avalonia.Controls.Chrome
///
/// Draws window minimize / maximize / close buttons in a when managed client decorations are enabled.
///
- [TemplatePart("PART_CloseButton", typeof(Panel))]
- [TemplatePart("PART_RestoreButton", typeof(Panel))]
- [TemplatePart("PART_MinimiseButton", typeof(Panel))]
- [TemplatePart("PART_FullScreenButton", typeof(Panel))]
+ [TemplatePart("PART_CloseButton", typeof(Button))]
+ [TemplatePart("PART_RestoreButton", typeof(Button))]
+ [TemplatePart("PART_MinimiseButton", typeof(Button))]
+ [TemplatePart("PART_FullScreenButton", typeof(Button))]
[PseudoClasses(":minimized", ":normal", ":maximized", ":fullscreen")]
public class CaptionButtons : TemplatedControl
{
@@ -88,18 +88,15 @@ namespace Avalonia.Controls.Chrome
{
base.OnApplyTemplate(e);
- var closeButton = e.NameScope.Get("PART_CloseButton");
- var restoreButton = e.NameScope.Get("PART_RestoreButton");
- var minimiseButton = e.NameScope.Get("PART_MinimiseButton");
- var fullScreenButton = e.NameScope.Get("PART_FullScreenButton");
+ var closeButton = e.NameScope.Get
-
-
-
+
+
+
-
+
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/Carousel.xaml b/src/Avalonia.Themes.Fluent/Controls/Carousel.xaml
index baba0649aa..2cac701e1b 100644
--- a/src/Avalonia.Themes.Fluent/Controls/Carousel.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/Carousel.xaml
@@ -1,17 +1,20 @@
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/CheckBox.xaml b/src/Avalonia.Themes.Fluent/Controls/CheckBox.xaml
index e9830fb228..9abcf5d32b 100644
--- a/src/Avalonia.Themes.Fluent/Controls/CheckBox.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/CheckBox.xaml
@@ -1,297 +1,298 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
-
+
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
+
-
+
+
+
+
+
+
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ComboBox.xaml b/src/Avalonia.Themes.Fluent/Controls/ComboBox.xaml
index 93ecc438eb..af3b5bc51e 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ComboBox.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ComboBox.xaml
@@ -1,5 +1,6 @@
-
+
@@ -14,19 +15,28 @@
Item 1
Item 2
+
+
+
+
+ Error
+
+
+
+
-
- 0,0,0,4
- 15
- 7
- 12,5,0,7
- 11,5,32,6
- 32
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ComboBoxItem.xaml b/src/Avalonia.Themes.Fluent/Controls/ComboBoxItem.xaml
index 0debe87445..581cbaf80a 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ComboBoxItem.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ComboBoxItem.xaml
@@ -1,23 +1,20 @@
-
+
-
+
Item 1
Item 2 long
Item 3
Item 4
+ Item 5
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/Common.xaml b/src/Avalonia.Themes.Fluent/Controls/Common.xaml
deleted file mode 100644
index e09e39d7cb..0000000000
--- a/src/Avalonia.Themes.Fluent/Controls/Common.xaml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
diff --git a/src/Avalonia.Themes.Fluent/Controls/ContentControl.xaml b/src/Avalonia.Themes.Fluent/Controls/ContentControl.xaml
index d32bc399b6..4caf156366 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ContentControl.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ContentControl.xaml
@@ -1,16 +1,19 @@
-
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ContextMenu.xaml b/src/Avalonia.Themes.Fluent/Controls/ContextMenu.xaml
index df800b4a06..8365ee61d3 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ContextMenu.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ContextMenu.xaml
@@ -1,6 +1,5 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml b/src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml
index 649a186c7e..cc55f84d80 100644
--- a/src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml
@@ -1,8 +1,8 @@
-
+
@@ -26,8 +26,8 @@
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml b/src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml
index 11d6b9fdfc..bc47f3892e 100644
--- a/src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml
@@ -5,125 +5,81 @@
// All other rights reserved.
-->
-
-
-
+
+
+
+
+
+
+
+
+
+ Error
+
+
+
+
+
-
-
- 0,0,0,4
- 40
- 40
- 41
- 296
- 456
- 0,3,0,6
- 9,3,0,6
- 0,3,0,6
- 9,3,0,6
- 1
-
-
-
-
-
-
-
-
+ 0,0,0,4
+ 40
+ 40
+ 41
+ 296
+ 456
+ 0,3,0,6
+ 9,3,0,6
+ 0,3,0,6
+ 9,3,0,6
+ 1
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
@@ -138,13 +94,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
+
+
+
-
+
+ PanelType="Month"
+ ItemHeight="{DynamicResource DatePickerFlyoutPresenterItemHeight}"
+ ShouldLoop="True" />
-
-
+
+
+ PanelType="Day"
+ ItemHeight="{DynamicResource DatePickerFlyoutPresenterItemHeight}"
+ ShouldLoop="True" />
-
-
+
+
+ PanelType="Year"
+ ItemHeight="{DynamicResource DatePickerFlyoutPresenterItemHeight}"
+ ShouldLoop="False" />
-
-
+
+
-
-
+
-
-
+
+
-
-
+
+
-
-
+
+
+
-
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/DateTimePickerShared.xaml b/src/Avalonia.Themes.Fluent/Controls/DateTimePickerShared.xaml
new file mode 100644
index 0000000000..be664b375d
--- /dev/null
+++ b/src/Avalonia.Themes.Fluent/Controls/DateTimePickerShared.xaml
@@ -0,0 +1,118 @@
+
+
+
+
+
+
+ Standard Item
+ Month Item
+ Button
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/DropDownButton.xaml b/src/Avalonia.Themes.Fluent/Controls/DropDownButton.xaml
index b96c689ab6..96fd575f4f 100644
--- a/src/Avalonia.Themes.Fluent/Controls/DropDownButton.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/DropDownButton.xaml
@@ -1,103 +1,97 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 32
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+ 32
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
+
-
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/EmbeddableControlRoot.xaml b/src/Avalonia.Themes.Fluent/Controls/EmbeddableControlRoot.xaml
index 79560be933..f8b4854553 100644
--- a/src/Avalonia.Themes.Fluent/Controls/EmbeddableControlRoot.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/EmbeddableControlRoot.xaml
@@ -1,19 +1,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/Expander.xaml b/src/Avalonia.Themes.Fluent/Controls/Expander.xaml
index 33d502772e..7d5bb48333 100644
--- a/src/Avalonia.Themes.Fluent/Controls/Expander.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/Expander.xaml
@@ -1,31 +1,41 @@
-
+
-
-
-
-
-
-
-
-
+
+
+
+ Expanded content
+
+
+
+
+ Expanded content
+
+
+
Expanded content
-
+
Expanded content
-
+
+
+
+
+
+
+
Expanded content
-
+
Expanded content
@@ -34,72 +44,28 @@
-
- 16
- 16
-
- 1
-
- 1,1,0,1
- 1,1,1,0
- 0,1,1,1
- 1,0,1,1
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 16
+ 16
+ 1
+ 1,1,0,1
+ 1,1,1,0
+ 0,1,1,1
+ 1,0,1,1
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml b/src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml
index 5b217e4764..bc2352d5d0 100644
--- a/src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml
@@ -1,70 +1,78 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/FlyoutPresenter.xaml b/src/Avalonia.Themes.Fluent/Controls/FlyoutPresenter.xaml
index 92f8177ead..2dca5b0770 100644
--- a/src/Avalonia.Themes.Fluent/Controls/FlyoutPresenter.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/FlyoutPresenter.xaml
@@ -1,9 +1,7 @@
-
-
- 1
-
-
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/FocusAdorner.xaml b/src/Avalonia.Themes.Fluent/Controls/FocusAdorner.xaml
index 91bf71ed4d..c3f489da80 100644
--- a/src/Avalonia.Themes.Fluent/Controls/FocusAdorner.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/FocusAdorner.xaml
@@ -1,4 +1,4 @@
-
0
diff --git a/src/Avalonia.Themes.Fluent/Controls/GridSplitter.xaml b/src/Avalonia.Themes.Fluent/Controls/GridSplitter.xaml
index e3a7b04f33..ca57eccd13 100644
--- a/src/Avalonia.Themes.Fluent/Controls/GridSplitter.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/GridSplitter.xaml
@@ -1,24 +1,22 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ItemsControl.xaml b/src/Avalonia.Themes.Fluent/Controls/ItemsControl.xaml
index 19d13b6399..fc85b7b9ff 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ItemsControl.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ItemsControl.xaml
@@ -1,16 +1,19 @@
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/Label.xaml b/src/Avalonia.Themes.Fluent/Controls/Label.xaml
index d41e4e2166..ff6909ee87 100644
--- a/src/Avalonia.Themes.Fluent/Controls/Label.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/Label.xaml
@@ -1,18 +1,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ListBox.xaml b/src/Avalonia.Themes.Fluent/Controls/ListBox.xaml
index 8011ed9daf..c17dc65cca 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ListBox.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ListBox.xaml
@@ -1,4 +1,5 @@
-
+
@@ -9,15 +10,16 @@
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ListBoxItem.xaml b/src/Avalonia.Themes.Fluent/Controls/ListBoxItem.xaml
index 11f3c12772..fc1d0c5ff1 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ListBoxItem.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ListBoxItem.xaml
@@ -1,5 +1,5 @@
-
+
@@ -12,10 +12,8 @@
-
- 12,9,12,12
-
-
-
+
-
-
+
+
-
-
-
+
+
-
-
-
+
+
-
+
-
-
-
+
+
-
-
-
+
+
-
-
-
-
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml b/src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml
index 60e16fcff2..55f4893057 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml
@@ -1,324 +1,328 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
-
-
+
+
+
-
-
-
-
-
-
-
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/Menu.xaml b/src/Avalonia.Themes.Fluent/Controls/Menu.xaml
index 4eb724a926..12d18ae644 100644
--- a/src/Avalonia.Themes.Fluent/Controls/Menu.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/Menu.xaml
@@ -1,36 +1,113 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/MenuFlyoutPresenter.xaml b/src/Avalonia.Themes.Fluent/Controls/MenuFlyoutPresenter.xaml
index ff50acab5e..264438390d 100644
--- a/src/Avalonia.Themes.Fluent/Controls/MenuFlyoutPresenter.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/MenuFlyoutPresenter.xaml
@@ -1,6 +1,6 @@
-
-
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/MenuItem.xaml b/src/Avalonia.Themes.Fluent/Controls/MenuItem.xaml
index d6fcde1ff8..ed29addbc2 100644
--- a/src/Avalonia.Themes.Fluent/Controls/MenuItem.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/MenuItem.xaml
@@ -1,60 +1,67 @@
-
+
-
-
+
-
-
- -4
- 0,0,12,0
- 24,0,0,0
- M 1,0 10,10 l -9,10 -1,-1 L 8,10 -0,1 Z
-
+
+ -4
+ 0,0,12,0
+ 24,0,0,0
+ M 1,0 10,10 l -9,10 -1,-1 L 8,10 -0,1 Z
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
+
+
+
+
+
-
+
-
+
-
-
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/MenuScrollViewer.xaml b/src/Avalonia.Themes.Fluent/Controls/MenuScrollViewer.xaml
new file mode 100644
index 0000000000..bc71d88a0d
--- /dev/null
+++ b/src/Avalonia.Themes.Fluent/Controls/MenuScrollViewer.xaml
@@ -0,0 +1,98 @@
+
+
+
+
+
+ Item 1
+ Item 2
+ Item 3
+ Item 4
+ Item 5
+ Item 6
+ Item 7
+ Item 8
+ Item 9
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml b/src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml
index bcdec6f61a..d3eaeafd01 100644
--- a/src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml
@@ -1,31 +1,30 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/NotificationCard.xaml b/src/Avalonia.Themes.Fluent/Controls/NotificationCard.xaml
index 924d977eb5..51dcdd42e3 100644
--- a/src/Avalonia.Themes.Fluent/Controls/NotificationCard.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/NotificationCard.xaml
@@ -1,15 +1,15 @@
-
+
-
+
-
+
-
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml b/src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml
index 36ab07e3e3..872367c6da 100644
--- a/src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml
@@ -1,17 +1,15 @@
-
+
-
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/OverlayPopupHost.xaml b/src/Avalonia.Themes.Fluent/Controls/OverlayPopupHost.xaml
index 31b43c39cd..28d8fb508c 100644
--- a/src/Avalonia.Themes.Fluent/Controls/OverlayPopupHost.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/OverlayPopupHost.xaml
@@ -1,20 +1,23 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/PathIcon.xaml b/src/Avalonia.Themes.Fluent/Controls/PathIcon.xaml
index d4952b3571..5584eb3ab9 100644
--- a/src/Avalonia.Themes.Fluent/Controls/PathIcon.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/PathIcon.xaml
@@ -1,5 +1,5 @@
-
+
@@ -8,22 +8,18 @@
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/PopupRoot.xaml b/src/Avalonia.Themes.Fluent/Controls/PopupRoot.xaml
index f608cf55f5..5a924830b1 100644
--- a/src/Avalonia.Themes.Fluent/Controls/PopupRoot.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/PopupRoot.xaml
@@ -1,10 +1,10 @@
-
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ProgressBar.xaml b/src/Avalonia.Themes.Fluent/Controls/ProgressBar.xaml
index 5c0edf19c2..dc591ede12 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ProgressBar.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ProgressBar.xaml
@@ -1,22 +1,31 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/RadioButton.xaml b/src/Avalonia.Themes.Fluent/Controls/RadioButton.xaml
index e967dc8807..a1c4ba4f2d 100644
--- a/src/Avalonia.Themes.Fluent/Controls/RadioButton.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/RadioButton.xaml
@@ -1,4 +1,4 @@
-
+
@@ -9,7 +9,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/RepeatButton.xaml b/src/Avalonia.Themes.Fluent/Controls/RepeatButton.xaml
index 7fa515d3f7..a54187104b 100644
--- a/src/Avalonia.Themes.Fluent/Controls/RepeatButton.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/RepeatButton.xaml
@@ -1,28 +1,29 @@
-
+
+
+
-
- 8,5,8,6
-
-
-
+
-
+
-
+
-
-
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ScrollBar.xaml b/src/Avalonia.Themes.Fluent/Controls/ScrollBar.xaml
index 4727ff72b9..4544fbe339 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ScrollBar.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ScrollBar.xaml
@@ -1,302 +1,283 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml b/src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml
index b7addcb61e..2c727b4435 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml
@@ -1,24 +1,26 @@
-
-
+
-
-
-
-
-
-
-
-
+
+
+ Item 1
+ Item 2
+ Item 3
+ Item 4
+ Item 5
+ Item 6
+ Item 7
+ Item 8
+ Item 9
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/Separator.xaml b/src/Avalonia.Themes.Fluent/Controls/Separator.xaml
index 5d95ccc404..d13bffe5e1 100644
--- a/src/Avalonia.Themes.Fluent/Controls/Separator.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/Separator.xaml
@@ -1,7 +1,11 @@
-
-
-
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/Slider.xaml b/src/Avalonia.Themes.Fluent/Controls/Slider.xaml
index cd2c02c567..1e4a7ac097 100644
--- a/src/Avalonia.Themes.Fluent/Controls/Slider.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/Slider.xaml
@@ -1,275 +1,397 @@
-
+
-
+
+
+
+
+
+
+
+
+
+ Error
+
+
+
+
+
+
+
+
-
- 0,0,0,4
- 15
- 15
- 32
- 32
- 10
- 20
- 20
- 20
- 20
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/SplitButton.xaml b/src/Avalonia.Themes.Fluent/Controls/SplitButton.xaml
index 91c901f567..9a93b2625b 100644
--- a/src/Avalonia.Themes.Fluent/Controls/SplitButton.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/SplitButton.xaml
@@ -1,37 +1,120 @@
-
-
-
-
+
+
+
+ Hello
+
+
+
Hello
-
+ Disabled
+
+
+ Hello
+
+
+
Hello
+
-
- 32
- 32
- 1
- 32
+ 32
+ 32
+ 1
+ 32
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -41,211 +124,83 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/SplitView.xaml b/src/Avalonia.Themes.Fluent/Controls/SplitView.xaml
index 55d46e32a1..9feb6c7fc6 100644
--- a/src/Avalonia.Themes.Fluent/Controls/SplitView.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/SplitView.xaml
@@ -1,4 +1,4 @@
-
@@ -15,219 +15,235 @@
-
- 320
- 48
- 00:00:00.2
- 00:00:00.1
- 0.1,0.9,0.2,1.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/TabControl.xaml b/src/Avalonia.Themes.Fluent/Controls/TabControl.xaml
index 322f6ce89e..17d179e0cd 100644
--- a/src/Avalonia.Themes.Fluent/Controls/TabControl.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/TabControl.xaml
@@ -1,29 +1,24 @@
-
+
-
+
-
+
-
+
-
- 0 0 0 2
-
-
-
-
-
-
-
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/TabItem.xaml b/src/Avalonia.Themes.Fluent/Controls/TabItem.xaml
index ebe6f82917..e323be72e2 100644
--- a/src/Avalonia.Themes.Fluent/Controls/TabItem.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/TabItem.xaml
@@ -1,21 +1,22 @@
-
+
+
-
- 48
- 24
- 2
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
-
-
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/TabStrip.xaml b/src/Avalonia.Themes.Fluent/Controls/TabStrip.xaml
index 681ac48850..59cb7f6752 100644
--- a/src/Avalonia.Themes.Fluent/Controls/TabStrip.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/TabStrip.xaml
@@ -1,4 +1,5 @@
-
+
@@ -8,7 +9,8 @@
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/TabStripItem.xaml b/src/Avalonia.Themes.Fluent/Controls/TabStripItem.xaml
index 59f68a1547..fab8ba87aa 100644
--- a/src/Avalonia.Themes.Fluent/Controls/TabStripItem.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/TabStripItem.xaml
@@ -1,20 +1,21 @@
-
+
Leaf
Arch
+ Background
-
- 48
- 2
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/TextBox.xaml b/src/Avalonia.Themes.Fluent/Controls/TextBox.xaml
index 40d9b11f7c..17c69da8fd 100644
--- a/src/Avalonia.Themes.Fluent/Controls/TextBox.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/TextBox.xaml
@@ -1,42 +1,106 @@
-
+
-
+
+ Left
+ Center
+ Clear
+ Reveal Password
+ Password Revealed
+
+
+ Content
+
-
-
- 0,0,0,4
- M 11.416016,10 20,1.4160156 18.583984,0 10,8.5839846 1.4160156,0 0,1.4160156 8.5839844,10 0,18.583985 1.4160156,20 10,11.416015 18.583984,20 20,18.583985 Z
- m10.051 7.0032c2.215 0 4.0105 1.7901 4.0105 3.9984s-1.7956 3.9984-4.0105 3.9984c-2.215 0-4.0105-1.7901-4.0105-3.9984s1.7956-3.9984 4.0105-3.9984zm0 1.4994c-1.3844 0-2.5066 1.1188-2.5066 2.499s1.1222 2.499 2.5066 2.499 2.5066-1.1188 2.5066-2.499-1.1222-2.499-2.5066-2.499zm0-5.0026c4.6257 0 8.6188 3.1487 9.7267 7.5613 0.10085 0.40165-0.14399 0.80877-0.54686 0.90931-0.40288 0.10054-0.81122-0.14355-0.91208-0.54521-0.94136-3.7492-4.3361-6.4261-8.2678-6.4261-3.9334 0-7.3292 2.6792-8.2689 6.4306-0.10063 0.40171-0.50884 0.64603-0.91177 0.54571s-0.648-0.5073-0.54737-0.90901c1.106-4.4152 5.1003-7.5667 9.728-7.5667z
- m0.21967 0.21965c-0.26627 0.26627-0.29047 0.68293-0.07262 0.97654l0.07262 0.08412 4.0346 4.0346c-1.922 1.3495-3.3585 3.365-3.9554 5.7495-0.10058 0.4018 0.14362 0.8091 0.54543 0.9097 0.40182 0.1005 0.80909-0.1436 0.90968-0.5455 0.52947-2.1151 1.8371-3.8891 3.5802-5.0341l1.8096 1.8098c-0.70751 0.7215-1.1438 1.71-1.1438 2.8003 0 2.2092 1.7909 4 4 4 1.0904 0 2.0788-0.4363 2.8004-1.1438l5.9193 5.9195c0.2929 0.2929 0.7677 0.2929 1.0606 0 0.2663-0.2662 0.2905-0.6829 0.0726-0.9765l-0.0726-0.0841-6.1135-6.1142 0.0012-0.0015-1.2001-1.1979-2.8699-2.8693 2e-3 -8e-4 -2.8812-2.8782 0.0012-0.0018-1.1333-1.1305-4.3064-4.3058c-0.29289-0.29289-0.76777-0.29289-1.0607 0zm7.9844 9.0458 3.5351 3.5351c-0.45 0.4358-1.0633 0.704-1.7392 0.704-1.3807 0-2.5-1.1193-2.5-2.5 0-0.6759 0.26824-1.2892 0.7041-1.7391zm1.7959-5.7655c-1.0003 0-1.9709 0.14807-2.8889 0.425l1.237 1.2362c0.5358-0.10587 1.0883-0.16119 1.6519-0.16119 3.9231 0 7.3099 2.6803 8.2471 6.4332 0.1004 0.4018 0.5075 0.6462 0.9094 0.5459 0.4019-0.1004 0.6463-0.5075 0.5459-0.9094-1.103-4.417-5.0869-7.5697-9.7024-7.5697zm0.1947 3.5093 3.8013 3.8007c-0.1018-2.0569-1.7488-3.7024-3.8013-3.8007z
-
-
-
-
-
+ 0,0,0,4
+ M 11.416016,10 20,1.4160156 18.583984,0 10,8.5839846 1.4160156,0 0,1.4160156 8.5839844,10 0,18.583985 1.4160156,20 10,11.416015 18.583984,20 20,18.583985 Z
+ m10.051 7.0032c2.215 0 4.0105 1.7901 4.0105 3.9984s-1.7956 3.9984-4.0105 3.9984c-2.215 0-4.0105-1.7901-4.0105-3.9984s1.7956-3.9984 4.0105-3.9984zm0 1.4994c-1.3844 0-2.5066 1.1188-2.5066 2.499s1.1222 2.499 2.5066 2.499 2.5066-1.1188 2.5066-2.499-1.1222-2.499-2.5066-2.499zm0-5.0026c4.6257 0 8.6188 3.1487 9.7267 7.5613 0.10085 0.40165-0.14399 0.80877-0.54686 0.90931-0.40288 0.10054-0.81122-0.14355-0.91208-0.54521-0.94136-3.7492-4.3361-6.4261-8.2678-6.4261-3.9334 0-7.3292 2.6792-8.2689 6.4306-0.10063 0.40171-0.50884 0.64603-0.91177 0.54571s-0.648-0.5073-0.54737-0.90901c1.106-4.4152 5.1003-7.5667 9.728-7.5667z
+ m0.21967 0.21965c-0.26627 0.26627-0.29047 0.68293-0.07262 0.97654l0.07262 0.08412 4.0346 4.0346c-1.922 1.3495-3.3585 3.365-3.9554 5.7495-0.10058 0.4018 0.14362 0.8091 0.54543 0.9097 0.40182 0.1005 0.80909-0.1436 0.90968-0.5455 0.52947-2.1151 1.8371-3.8891 3.5802-5.0341l1.8096 1.8098c-0.70751 0.7215-1.1438 1.71-1.1438 2.8003 0 2.2092 1.7909 4 4 4 1.0904 0 2.0788-0.4363 2.8004-1.1438l5.9193 5.9195c0.2929 0.2929 0.7677 0.2929 1.0606 0 0.2663-0.2662 0.2905-0.6829 0.0726-0.9765l-0.0726-0.0841-6.1135-6.1142 0.0012-0.0015-1.2001-1.1979-2.8699-2.8693 2e-3 -8e-4 -2.8812-2.8782 0.0012-0.0018-1.1333-1.1305-4.3064-4.3058c-0.29289-0.29289-0.76777-0.29289-1.0607 0zm7.9844 9.0458 3.5351 3.5351c-0.45 0.4358-1.0633 0.704-1.7392 0.704-1.3807 0-2.5-1.1193-2.5-2.5 0-0.6759 0.26824-1.2892 0.7041-1.7391zm1.7959-5.7655c-1.0003 0-1.9709 0.14807-2.8889 0.425l1.237 1.2362c0.5358-0.10587 1.0883-0.16119 1.6519-0.16119 3.9231 0 7.3099 2.6803 8.2471 6.4332 0.1004 0.4018 0.5075 0.6462 0.9094 0.5459 0.4019-0.1004 0.6463-0.5075 0.5459-0.9094-1.103-4.417-5.0869-7.5697-9.7024-7.5697zm0.1947 3.5093 3.8013 3.8007c-0.1018-2.0569-1.7488-3.7024-3.8013-3.8007z
-
-
-
-
-
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -62,43 +126,50 @@
-
-
+
+
-
-
-
-
-
+
+
+
+
+
@@ -107,187 +178,85 @@
-
-
-
-
-
+
+
+
-
-
+
+
-
+
+
+
-
-
+
+
-
+
+
+
-
+
+
-
-
-
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/TimePicker.xaml b/src/Avalonia.Themes.Fluent/Controls/TimePicker.xaml
index e03dc76f16..0d1b416d7a 100644
--- a/src/Avalonia.Themes.Fluent/Controls/TimePicker.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/TimePicker.xaml
@@ -1,38 +1,84 @@
-
-
-
- 40
- 1
- 1
- 0,0,0,4
- 40
- 41
- 242
- 456
- 0,3,0,6
- 0,3,0,6
-
+
+
+
+
+
+
+
+
+
+
+ Error
+
+
+
+
+
+
+
-
-
-
+ 40
+ 1
+ 1
+ 0,0,0,4
+ 40
+ 41
+ 242
+ 456
+ 0,3,0,6
+ 0,3,0,6
-
+
+
+
+
+
+
+
+
+
@@ -46,17 +92,18 @@
+ Grid.Row="0"
+ Content="{TemplateBinding Header}"
+ ContentTemplate="{TemplateBinding HeaderTemplate}"
+ Margin="{DynamicResource TimePickerTopHeaderMargin}"
+ MaxWidth="{DynamicResource TimePickerThemeMaxWidth}"
+ Foreground="{DynamicResource TimePickerHeaderForeground}"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Top" />
-
-
-
-
-
+ VerticalAlignment="Top">
-
+
+ Fill="{DynamicResource TimePickerSpacerFill}"
+ HorizontalAlignment="Center"
+ Width="{DynamicResource TimePickerSpacerThemeWidth}"
+ Grid.Column="1" />
-
+
+ HorizontalAlignment="Center"
+ Padding="{DynamicResource TimePickerHostPadding}"
+ FontFamily="{TemplateBinding FontFamily}"
+ FontWeight="{TemplateBinding FontWeight}"
+ FontSize="{TemplateBinding FontSize}"/>
+ Fill="{DynamicResource TimePickerSpacerFill}"
+ HorizontalAlignment="Center"
+ Width="{DynamicResource TimePickerSpacerThemeWidth}"
+ Grid.Column="3" />
-
+
+ HorizontalAlignment="Center"
+ Padding="{DynamicResource TimePickerHostPadding}"
+ FontFamily="{TemplateBinding FontFamily}"
+ FontWeight="{TemplateBinding FontWeight}"
+ FontSize="{TemplateBinding FontSize}" />
-
@@ -136,45 +179,28 @@
-
-
-
-
-
+
-
+
-
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/TitleBar.xaml b/src/Avalonia.Themes.Fluent/Controls/TitleBar.xaml
index 4dba5b4ba4..5730b19e78 100644
--- a/src/Avalonia.Themes.Fluent/Controls/TitleBar.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/TitleBar.xaml
@@ -1,53 +1,59 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
-
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ToggleButton.xaml b/src/Avalonia.Themes.Fluent/Controls/ToggleButton.xaml
index e0d54d7232..7a46f21534 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ToggleButton.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ToggleButton.xaml
@@ -1,5 +1,5 @@
-
+
@@ -10,10 +10,9 @@
-
- 8,5,8,6
-
-
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
+
-
+
-
+
-
+
-
-
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ToggleSwitch.xaml b/src/Avalonia.Themes.Fluent/Controls/ToggleSwitch.xaml
index a2b50a859d..aaa20a105c 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ToggleSwitch.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ToggleSwitch.xaml
@@ -1,43 +1,27 @@
-
-
- 0,0,0,6
- 6
- 6
- 0
-
+
-
+
-
-
+
+
-
-
-
-
-
-
+ Content="Header"
+ OffContent="Off"
+ OnContent="On"/>
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/ToolTip.xaml b/src/Avalonia.Themes.Fluent/Controls/ToolTip.xaml
index 2d18be91cb..bc9dceb545 100644
--- a/src/Avalonia.Themes.Fluent/Controls/ToolTip.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/ToolTip.xaml
@@ -1,56 +1,34 @@
-
-
+
-
-
- Hover Here
-
-
-
-
+
+
+ Text Content
+ Very long text content which should exceed the maximum with of the tooltip and wrap.
+
- ToolTip
- A control which pops up a hint when a control is hovered
+ Multi-line
+ Control Content
-
- ToolTip bottom placement
-
-
+
+
+
-
- 320
-
+ 320
-
-
-
-
-
-
-
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/TransitioningContentControl.xaml b/src/Avalonia.Themes.Fluent/Controls/TransitioningContentControl.xaml
index 6a4d56ccb7..f1971fe236 100644
--- a/src/Avalonia.Themes.Fluent/Controls/TransitioningContentControl.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/TransitioningContentControl.xaml
@@ -1,7 +1,6 @@
-
-
-
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/TreeView.xaml b/src/Avalonia.Themes.Fluent/Controls/TreeView.xaml
index 656b72e07b..c340599000 100644
--- a/src/Avalonia.Themes.Fluent/Controls/TreeView.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/TreeView.xaml
@@ -1,28 +1,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/TreeViewItem.xaml b/src/Avalonia.Themes.Fluent/Controls/TreeViewItem.xaml
index f86b67bb6c..83abe7848c 100644
--- a/src/Avalonia.Themes.Fluent/Controls/TreeViewItem.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/TreeViewItem.xaml
@@ -1,4 +1,4 @@
-
@@ -6,32 +6,29 @@
-
-
+
+
-
+
-
+
-
- 16
- 12
- 12, 0, 12, 0
- M 1,0 10,10 l -9,10 -1,-1 L 8,10 -0,1 Z
- M0,1 L10,10 20,1 19,0 10,8 1,0 Z
-
-
+ 16
+ 12
+ 12, 0, 12, 0
+ M 1,0 10,10 l -9,10 -1,-1 L 8,10 -0,1 Z
+ M0,1 L10,10 20,1 19,0 10,8 1,0 Z
+
-
-
+
+
+
@@ -79,7 +80,7 @@
@@ -99,83 +100,75 @@
-
-
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
-
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/UserControl.xaml b/src/Avalonia.Themes.Fluent/Controls/UserControl.xaml
index d6028daff8..7dc23f652a 100644
--- a/src/Avalonia.Themes.Fluent/Controls/UserControl.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/UserControl.xaml
@@ -1,16 +1,24 @@
-
diff --git a/src/Avalonia.Themes.Fluent/Controls/Window.xaml b/src/Avalonia.Themes.Fluent/Controls/Window.xaml
index 90963c606c..35cc81663f 100644
--- a/src/Avalonia.Themes.Fluent/Controls/Window.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/Window.xaml
@@ -1,27 +1,30 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Avalonia.Themes.Fluent/Controls/WindowNotificationManager.xaml b/src/Avalonia.Themes.Fluent/Controls/WindowNotificationManager.xaml
index 8d14c2d972..77f49941f0 100644
--- a/src/Avalonia.Themes.Fluent/Controls/WindowNotificationManager.xaml
+++ b/src/Avalonia.Themes.Fluent/Controls/WindowNotificationManager.xaml
@@ -1,47 +1,57 @@
-
-
-
+
-
+
-
+
-
-
+
+
+
diff --git a/src/Avalonia.X11/X11IconLoader.cs b/src/Avalonia.X11/X11IconLoader.cs
index 36939f4103..0357fdd94e 100644
--- a/src/Avalonia.X11/X11IconLoader.cs
+++ b/src/Avalonia.X11/X11IconLoader.cs
@@ -48,12 +48,6 @@ namespace Avalonia.X11
_width = Math.Min(bitmap.PixelSize.Width, 128);
_height = Math.Min(bitmap.PixelSize.Height, 128);
_bdata = new uint[_width * _height];
- fixed (void* ptr = _bdata)
- {
- var iptr = (int*)ptr;
- iptr[0] = _width;
- iptr[1] = _height;
- }
using(var rt = AvaloniaLocator.Current.GetService().CreateRenderTarget(new[]{this}))
using (var ctx = rt.CreateDrawingContext(null))
ctx.DrawBitmap(bitmap.PlatformImpl, 1, new Rect(bitmap.Size),
@@ -65,7 +59,7 @@ namespace Avalonia.X11
{
var r = y * _width;
for (var x = 0; x < _width; x++)
- Data[r + x] = new UIntPtr(_bdata[r + x]);
+ Data[r + x + 2] = new UIntPtr(_bdata[r + x]);
}
_bdata = null;
@@ -86,7 +80,7 @@ namespace Avalonia.X11
var r = y * _width;
var fbr = y * fb.RowBytes / 4;
for (var x = 0; x < _width; x++)
- fbp[fbr + x] = Data[r + x].ToUInt32();
+ fbp[fbr + x] = Data[r + x + 2].ToUInt32();
}
}
wr.Save(outputStream);
diff --git a/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github b/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github
index d990d63774..a4e6be2d14 160000
--- a/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github
+++ b/src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github
@@ -1 +1 @@
-Subproject commit d990d63774a04d2a4b3d52e626a90ee68e19e2b6
+Subproject commit a4e6be2d1407abec4f35fcb208848830ce513ead
diff --git a/src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs b/src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs
index d36db107e3..7435e3342e 100644
--- a/src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs
+++ b/src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs
@@ -101,7 +101,6 @@ namespace Avalonia.Win32.Interop.Wpf
Size ITopLevelImpl.ClientSize => _finalSize;
Size? ITopLevelImpl.FrameSize => null;
- IMouseDevice ITopLevelImpl.MouseDevice => _mouse;
double ITopLevelImpl.RenderScaling => PresentationSource.FromVisual(this)?.CompositionTarget?.TransformToDevice.M11 ?? 1;
diff --git a/src/Windows/Avalonia.Win32/Input/WindowsMouseDevice.cs b/src/Windows/Avalonia.Win32/Input/WindowsMouseDevice.cs
index b1064ae25d..224ffdc3fd 100644
--- a/src/Windows/Avalonia.Win32/Input/WindowsMouseDevice.cs
+++ b/src/Windows/Avalonia.Win32/Input/WindowsMouseDevice.cs
@@ -8,15 +8,28 @@ namespace Avalonia.Win32.Input
{
class WindowsMouseDevice : MouseDevice
{
- public WindowsMouseDevice() : base(new WindowsMousePointer())
+ private readonly IPointer _pointer;
+ public WindowsMouseDevice() : base(WindowsMousePointer.CreatePointer(out var pointer))
{
-
+ _pointer = pointer;
+ }
+
+ // Normally user should use IPointer.Capture instead of MouseDevice.Capture,
+ // But on Windows we need to handle WM_MOUSE capture manually without having access to the Pointer.
+ internal void Capture(IInputElement control)
+ {
+ _pointer.Capture(control);
}
- class WindowsMousePointer : Pointer
+ internal class WindowsMousePointer : Pointer
{
- public WindowsMousePointer() : base(Pointer.GetNextFreeId(),PointerType.Mouse, true)
+ private WindowsMousePointer() : base(Pointer.GetNextFreeId(),PointerType.Mouse, true)
+ {
+ }
+
+ public static WindowsMousePointer CreatePointer(out WindowsMousePointer pointer)
{
+ return pointer = new WindowsMousePointer();
}
protected override void PlatformCapture(IInputElement element)
diff --git a/src/Windows/Avalonia.Win32/WindowImpl.cs b/src/Windows/Avalonia.Win32/WindowImpl.cs
index 2f1a116af7..6d5cba9946 100644
--- a/src/Windows/Avalonia.Win32/WindowImpl.cs
+++ b/src/Windows/Avalonia.Win32/WindowImpl.cs
@@ -72,7 +72,7 @@ namespace Avalonia.Win32
private const WindowStyles WindowStateMask = (WindowStyles.WS_MAXIMIZE | WindowStyles.WS_MINIMIZE);
private readonly TouchDevice _touchDevice;
- private readonly MouseDevice _mouseDevice;
+ private readonly WindowsMouseDevice _mouseDevice;
private readonly PenDevice _penDevice;
private readonly ManagedDeferredRendererLock _rendererLock;
private readonly FramebufferManager _framebuffer;
@@ -689,10 +689,9 @@ namespace Avalonia.Win32
public void BeginMoveDrag(PointerPressedEventArgs e)
{
- _mouseDevice.Capture(null);
+ e.Pointer.Capture(null);
DefWindowProc(_hwnd, (int)WindowsMessage.WM_NCLBUTTONDOWN,
new IntPtr((int)HitTestValues.HTCAPTION), IntPtr.Zero);
- e.Pointer.Capture(null);
}
public void BeginResizeDrag(WindowEdge edge, PointerPressedEventArgs e)
@@ -702,7 +701,7 @@ namespace Avalonia.Win32
#if USE_MANAGED_DRAG
_managedDrag.BeginResizeDrag(edge, ScreenToClient(MouseDevice.Position.ToPoint(_scaling)));
#else
- _mouseDevice.Capture(null);
+ e.Pointer.Capture(null);
DefWindowProc(_hwnd, (int)WindowsMessage.WM_NCLBUTTONDOWN,
new IntPtr((int)s_edgeLookup[edge]), IntPtr.Zero);
#endif
diff --git a/tests/Avalonia.Base.UnitTests/Input/MouseDeviceTests.cs b/tests/Avalonia.Base.UnitTests/Input/MouseDeviceTests.cs
index 88abb4a6fa..466aba43ee 100644
--- a/tests/Avalonia.Base.UnitTests/Input/MouseDeviceTests.cs
+++ b/tests/Avalonia.Base.UnitTests/Input/MouseDeviceTests.cs
@@ -1,9 +1,12 @@
using System;
using System.Collections.Generic;
using Avalonia.Controls;
+using Avalonia.Controls.Presenters;
+using Avalonia.Controls.Templates;
using Avalonia.Input;
using Avalonia.Input.Raw;
using Avalonia.Media;
+using Avalonia.Platform;
using Avalonia.Rendering;
using Avalonia.UnitTests;
using Moq;
@@ -11,71 +14,79 @@ using Xunit;
namespace Avalonia.Base.UnitTests.Input
{
- public class MouseDeviceTests
+ public class MouseDeviceTests : PointerTestsBase
{
-#pragma warning disable CS0618 // Type or member is obsolete
[Fact]
public void Capture_Is_Transferred_To_Parent_When_Control_Removed()
{
+ using var app = UnitTestApplication.Start(new TestServices(inputManager: new InputManager()));
+
+ var renderer = new Mock();
+ var device = new MouseDevice();
+ var impl = CreateTopLevelImplMock(renderer.Object);
+
Canvas control;
- var root = new TestRoot
+ Panel rootChild;
+ var root = CreateInputRoot(impl.Object, rootChild = new Panel
+ {
+ Children =
+ {
+ (control = new Canvas())
+ }
+ });
+
+ // Synthesize event to receive a pointer.
+ IPointer result = null;
+ root.PointerMoved += (_, a) =>
{
- Child = control = new Canvas(),
+ result = a.Pointer;
};
- var target = new MouseDevice();
+ SetHit(renderer, control);
+ impl.Object.Input!(CreateRawPointerMovedArgs(device, root));
- target.Capture(control);
- Assert.Same(control, target.Captured);
+ Assert.NotNull(result);
+
+ result.Capture(control);
+ Assert.Same(control, result.Captured);
- root.Child = null;
+ rootChild.Children.Clear();
- Assert.Same(root, target.Captured);
+ Assert.Same(rootChild, result.Captured);
}
-#pragma warning restore CS0618 // Type or member is obsolete
[Fact]
public void GetPosition_Should_Respect_Control_RenderTransform()
{
+ using var app = UnitTestApplication.Start(new TestServices(inputManager: new InputManager()));
+
var renderer = new Mock();
+ var device = new MouseDevice();
+ var impl = CreateTopLevelImplMock(renderer.Object);
- using (TestApplication(renderer.Object))
+ Border border;
+ var root = CreateInputRoot(impl.Object, new Panel
{
- var inputManager = InputManager.Instance;
-
- var root = new TestRoot
+ Children =
{
- MouseDevice = new MouseDevice(),
- Child = new Border
+ (border = new Border
{
Background = Brushes.Black,
RenderTransform = new TranslateTransform(10, 0),
- }
- };
-
- SendMouseMove(inputManager, root, new Point(11, 11));
-
-#pragma warning disable CS0618 // Type or member is obsolete
- var result = root.MouseDevice.GetPosition(root.Child);
-#pragma warning restore CS0618 // Type or member is obsolete
- Assert.Equal(new Point(1, 11), result);
- }
- }
+ })
+ }
+ });
+
+
+ Point? result = null;
+ root.PointerMoved += (_, a) =>
+ {
+ result = a.GetPosition(border);
+ };
- private void SendMouseMove(IInputManager inputManager, TestRoot root, Point p = new Point())
- {
- inputManager.ProcessInput(new RawPointerEventArgs(
- root.MouseDevice,
- 0,
- root,
- RawPointerEventType.Move,
- p,
- RawInputModifiers.None));
- }
+ SetHit(renderer, border);
+ impl.Object.Input!(CreateRawPointerMovedArgs(device, root, new Point(11, 11)));
- private IDisposable TestApplication(IRenderer renderer)
- {
- return UnitTestApplication.Start(
- new TestServices(inputManager: new InputManager()));
+ Assert.Equal(new Point(1, 11), result);
}
}
}
diff --git a/tests/Avalonia.Base.UnitTests/Input/PointerOverTests.cs b/tests/Avalonia.Base.UnitTests/Input/PointerOverTests.cs
index a5ca2aef4a..a83b176484 100644
--- a/tests/Avalonia.Base.UnitTests/Input/PointerOverTests.cs
+++ b/tests/Avalonia.Base.UnitTests/Input/PointerOverTests.cs
@@ -3,14 +3,10 @@ using System;
using System.Collections.Generic;
using Avalonia.Controls;
-using Avalonia.Controls.Presenters;
-using Avalonia.Controls.Templates;
using Avalonia.Input;
using Avalonia.Input.Raw;
-using Avalonia.Platform;
using Avalonia.Rendering;
using Avalonia.UnitTests;
-using Avalonia.VisualTree;
using Moq;
@@ -18,7 +14,7 @@ using Xunit;
namespace Avalonia.Base.UnitTests.Input
{
- public class PointerOverTests
+ public class PointerOverTests : PointerTestsBase
{
// https://github.com/AvaloniaUI/Avalonia/issues/2821
[Fact]
@@ -448,87 +444,5 @@ namespace Avalonia.Base.UnitTests.Input
c.PointerMoved += handler;
}
}
-
- private static void SetHit(Mock renderer, IControl? hit)
- {
- renderer.Setup(x => x.HitTest(It.IsAny(), It.IsAny(), It.IsAny>()))
- .Returns(hit is null ? Array.Empty() : new[] { hit });
-
- renderer.Setup(x => x.HitTestFirst(It.IsAny(), It.IsAny(), It.IsAny>()))
- .Returns(hit);
- }
-
- private static void SetMove(Mock deviceMock, IInputRoot root, IInputElement element)
- {
- deviceMock.Setup(d => d.ProcessRawEvent(It.IsAny()))
- .Callback(() => element.RaiseEvent(CreatePointerMovedArgs(root, element)));
- }
-
- private static Mock CreateTopLevelImplMock(IRenderer renderer)
- {
- var impl = new Mock();
- impl.DefaultValue = DefaultValue.Mock;
- impl.SetupAllProperties();
- impl.SetupGet(r => r.RenderScaling).Returns(1);
- impl.Setup(r => r.CreateRenderer(It.IsAny())).Returns(renderer);
- impl.Setup(r => r.PointToScreen(It.IsAny())).Returns(p => new PixelPoint((int)p.X, (int)p.Y));
- impl.Setup(r => r.PointToClient(It.IsAny())).Returns(p => new Point(p.X, p.Y));
- return impl;
- }
-
- private static IInputRoot CreateInputRoot(IWindowImpl impl, IControl child)
- {
- var root = new Window(impl)
- {
- Width = 100,
- Height = 100,
- Content = child,
- Template = new FuncControlTemplate((w, _) => new ContentPresenter
- {
- Content = w.Content
- })
- };
- root.Show();
- return root;
- }
-
- private static IInputRoot CreateInputRoot(IRenderer renderer, IControl child)
- {
- return CreateInputRoot(CreateTopLevelImplMock(renderer).Object, child);
- }
-
- private static RawPointerEventArgs CreateRawPointerMovedArgs(
- IPointerDevice pointerDevice,
- IInputRoot root,
- Point? positition = null)
- {
- return new RawPointerEventArgs(pointerDevice, 0, root, RawPointerEventType.Move,
- positition ?? default, default);
- }
-
- private static PointerEventArgs CreatePointerMovedArgs(
- IInputRoot root, IInputElement? source, Point? positition = null)
- {
- return new PointerEventArgs(InputElement.PointerMovedEvent, source, new Mock().Object, root,
- positition ?? default, default, PointerPointProperties.None, KeyModifiers.None);
- }
-
- private static Mock CreatePointerDeviceMock(
- IPointer? pointer = null,
- PointerType pointerType = PointerType.Mouse)
- {
- if (pointer is null)
- {
- var pointerMock = new Mock();
- pointerMock.SetupGet(p => p.Type).Returns(pointerType);
- pointer = pointerMock.Object;
- }
-
- var pointerDevice = new Mock();
- pointerDevice.Setup(d => d.TryGetPointer(It.IsAny()))
- .Returns(pointer);
-
- return pointerDevice;
- }
}
}
diff --git a/tests/Avalonia.Base.UnitTests/Input/PointerTestsBase.cs b/tests/Avalonia.Base.UnitTests/Input/PointerTestsBase.cs
new file mode 100644
index 0000000000..1ca6678aef
--- /dev/null
+++ b/tests/Avalonia.Base.UnitTests/Input/PointerTestsBase.cs
@@ -0,0 +1,90 @@
+#nullable enable
+using System;
+using Avalonia.Controls;
+using Avalonia.Controls.Presenters;
+using Avalonia.Controls.Templates;
+using Avalonia.Input;
+using Avalonia.Input.Raw;
+using Avalonia.Platform;
+using Avalonia.Rendering;
+using Avalonia.VisualTree;
+using Moq;
+
+namespace Avalonia.Base.UnitTests.Input;
+
+public abstract class PointerTestsBase
+{
+ protected static void SetHit(Mock renderer, IControl? hit)
+ {
+ renderer.Setup(x => x.HitTest(It.IsAny(), It.IsAny(), It.IsAny>()))
+ .Returns(hit is null ? Array.Empty() : new[] { hit });
+
+ renderer.Setup(x => x.HitTestFirst(It.IsAny(), It.IsAny(), It.IsAny>()))
+ .Returns(hit);
+ }
+
+ protected static void SetMove(Mock deviceMock, IInputRoot root, IInputElement element)
+ {
+ deviceMock.Setup(d => d.ProcessRawEvent(It.IsAny()))
+ .Callback(() => element.RaiseEvent(CreatePointerMovedArgs(root, element)));
+ }
+
+ protected static Mock CreateTopLevelImplMock(IRenderer renderer)
+ {
+ var impl = new Mock();
+ impl.DefaultValue = DefaultValue.Mock;
+ impl.SetupAllProperties();
+ impl.SetupGet(r => r.RenderScaling).Returns(1);
+ impl.Setup(r => r.CreateRenderer(It.IsAny())).Returns(renderer);
+ impl.Setup(r => r.PointToScreen(It.IsAny())).Returns(p => new PixelPoint((int)p.X, (int)p.Y));
+ impl.Setup(r => r.PointToClient(It.IsAny())).Returns(p => new Point(p.X, p.Y));
+ return impl;
+ }
+
+ protected static IInputRoot CreateInputRoot(IWindowImpl impl, IControl child)
+ {
+ var root = new Window(impl)
+ {
+ Width = 100,
+ Height = 100,
+ Content = child,
+ Template = new FuncControlTemplate((w, _) => new ContentPresenter { Content = w.Content })
+ };
+ root.Show();
+ return root;
+ }
+
+ protected static RawPointerEventArgs CreateRawPointerMovedArgs(
+ IPointerDevice pointerDevice,
+ IInputRoot root,
+ Point? positition = null)
+ {
+ return new RawPointerEventArgs(pointerDevice, 0, root, RawPointerEventType.Move,
+ positition ?? default, default);
+ }
+
+ protected static PointerEventArgs CreatePointerMovedArgs(
+ IInputRoot root, IInputElement? source, Point? positition = null)
+ {
+ return new PointerEventArgs(InputElement.PointerMovedEvent, source, new Mock().Object, root,
+ positition ?? default, default, PointerPointProperties.None, KeyModifiers.None);
+ }
+
+ protected static Mock CreatePointerDeviceMock(
+ IPointer? pointer = null,
+ PointerType pointerType = PointerType.Mouse)
+ {
+ if (pointer is null)
+ {
+ var pointerMock = new Mock();
+ pointerMock.SetupGet(p => p.Type).Returns(pointerType);
+ pointer = pointerMock.Object;
+ }
+
+ var pointerDevice = new Mock();
+ pointerDevice.Setup(d => d.TryGetPointer(It.IsAny()))
+ .Returns(pointer);
+
+ return pointerDevice;
+ }
+}
diff --git a/tests/Avalonia.UnitTests/MockWindowingPlatform.cs b/tests/Avalonia.UnitTests/MockWindowingPlatform.cs
index 339b87cf88..e30f0fa5f3 100644
--- a/tests/Avalonia.UnitTests/MockWindowingPlatform.cs
+++ b/tests/Avalonia.UnitTests/MockWindowingPlatform.cs
@@ -34,7 +34,6 @@ namespace Avalonia.UnitTests
windowImpl.Setup(x => x.RenderScaling).Returns(1);
windowImpl.Setup(x => x.Screen).Returns(CreateScreenMock().Object);
windowImpl.Setup(x => x.Position).Returns(() => position);
- SetupToplevel(windowImpl);
windowImpl.Setup(x => x.CreatePopup()).Returns(() =>
{
@@ -100,8 +99,6 @@ namespace Avalonia.UnitTests
{
popupImpl.Object.Closed?.Invoke();
});
-
- SetupToplevel(popupImpl);
return popupImpl;
}
@@ -144,10 +141,5 @@ namespace Avalonia.UnitTests
{
return null;
}
-
- private static void SetupToplevel(Mock mock) where T : class, ITopLevelImpl
- {
- mock.SetupGet(x => x.MouseDevice).Returns(new MouseDevice());
- }
}
}
diff --git a/tests/Avalonia.UnitTests/TestRoot.cs b/tests/Avalonia.UnitTests/TestRoot.cs
index 41e29a85c4..138958512f 100644
--- a/tests/Avalonia.UnitTests/TestRoot.cs
+++ b/tests/Avalonia.UnitTests/TestRoot.cs
@@ -58,9 +58,7 @@ namespace Avalonia.UnitTests
public IKeyboardNavigationHandler KeyboardNavigationHandler => null;
public IInputElement PointerOverElement { get; set; }
-
- public IMouseDevice MouseDevice { get; set; }
-
+
public bool ShowAccessKeys { get; set; }
public IStyleHost StylingParent { get; set; }