Browse Source

Merge branch 'master' into feature/fullFontTestBackend

pull/7344/head
Max Katz 4 years ago
committed by GitHub
parent
commit
27be3ef362
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      build/SourceLink.props
  2. 21
      samples/ControlCatalog/App.xaml.cs
  3. 2
      samples/ControlCatalog/MainView.xaml.cs
  4. 3
      src/Avalonia.Controls/ApiCompatBaseline.txt
  5. 96
      src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs
  6. 6
      src/Avalonia.Controls/ApplicationLifetimes/IClassicDesktopStyleApplicationLifetime.cs
  7. 2
      src/Avalonia.Controls/LayoutTransformControl.cs
  8. 2
      src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs
  9. 2
      src/Avalonia.Controls/Primitives/PopupRoot.cs
  10. 9
      src/Avalonia.Controls/TopLevel.cs
  11. 337
      src/Avalonia.Controls/ValidatingToplevel.cs
  12. 11
      src/Avalonia.Controls/Window.cs
  13. 9
      src/Avalonia.Controls/WindowBase.cs
  14. 4
      src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml
  15. 8
      src/Avalonia.Native/AvaloniaNativeMenuExporter.cs
  16. 64
      src/Avalonia.Themes.Default/Accents/Base.xaml
  17. 77
      src/Avalonia.Themes.Default/Accents/BaseDark.xaml
  18. 82
      src/Avalonia.Themes.Default/Accents/BaseLight.xaml
  19. 5
      src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj
  20. 0
      src/Avalonia.Themes.Default/Controls/AutoCompleteBox.xaml
  21. 0
      src/Avalonia.Themes.Default/Controls/Button.xaml
  22. 0
      src/Avalonia.Themes.Default/Controls/ButtonSpinner.xaml
  23. 0
      src/Avalonia.Themes.Default/Controls/Calendar.xaml
  24. 0
      src/Avalonia.Themes.Default/Controls/CalendarButton.xaml
  25. 0
      src/Avalonia.Themes.Default/Controls/CalendarDatePicker.xaml
  26. 0
      src/Avalonia.Themes.Default/Controls/CalendarDayButton.xaml
  27. 0
      src/Avalonia.Themes.Default/Controls/CalendarItem.xaml
  28. 0
      src/Avalonia.Themes.Default/Controls/CaptionButtons.xaml
  29. 0
      src/Avalonia.Themes.Default/Controls/Carousel.xaml
  30. 0
      src/Avalonia.Themes.Default/Controls/CheckBox.xaml
  31. 0
      src/Avalonia.Themes.Default/Controls/ComboBox.xaml
  32. 0
      src/Avalonia.Themes.Default/Controls/ComboBoxItem.xaml
  33. 0
      src/Avalonia.Themes.Default/Controls/ContentControl.xaml
  34. 0
      src/Avalonia.Themes.Default/Controls/ContextMenu.xaml
  35. 0
      src/Avalonia.Themes.Default/Controls/DataValidationErrors.xaml
  36. 0
      src/Avalonia.Themes.Default/Controls/DatePicker.xaml
  37. 0
      src/Avalonia.Themes.Default/Controls/EmbeddableControlRoot.xaml
  38. 0
      src/Avalonia.Themes.Default/Controls/Expander.xaml
  39. 0
      src/Avalonia.Themes.Default/Controls/FlyoutPresenter.xaml
  40. 0
      src/Avalonia.Themes.Default/Controls/FocusAdorner.xaml
  41. 0
      src/Avalonia.Themes.Default/Controls/GridSplitter.xaml
  42. 0
      src/Avalonia.Themes.Default/Controls/ItemsControl.xaml
  43. 0
      src/Avalonia.Themes.Default/Controls/Label.xaml
  44. 0
      src/Avalonia.Themes.Default/Controls/ListBox.xaml
  45. 0
      src/Avalonia.Themes.Default/Controls/ListBoxItem.xaml
  46. 0
      src/Avalonia.Themes.Default/Controls/ManagedFileChooser.xaml
  47. 0
      src/Avalonia.Themes.Default/Controls/Menu.xaml
  48. 0
      src/Avalonia.Themes.Default/Controls/MenuFlyoutPresenter.xaml
  49. 0
      src/Avalonia.Themes.Default/Controls/MenuItem.xaml
  50. 0
      src/Avalonia.Themes.Default/Controls/NativeMenuBar.xaml
  51. 0
      src/Avalonia.Themes.Default/Controls/NotificationCard.xaml
  52. 0
      src/Avalonia.Themes.Default/Controls/NumericUpDown.xaml
  53. 0
      src/Avalonia.Themes.Default/Controls/OverlayPopupHost.xaml
  54. 0
      src/Avalonia.Themes.Default/Controls/PathIcon.xaml
  55. 0
      src/Avalonia.Themes.Default/Controls/PopupRoot.xaml
  56. 0
      src/Avalonia.Themes.Default/Controls/ProgressBar.xaml
  57. 0
      src/Avalonia.Themes.Default/Controls/RadioButton.xaml
  58. 0
      src/Avalonia.Themes.Default/Controls/RepeatButton.xaml
  59. 0
      src/Avalonia.Themes.Default/Controls/ScrollBar.xaml
  60. 0
      src/Avalonia.Themes.Default/Controls/ScrollViewer.xaml
  61. 0
      src/Avalonia.Themes.Default/Controls/Separator.xaml
  62. 0
      src/Avalonia.Themes.Default/Controls/Slider.xaml
  63. 0
      src/Avalonia.Themes.Default/Controls/SplitView.xaml
  64. 0
      src/Avalonia.Themes.Default/Controls/TabControl.xaml
  65. 0
      src/Avalonia.Themes.Default/Controls/TabItem.xaml
  66. 0
      src/Avalonia.Themes.Default/Controls/TabStrip.xaml
  67. 0
      src/Avalonia.Themes.Default/Controls/TabStripItem.xaml
  68. 0
      src/Avalonia.Themes.Default/Controls/TextBox.xaml
  69. 0
      src/Avalonia.Themes.Default/Controls/TimePicker.xaml
  70. 0
      src/Avalonia.Themes.Default/Controls/TitleBar.xaml
  71. 0
      src/Avalonia.Themes.Default/Controls/ToggleButton.xaml
  72. 0
      src/Avalonia.Themes.Default/Controls/ToggleSwitch.xaml
  73. 0
      src/Avalonia.Themes.Default/Controls/ToolTip.xaml
  74. 0
      src/Avalonia.Themes.Default/Controls/TreeView.xaml
  75. 0
      src/Avalonia.Themes.Default/Controls/TreeViewItem.xaml
  76. 0
      src/Avalonia.Themes.Default/Controls/UserControl.xaml
  77. 0
      src/Avalonia.Themes.Default/Controls/Window.xaml
  78. 0
      src/Avalonia.Themes.Default/Controls/WindowNotificationManager.xaml
  79. 118
      src/Avalonia.Themes.Default/DefaultTheme.xaml
  80. 1
      src/Avalonia.Themes.Default/DefaultTheme.xaml.cs
  81. 166
      src/Avalonia.Themes.Default/SimpleTheme.cs
  82. 8
      src/Avalonia.Themes.Default/SimpleThemeMode.cs
  83. 3
      src/Avalonia.Themes.Fluent/Controls/ButtonSpinner.xaml
  84. 2
      src/Avalonia.Themes.Fluent/Controls/CalendarButton.xaml
  85. 3
      src/Avalonia.Themes.Fluent/Controls/CalendarDatePicker.xaml
  86. 2
      src/Avalonia.Themes.Fluent/Controls/CalendarDayButton.xaml
  87. 5
      src/Avalonia.Themes.Fluent/Controls/CalendarItem.xaml
  88. 8
      src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml
  89. 3
      src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml
  90. 8
      src/Avalonia.Themes.Fluent/Controls/Expander.xaml
  91. 4
      src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml
  92. 6
      src/Avalonia.Themes.Fluent/Controls/MenuItem.xaml
  93. 3
      src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml
  94. 4
      src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml
  95. 8
      src/Avalonia.Themes.Fluent/Controls/ProgressBar.xaml
  96. 3
      src/Avalonia.Themes.Fluent/Controls/TabItem.xaml
  97. 3
      src/Avalonia.Themes.Fluent/Controls/TabStripItem.xaml
  98. 2
      src/Avalonia.Themes.Fluent/Controls/TextBox.xaml
  99. 3
      src/Avalonia.Themes.Fluent/Controls/TimePicker.xaml
  100. 3
      src/Avalonia.Themes.Fluent/Controls/ToolTip.xaml

5
build/SourceLink.props

@ -3,7 +3,6 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>false</IncludeSymbols>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>embedded</DebugType>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
@ -15,6 +14,10 @@
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup>
<DebugType Condition="$(ContinuousIntegrationBuild) == 'true'">embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>

21
samples/ControlCatalog/App.xaml.cs

@ -5,6 +5,7 @@ using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Avalonia.Markup.Xaml.Styling;
using Avalonia.Styling;
using Avalonia.Themes.Default;
using Avalonia.Themes.Fluent;
using ControlCatalog.ViewModels;
@ -29,6 +30,8 @@ namespace ControlCatalog
public static FluentTheme Fluent = new FluentTheme(new Uri("avares://ControlCatalog/Styles"));
public static SimpleTheme Default = new SimpleTheme(new Uri("avares://ControlCatalog/Styles"));
public static Styles DefaultLight = new Styles
{
new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
@ -43,14 +46,7 @@ namespace ControlCatalog
{
Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/BaseLight.xaml")
},
new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
{
Source = new Uri("avares://Avalonia.Themes.Default/Accents/BaseLight.xaml")
},
new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
{
Source = new Uri("avares://Avalonia.Themes.Default/DefaultTheme.xaml")
}
Default
};
public static Styles DefaultDark = new Styles
@ -67,14 +63,7 @@ namespace ControlCatalog
{
Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/BaseDark.xaml")
},
new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
{
Source = new Uri("avares://Avalonia.Themes.Default/Accents/BaseDark.xaml")
},
new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
{
Source = new Uri("avares://Avalonia.Themes.Default/DefaultTheme.xaml")
}
Default
};
public override void Initialize()

2
samples/ControlCatalog/MainView.xaml.cs

@ -63,11 +63,13 @@ namespace ControlCatalog
}
else if (theme == CatalogTheme.DefaultLight)
{
App.Default.Mode = Avalonia.Themes.Default.SimpleThemeMode.Light;
Application.Current.Styles[0] = App.DefaultLight;
Application.Current.Styles[1] = App.DataGridDefault;
}
else if (theme == CatalogTheme.DefaultDark)
{
App.Default.Mode = Avalonia.Themes.Default.SimpleThemeMode.Dark;
Application.Current.Styles[0] = App.DefaultDark;
Application.Current.Styles[1] = App.DataGridDefault;
}

3
src/Avalonia.Controls/ApiCompatBaseline.txt

@ -36,6 +36,7 @@ CannotRemoveBaseTypeOrInterface : Type 'Avalonia.Controls.WindowBase' does not i
InterfacesShouldHaveSameMembers : Interface member 'public System.EventHandler<Avalonia.Controls.ApplicationLifetimes.ShutdownRequestedEventArgs> Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime.ShutdownRequested' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime.add_ShutdownRequested(System.EventHandler<Avalonia.Controls.ApplicationLifetimes.ShutdownRequestedEventArgs>)' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime.remove_ShutdownRequested(System.EventHandler<Avalonia.Controls.ApplicationLifetimes.ShutdownRequestedEventArgs>)' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public System.Boolean Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime.TryShutdown(System.Int32)' is present in the implementation but not in the contract.
CannotRemoveBaseTypeOrInterface : Type 'Avalonia.Controls.Embedding.EmbeddableControlRoot' does not implement interface 'Avalonia.Utilities.IWeakSubscriber<Avalonia.Controls.ResourcesChangedEventArgs>' in the implementation but it does in the contract.
MembersMustExist : Member 'public System.Action<Avalonia.Size> Avalonia.Controls.Embedding.Offscreen.OffscreenTopLevelImplBase.Resized.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public void Avalonia.Controls.Embedding.Offscreen.OffscreenTopLevelImplBase.Resized.set(System.Action<Avalonia.Size>)' does not exist in the implementation but it does exist in the contract.
@ -62,4 +63,4 @@ InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Platfor
MembersMustExist : Member 'public void Avalonia.Platform.IWindowImpl.Resize(Avalonia.Size)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Platform.IWindowImpl.Resize(Avalonia.Size, Avalonia.Platform.PlatformResizeReason)' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Platform.ITrayIconImpl Avalonia.Platform.IWindowingPlatform.CreateTrayIcon()' is present in the implementation but not in the contract.
Total Issues: 63
Total Issues: 64

96
src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs

@ -76,36 +76,21 @@ namespace Avalonia.Controls.ApplicationLifetimes
return;
if (ShutdownMode == ShutdownMode.OnLastWindowClose && _windows.Count == 0)
Shutdown();
else if (ShutdownMode == ShutdownMode.OnMainWindowClose && window == MainWindow)
Shutdown();
TryShutdown();
else if (ShutdownMode == ShutdownMode.OnMainWindowClose && ReferenceEquals(window, MainWindow))
TryShutdown();
}
public void Shutdown(int exitCode = 0)
{
if (_isShuttingDown)
throw new InvalidOperationException("Application is already shutting down.");
_exitCode = exitCode;
_isShuttingDown = true;
DoShutdown(new ShutdownRequestedEventArgs(), true, exitCode);
}
try
{
foreach (var w in Windows)
w.Close();
var e = new ControlledApplicationLifetimeExitEventArgs(exitCode);
Exit?.Invoke(this, e);
_exitCode = e.ApplicationExitCode;
}
finally
{
_cts?.Cancel();
_cts = null;
_isShuttingDown = false;
}
public bool TryShutdown(int exitCode = 0)
{
return DoShutdown(new ShutdownRequestedEventArgs(), false, exitCode);
}
public int Start(string[] args)
{
Startup?.Invoke(this, new ControlledApplicationLifetimeStartupEventArgs(args));
@ -114,7 +99,10 @@ namespace Avalonia.Controls.ApplicationLifetimes
if(options != null && options.ProcessUrlActivationCommandLine && args.Length > 0)
{
((IApplicationPlatformEvents)Application.Current).RaiseUrlsOpened(args);
if (Application.Current is IApplicationPlatformEvents events)
{
events.RaiseUrlsOpened(args);
}
}
var lifetimeEvents = AvaloniaLocator.Current.GetService<IPlatformLifetimeEventsImpl>();
@ -145,23 +133,57 @@ namespace Avalonia.Controls.ApplicationLifetimes
if (_activeLifetime == this)
_activeLifetime = null;
}
private void OnShutdownRequested(object sender, ShutdownRequestedEventArgs e)
private bool DoShutdown(ShutdownRequestedEventArgs e, bool force = false, int exitCode = 0)
{
ShutdownRequested?.Invoke(this, e);
if (!force)
{
ShutdownRequested?.Invoke(this, e);
if (e.Cancel)
return;
if (e.Cancel)
return false;
if (_isShuttingDown)
throw new InvalidOperationException("Application is already shutting down.");
}
_exitCode = exitCode;
_isShuttingDown = true;
// When an OS shutdown request is received, try to close all non-owned windows. Windows can cancel
// shutdown by setting e.Cancel = true in the Closing event. Owned windows will be shutdown by their
// owners.
foreach (var w in Windows)
if (w.Owner is null)
w.Close();
if (Windows.Count > 0)
e.Cancel = true;
try
{
// When an OS shutdown request is received, try to close all non-owned windows. Windows can cancel
// shutdown by setting e.Cancel = true in the Closing event. Owned windows will be shutdown by their
// owners.
foreach (var w in Windows)
{
if (w.Owner is null)
{
w.Close();
}
}
if (!force && Windows.Count > 0)
{
e.Cancel = true;
return false;
}
var args = new ControlledApplicationLifetimeExitEventArgs(exitCode);
Exit?.Invoke(this, args);
_exitCode = args.ApplicationExitCode;
}
finally
{
_cts?.Cancel();
_cts = null;
_isShuttingDown = false;
}
return true;
}
private void OnShutdownRequested(object sender, ShutdownRequestedEventArgs e) => DoShutdown(e);
}
public class ClassicDesktopStyleApplicationLifetimeOptions

6
src/Avalonia.Controls/ApplicationLifetimes/IClassicDesktopStyleApplicationLifetime.cs

@ -9,6 +9,12 @@ namespace Avalonia.Controls.ApplicationLifetimes
/// </summary>
public interface IClassicDesktopStyleApplicationLifetime : IControlledApplicationLifetime
{
/// <summary>
/// Tries to Shutdown the application. <see cref="ShutdownRequested" /> event can be used to cancel the shutdown.
/// </summary>
/// <param name="exitCode">An integer exit code for an application. The default exit code is 0.</param>
bool TryShutdown(int exitCode = 0);
/// <summary>
/// Gets the arguments passed to the
/// <see cref="ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime{T}(T, string[], ShutdownMode)"/>

2
src/Avalonia.Controls/LayoutTransformControl.cs

@ -18,7 +18,7 @@ namespace Avalonia.Controls
AvaloniaProperty.Register<LayoutTransformControl, ITransform>(nameof(LayoutTransform));
public static readonly StyledProperty<bool> UseRenderTransformProperty =
AvaloniaProperty.Register<LayoutTransformControl, bool>(nameof(LayoutTransform));
AvaloniaProperty.Register<LayoutTransformControl, bool>(nameof(UseRenderTransform));
static LayoutTransformControl()
{

2
src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs

@ -101,7 +101,7 @@ namespace Avalonia.Controls.Platform
root.Deactivated -= WindowDeactivated;
}
if (_root is TopLevel tl)
if (_root is TopLevel tl && tl.PlatformImpl != null)
tl.PlatformImpl.LostFocus -= TopLevelLostPlatformFocus;
_inputManagerSubscription?.Dispose();

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

@ -44,7 +44,7 @@ namespace Avalonia.Controls.Primitives
/// The dependency resolver to use. If null the default dependency resolver will be used.
/// </param>
public PopupRoot(TopLevel parent, IPopupImpl impl, IAvaloniaDependencyResolver dependencyResolver)
: base(impl, dependencyResolver)
: base(ValidatingPopupImpl.Wrap(impl), dependencyResolver)
{
_parent = parent;
}

9
src/Avalonia.Controls/TopLevel.cs

@ -134,6 +134,8 @@ namespace Avalonia.Controls
"Could not create window implementation: maybe no windowing subsystem was initialized?");
}
impl = ValidatingToplevelImpl.Wrap(impl);
PlatformImpl = impl;
_actualTransparencyLevel = PlatformImpl.TransparencyLevel;
@ -367,14 +369,15 @@ namespace Avalonia.Controls
Renderer?.Dispose();
Renderer = null;
(this as IInputRoot).MouseDevice?.TopLevelClosed(this);
PlatformImpl = null;
var logicalArgs = new LogicalTreeAttachmentEventArgs(this, this, null);
((ILogical)this).NotifyDetachedFromLogicalTree(logicalArgs);
var visualArgs = new VisualTreeAttachmentEventArgs(this, this);
OnDetachedFromVisualTreeCore(visualArgs);
(this as IInputRoot).MouseDevice?.TopLevelClosed(this);
PlatformImpl = null;
OnClosed(EventArgs.Empty);
LayoutManager?.Dispose();

337
src/Avalonia.Controls/ValidatingToplevel.cs

@ -0,0 +1,337 @@
using System;
using System.Collections.Generic;
using Avalonia.Controls.Platform;
using Avalonia.Controls.Primitives.PopupPositioning;
using Avalonia.Input;
using Avalonia.Input.Raw;
using Avalonia.Input.TextInput;
using Avalonia.Platform;
using Avalonia.Rendering;
namespace Avalonia.Controls;
internal class ValidatingToplevelImpl : ITopLevelImpl, ITopLevelImplWithNativeControlHost,
ITopLevelImplWithNativeMenuExporter, ITopLevelImplWithTextInputMethod
{
private readonly ITopLevelImpl _impl;
private bool _disposed;
public ValidatingToplevelImpl(ITopLevelImpl impl)
{
_impl = impl ?? throw new InvalidOperationException(
"Could not create TopLevel implementation: maybe no windowing subsystem was initialized?");
}
public void Dispose()
{
_disposed = true;
_impl.Dispose();
}
protected void CheckDisposed()
{
if (_disposed)
throw new ObjectDisposedException(_impl.GetType().FullName);
}
protected ITopLevelImpl Inner
{
get
{
CheckDisposed();
return _impl;
}
}
public static ITopLevelImpl Wrap(ITopLevelImpl impl)
{
#if DEBUG
if (impl is ValidatingToplevelImpl)
return impl;
return new ValidatingToplevelImpl(impl);
#else
return impl;
#endif
}
public Size ClientSize => Inner.ClientSize;
public Size? FrameSize => Inner.FrameSize;
public double RenderScaling => Inner.RenderScaling;
public IEnumerable<object> Surfaces => Inner.Surfaces;
public Action<RawInputEventArgs> Input
{
get => Inner.Input;
set => Inner.Input = value;
}
public Action<Rect> Paint
{
get => Inner.Paint;
set => Inner.Paint = value;
}
public Action<Size, PlatformResizeReason> Resized
{
get => Inner.Resized;
set => Inner.Resized = value;
}
public Action<double> ScalingChanged
{
get => Inner.ScalingChanged;
set => Inner.ScalingChanged = value;
}
public Action<WindowTransparencyLevel> TransparencyLevelChanged
{
get => Inner.TransparencyLevelChanged;
set => Inner.TransparencyLevelChanged = value;
}
public IRenderer CreateRenderer(IRenderRoot root) => Inner.CreateRenderer(root);
public void Invalidate(Rect rect) => Inner.Invalidate(rect);
public void SetInputRoot(IInputRoot inputRoot) => Inner.SetInputRoot(inputRoot);
public Point PointToClient(PixelPoint point) => Inner.PointToClient(point);
public PixelPoint PointToScreen(Point point) => Inner.PointToScreen(point);
public void SetCursor(ICursorImpl cursor) => Inner.SetCursor(cursor);
public Action Closed
{
get => Inner.Closed;
set => Inner.Closed = value;
}
public Action LostFocus
{
get => Inner.LostFocus;
set => Inner.LostFocus = value;
}
// Exception: for some reason we are notifying platform mouse device from TopLevel.cs
public IMouseDevice MouseDevice => _impl.MouseDevice;
public IPopupImpl CreatePopup() => Inner.CreatePopup();
public void SetTransparencyLevelHint(WindowTransparencyLevel transparencyLevel) =>
Inner.SetTransparencyLevelHint(transparencyLevel);
public WindowTransparencyLevel TransparencyLevel => Inner.TransparencyLevel;
public AcrylicPlatformCompensationLevels AcrylicCompensationLevels => Inner.AcrylicCompensationLevels;
public INativeControlHostImpl NativeControlHost => (Inner as ITopLevelImplWithNativeControlHost)?.NativeControlHost;
public ITopLevelNativeMenuExporter NativeMenuExporter =>
(Inner as ITopLevelImplWithNativeMenuExporter)?.NativeMenuExporter;
public ITextInputMethodImpl TextInputMethod => (Inner as ITopLevelImplWithTextInputMethod)?.TextInputMethod;
}
internal class ValidatingWindowBaseImpl : ValidatingToplevelImpl, IWindowBaseImpl
{
private readonly IWindowBaseImpl _impl;
public ValidatingWindowBaseImpl(IWindowBaseImpl impl) : base(impl)
{
_impl = impl;
}
protected new IWindowBaseImpl Inner
{
get
{
CheckDisposed();
return _impl;
}
}
public static IWindowBaseImpl Wrap(IWindowBaseImpl impl)
{
#if DEBUG
if (impl is ValidatingToplevelImpl)
return impl;
return new ValidatingWindowBaseImpl(impl);
#else
return impl;
#endif
}
public void Show(bool activate, bool isDialog) => Inner.Show(activate, isDialog);
public void Hide() => Inner.Hide();
public double DesktopScaling => Inner.DesktopScaling;
public PixelPoint Position => Inner.Position;
public Action<PixelPoint> PositionChanged
{
get => Inner.PositionChanged;
set => Inner.PositionChanged = value;
}
public void Activate() => Inner.Activate();
public Action Deactivated
{
get => Inner.Deactivated;
set => Inner.Deactivated = value;
}
public Action Activated
{
get => Inner.Activated;
set => Inner.Deactivated = value;
}
public IPlatformHandle Handle => Inner.Handle;
public Size MaxAutoSizeHint => Inner.MaxAutoSizeHint;
public void SetTopmost(bool value) => Inner.SetTopmost(value);
public IScreenImpl Screen => Inner.Screen;
}
internal class ValidatingWindowImpl : ValidatingWindowBaseImpl, IWindowImpl
{
private readonly IWindowImpl _impl;
public ValidatingWindowImpl(IWindowImpl impl) : base(impl)
{
_impl = impl;
}
protected new IWindowImpl Inner
{
get
{
CheckDisposed();
return _impl;
}
}
public static IWindowImpl Wrap(IWindowImpl impl)
{
#if DEBUG
if (impl is ValidatingToplevelImpl)
return impl;
return new ValidatingWindowImpl(impl);
#else
return impl;
#endif
}
public WindowState WindowState
{
get => Inner.WindowState;
set => Inner.WindowState = value;
}
public Action<WindowState> WindowStateChanged
{
get => Inner.WindowStateChanged;
set => Inner.WindowStateChanged = value;
}
public void SetTitle(string title) => Inner.SetTitle(title);
public void SetParent(IWindowImpl parent)
{
//Workaround. SetParent will cast IWindowImpl to WindowImpl but ValidatingWindowImpl isn't actual WindowImpl so it will fail with InvalidCastException.
if (parent is ValidatingWindowImpl validatingToplevelImpl)
{
Inner.SetParent(validatingToplevelImpl.Inner);
}
else
{
Inner.SetParent(parent);
}
}
public void SetEnabled(bool enable) => Inner.SetEnabled(enable);
public Action GotInputWhenDisabled
{
get => Inner.GotInputWhenDisabled;
set => Inner.GotInputWhenDisabled = value;
}
public void SetSystemDecorations(SystemDecorations enabled) => Inner.SetSystemDecorations(enabled);
public void SetIcon(IWindowIconImpl icon) => Inner.SetIcon(icon);
public void ShowTaskbarIcon(bool value) => Inner.ShowTaskbarIcon(value);
public void CanResize(bool value) => Inner.CanResize(value);
public Func<bool> Closing
{
get => Inner.Closing;
set => Inner.Closing = value;
}
public bool IsClientAreaExtendedToDecorations => Inner.IsClientAreaExtendedToDecorations;
public Action<bool> ExtendClientAreaToDecorationsChanged
{
get => Inner.ExtendClientAreaToDecorationsChanged;
set => Inner.ExtendClientAreaToDecorationsChanged = value;
}
public bool NeedsManagedDecorations => Inner.NeedsManagedDecorations;
public Thickness ExtendedMargins => Inner.ExtendedMargins;
public Thickness OffScreenMargin => Inner.OffScreenMargin;
public void BeginMoveDrag(PointerPressedEventArgs e) => Inner.BeginMoveDrag(e);
public void BeginResizeDrag(WindowEdge edge, PointerPressedEventArgs e) => Inner.BeginResizeDrag(edge, e);
public void Resize(Size clientSize, PlatformResizeReason reason) =>
Inner.Resize(clientSize, reason);
public void Move(PixelPoint point) => Inner.Move(point);
public void SetMinMaxSize(Size minSize, Size maxSize) => Inner.SetMinMaxSize(minSize, maxSize);
public void SetExtendClientAreaToDecorationsHint(bool extendIntoClientAreaHint) =>
Inner.SetExtendClientAreaToDecorationsHint(extendIntoClientAreaHint);
public void SetExtendClientAreaChromeHints(ExtendClientAreaChromeHints hints) =>
Inner.SetExtendClientAreaChromeHints(hints);
public void SetExtendClientAreaTitleBarHeightHint(double titleBarHeight) =>
Inner.SetExtendClientAreaTitleBarHeightHint(titleBarHeight);
}
internal class ValidatingPopupImpl : ValidatingWindowBaseImpl, IPopupImpl
{
private readonly IPopupImpl _impl;
public ValidatingPopupImpl(IPopupImpl impl) : base(impl)
{
_impl = impl;
}
protected new IPopupImpl Inner
{
get
{
CheckDisposed();
return _impl;
}
}
public static IPopupImpl Wrap(IPopupImpl impl)
{
#if DEBUG
if (impl is ValidatingToplevelImpl)
return impl;
return new ValidatingPopupImpl(impl);
#else
return impl;
#endif
}
public IPopupPositioner PopupPositioner => Inner.PopupPositioner;
public void SetWindowManagerAddShadowHint(bool enabled) => Inner.SetWindowManagerAddShadowHint(enabled);
}

11
src/Avalonia.Controls/Window.cs

@ -237,13 +237,14 @@ namespace Avalonia.Controls
/// </summary>
/// <param name="impl">The window implementation.</param>
public Window(IWindowImpl impl)
: base(impl)
: base(ValidatingWindowImpl.Wrap(impl))
{
impl.Closing = HandleClosing;
impl.GotInputWhenDisabled = OnGotInputWhenDisabled;
impl.WindowStateChanged = HandleWindowStateChanged;
var wrapped = (IWindowImpl)base.PlatformImpl!;
wrapped.Closing = HandleClosing;
wrapped.GotInputWhenDisabled = OnGotInputWhenDisabled;
wrapped.WindowStateChanged = HandleWindowStateChanged;
_maxPlatformClientSize = PlatformImpl?.MaxAutoSizeHint ?? default(Size);
impl.ExtendClientAreaToDecorationsChanged = ExtendClientAreaToDecorationsChanged;
wrapped.ExtendClientAreaToDecorationsChanged = ExtendClientAreaToDecorationsChanged;
this.GetObservable(ClientSizeProperty).Skip(1).Subscribe(x => PlatformImpl?.Resize(x, PlatformResizeReason.Application));
PlatformImpl?.ShowTaskbarIcon(ShowInTaskbar);

9
src/Avalonia.Controls/WindowBase.cs

@ -57,12 +57,13 @@ namespace Avalonia.Controls
{
}
public WindowBase(IWindowBaseImpl impl, IAvaloniaDependencyResolver dependencyResolver) : base(impl, dependencyResolver)
public WindowBase(IWindowBaseImpl impl, IAvaloniaDependencyResolver dependencyResolver) : base(ValidatingWindowBaseImpl.Wrap(impl), dependencyResolver)
{
Screens = new Screens(PlatformImpl?.Screen);
impl.Activated = HandleActivated;
impl.Deactivated = HandleDeactivated;
impl.PositionChanged = HandlePositionChanged;
var wrapped = PlatformImpl!;
wrapped.Activated = HandleActivated;
wrapped.Deactivated = HandleDeactivated;
wrapped.PositionChanged = HandlePositionChanged;
}
/// <summary>

4
src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml

@ -2,6 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:views="clr-namespace:Avalonia.Diagnostics.Views"
xmlns:diag="clr-namespace:Avalonia.Diagnostics"
xmlns:default="using:Avalonia.Themes.Default"
Title="Avalonia DevTools"
x:Class="Avalonia.Diagnostics.Views.MainWindow">
<Window.DataTemplates>
@ -9,8 +10,7 @@
</Window.DataTemplates>
<Window.Styles>
<StyleInclude Source="resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default"/>
<default:SimpleTheme Mode="Light"/>
<StyleInclude Source="resm:Avalonia.Controls.DataGrid.Themes.Default.xaml?assembly=Avalonia.Controls.DataGrid"/>
<Style Selector="DataGrid ContextMenu">
<Setter Property="Foreground" Value="Black"/>

8
src/Avalonia.Native/AvaloniaNativeMenuExporter.cs

@ -133,9 +133,13 @@ namespace Avalonia.Native
var quitItem = new NativeMenuItem("Quit") { Gesture = new KeyGesture(Key.Q, KeyModifiers.Meta) };
quitItem.Click += (_, _) =>
{
if (Application.Current is { ApplicationLifetime: IControlledApplicationLifetime lifetime })
if (Application.Current is { ApplicationLifetime: IClassicDesktopStyleApplicationLifetime lifetime })
{
lifetime.Shutdown();
lifetime.TryShutdown();
}
else if(Application.Current is {ApplicationLifetime: IControlledApplicationLifetime controlledLifetime})
{
controlledLifetime.Shutdown();
}
};

64
src/Avalonia.Themes.Default/Accents/Base.xaml

@ -0,0 +1,64 @@
<Style
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard">
<Style.Resources>
<Color x:Key="ThemeAccentColor">#CC119EDA</Color>
<Color x:Key="ThemeAccentColor2">#99119EDA</Color>
<Color x:Key="ThemeAccentColor3">#66119EDA</Color>
<Color x:Key="ThemeAccentColor4">#33119EDA</Color>
<Color x:Key="ThemeForegroundLowColor">#FF808080</Color>
<Color x:Key="HighlightForegroundColor">#FFFFFFFF</Color>
<Color x:Key="ErrorColor">#FFFF0000</Color>
<Color x:Key="ErrorLowColor">#10FF0000</Color>
<SolidColorBrush x:Key="HighlightForegroundBrush" Color="{StaticResource HighlightForegroundColor}" />
<SolidColorBrush x:Key="ThemeForegroundLowBrush" Color="{StaticResource ThemeForegroundLowColor}" />
<SolidColorBrush x:Key="ThemeAccentBrush2" Color="{StaticResource ThemeAccentColor2}" />
<SolidColorBrush x:Key="ThemeAccentBrush3" Color="{StaticResource ThemeAccentColor3}" />
<SolidColorBrush x:Key="ThemeAccentBrush4" Color="{StaticResource ThemeAccentColor4}" />
<SolidColorBrush x:Key="ThemeAccentBrush" Color="{StaticResource ThemeAccentColor}" />
<SolidColorBrush x:Key="ErrorBrush" Color="{StaticResource ErrorColor}" />
<SolidColorBrush x:Key="ErrorLowBrush" Color="{StaticResource ErrorLowColor}" />
<SolidColorBrush
x:Key="NotificationCardBackgroundBrush"
Opacity="0.75"
Color="#444444" />
<SolidColorBrush
x:Key="NotificationCardInformationBackgroundBrush"
Opacity="0.75"
Color="#007ACC" />
<SolidColorBrush
x:Key="NotificationCardSuccessBackgroundBrush"
Opacity="0.75"
Color="#1F9E45" />
<SolidColorBrush
x:Key="NotificationCardWarningBackgroundBrush"
Opacity="0.75"
Color="#FDB328" />
<SolidColorBrush
x:Key="NotificationCardErrorBackgroundBrush"
Opacity="0.75"
Color="#BD202C" />
<SolidColorBrush x:Key="ThemeControlTransparentBrush" Color="Transparent" />
<SolidColorBrush
x:Key="DatePickerFlyoutPresenterHighlightFill"
Opacity="0.4"
Color="{StaticResource ThemeAccentColor}" />
<SolidColorBrush
x:Key="TimePickerFlyoutPresenterHighlightFill"
Opacity="0.4"
Color="{StaticResource ThemeAccentColor}" />
<Thickness x:Key="ThemeBorderThickness">1</Thickness>
<sys:Double x:Key="ThemeDisabledOpacity">0.5</sys:Double>
<sys:Double x:Key="FontSizeSmall">10</sys:Double>
<sys:Double x:Key="FontSizeNormal">12</sys:Double>
<sys:Double x:Key="FontSizeLarge">16</sys:Double>
<sys:Double x:Key="ScrollBarThickness">18</sys:Double>
<sys:Double x:Key="ScrollBarThumbThickness">8</sys:Double>
<sys:Double x:Key="IconElementThemeHeight">20</sys:Double>
<sys:Double x:Key="IconElementThemeWidth">20</sys:Double>
</Style.Resources>
</Style>

77
src/Avalonia.Themes.Default/Accents/BaseDark.xaml

@ -1,13 +1,9 @@
<Style xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard">
<Style
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard">
<Style.Resources>
<Color x:Key="ThemeAccentColor">#CC119EDA</Color>
<Color x:Key="ThemeAccentColor2">#99119EDA</Color>
<Color x:Key="ThemeAccentColor3">#66119EDA</Color>
<Color x:Key="ThemeAccentColor4">#33119EDA</Color>
<Color x:Key="ThemeBackgroundColor">#FF282828</Color>
<Color x:Key="ThemeBorderLowColor">#FF505050</Color>
<Color x:Key="ThemeBorderMidColor">#FF808080</Color>
@ -21,59 +17,22 @@
<Color x:Key="ThemeControlHighlightMidColor">#FF828282</Color>
<Color x:Key="ThemeControlHighlightHighColor">#FF505050</Color>
<Color x:Key="ThemeForegroundColor">#FFDEDEDE</Color>
<Color x:Key="ThemeForegroundLowColor">#FF808080</Color>
<Color x:Key="HighlightColor">#FF119EDA</Color>
<Color x:Key="HighlightForegroundColor">#FFFFFFFF</Color>
<Color x:Key="ErrorColor">#FFFF0000</Color>
<Color x:Key="ErrorLowColor">#10FF0000</Color>
<SolidColorBrush x:Key="ThemeBackgroundBrush" Color="{DynamicResource ThemeBackgroundColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeBorderLowBrush" Color="{DynamicResource ThemeBorderLowColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeBorderMidBrush" Color="{DynamicResource ThemeBorderMidColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeBorderHighBrush" Color="{DynamicResource ThemeBorderHighColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlLowBrush" Color="{DynamicResource ThemeControlLowColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlMidBrush" Color="{DynamicResource ThemeControlMidColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlMidHighBrush" Color="{DynamicResource ThemeControlMidHighColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlHighBrush" Color="{DynamicResource ThemeControlHighColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlVeryHighBrush" Color="{DynamicResource ThemeControlVeryHighColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlHighlightLowBrush" Color="{DynamicResource ThemeControlHighlightLowColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlHighlightMidBrush" Color="{DynamicResource ThemeControlHighlightMidColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlHighlightHighBrush" Color="{DynamicResource ThemeControlHighlightHighColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeForegroundBrush" Color="{DynamicResource ThemeForegroundColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeForegroundLowBrush" Color="{DynamicResource ThemeForegroundLowColor}"></SolidColorBrush>
<SolidColorBrush x:Key="HighlightBrush" Color="{DynamicResource HighlightColor}"></SolidColorBrush>
<SolidColorBrush x:Key="HighlightForegroundBrush" Color="{DynamicResource HighlightForegroundColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeAccentBrush" Color="{DynamicResource ThemeAccentColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeAccentBrush2" Color="{DynamicResource ThemeAccentColor2}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeAccentBrush3" Color="{DynamicResource ThemeAccentColor3}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeAccentBrush4" Color="{DynamicResource ThemeAccentColor4}"></SolidColorBrush>
<SolidColorBrush x:Key="ErrorBrush" Color="{DynamicResource ErrorColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ErrorLowBrush" Color="{DynamicResource ErrorLowColor}"></SolidColorBrush>
<SolidColorBrush x:Key="NotificationCardBackgroundBrush" Color="#444444" Opacity="0.75"/>
<SolidColorBrush x:Key="NotificationCardInformationBackgroundBrush" Color="#007ACC" Opacity="0.75"/>
<SolidColorBrush x:Key="NotificationCardSuccessBackgroundBrush" Color="#1F9E45" Opacity="0.75"/>
<SolidColorBrush x:Key="NotificationCardWarningBackgroundBrush" Color="#FDB328" Opacity="0.75"/>
<SolidColorBrush x:Key="NotificationCardErrorBackgroundBrush" Color="#BD202C" Opacity="0.75"/>
<SolidColorBrush x:Key="DatePickerFlyoutPresenterHighlightFill" Color="{DynamicResource ThemeAccentColor}" Opacity="0.4" />
<SolidColorBrush x:Key="TimePickerFlyoutPresenterHighlightFill" Color="{DynamicResource ThemeAccentColor}" Opacity="0.4" />
<SolidColorBrush x:Key="ThemeControlTransparentBrush" Color="Transparent" />
<Thickness x:Key="ThemeBorderThickness">1,1,1,1</Thickness>
<sys:Double x:Key="ThemeDisabledOpacity">0.5</sys:Double>
<sys:Double x:Key="FontSizeSmall">10</sys:Double>
<sys:Double x:Key="FontSizeNormal">12</sys:Double>
<sys:Double x:Key="FontSizeLarge">16</sys:Double>
<sys:Double x:Key="ScrollBarThickness">18</sys:Double>
<sys:Double x:Key="ScrollBarThumbThickness">8</sys:Double>
<SolidColorBrush x:Key="ThemeBackgroundBrush" Color="{StaticResource ThemeBackgroundColor}" />
<SolidColorBrush x:Key="ThemeBorderLowBrush" Color="{StaticResource ThemeBorderLowColor}" />
<SolidColorBrush x:Key="ThemeBorderMidBrush" Color="{StaticResource ThemeBorderMidColor}" />
<SolidColorBrush x:Key="ThemeBorderHighBrush" Color="{StaticResource ThemeBorderHighColor}" />
<SolidColorBrush x:Key="ThemeControlLowBrush" Color="{StaticResource ThemeControlLowColor}" />
<SolidColorBrush x:Key="ThemeControlMidBrush" Color="{StaticResource ThemeControlMidColor}" />
<SolidColorBrush x:Key="ThemeControlMidHighBrush" Color="{StaticResource ThemeControlMidHighColor}" />
<SolidColorBrush x:Key="ThemeControlHighBrush" Color="{StaticResource ThemeControlHighColor}" />
<SolidColorBrush x:Key="ThemeControlVeryHighBrush" Color="{StaticResource ThemeControlVeryHighColor}" />
<SolidColorBrush x:Key="ThemeControlHighlightLowBrush" Color="{StaticResource ThemeControlHighlightLowColor}" />
<SolidColorBrush x:Key="ThemeControlHighlightMidBrush" Color="{StaticResource ThemeControlHighlightMidColor}" />
<SolidColorBrush x:Key="ThemeControlHighlightHighBrush" Color="{StaticResource ThemeControlHighlightHighColor}" />
<SolidColorBrush x:Key="ThemeForegroundBrush" Color="{StaticResource ThemeForegroundColor}" />
<SolidColorBrush x:Key="HighlightBrush" Color="{StaticResource HighlightColor}" />
<sys:Double x:Key="IconElementThemeHeight">20</sys:Double>
<sys:Double x:Key="IconElementThemeWidth">20</sys:Double>
</Style.Resources>
</Style>

82
src/Avalonia.Themes.Default/Accents/BaseLight.xaml

@ -1,82 +1,38 @@
<Style xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard">
<Style
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard">
<Style.Resources>
<Color x:Key="ThemeAccentColor">#CC119EDA</Color>
<Color x:Key="ThemeAccentColor2">#99119EDA</Color>
<Color x:Key="ThemeAccentColor3">#66119EDA</Color>
<Color x:Key="ThemeAccentColor4">#33119EDA</Color>
<Color x:Key="ThemeBackgroundColor">#FFFFFFFF</Color>
<Color x:Key="ThemeBorderLowColor">#FFAAAAAA</Color>
<Color x:Key="ThemeBorderMidColor">#FF888888</Color>
<Color x:Key="ThemeBorderHighColor">#FF333333</Color>
<Color x:Key="ThemeControlLowColor">#FF868999</Color>
<Color x:Key="ThemeControlMidColor">#FFF5F5F5</Color>
<Color x:Key="ThemeControlMidHighColor">#FFC2C3C9</Color>
<Color x:Key="ThemeControlHighColor">#FF686868</Color>
<Color x:Key="ThemeControlVeryHighColor">#FF5B5B5B</Color>
<Color x:Key="ThemeControlHighlightLowColor">#FFF0F0F0</Color>
<Color x:Key="ThemeControlHighlightMidColor">#FFD0D0D0</Color>
<Color x:Key="ThemeControlHighlightHighColor">#FF808080</Color>
<Color x:Key="ThemeForegroundColor">#FF000000</Color>
<Color x:Key="ThemeForegroundLowColor">#FF808080</Color>
<Color x:Key="HighlightColor">#FF086F9E</Color>
<Color x:Key="HighlightForegroundColor">#FFFFFFFF</Color>
<Color x:Key="ErrorColor">#FFFF0000</Color>
<Color x:Key="ErrorLowColor">#10FF0000</Color>
<SolidColorBrush x:Key="ThemeBackgroundBrush" Color="{DynamicResource ThemeBackgroundColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeBorderLowBrush" Color="{DynamicResource ThemeBorderLowColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeBorderMidBrush" Color="{DynamicResource ThemeBorderMidColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeBorderHighBrush" Color="{DynamicResource ThemeBorderHighColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlLowBrush" Color="{DynamicResource ThemeControlLowColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlMidBrush" Color="{DynamicResource ThemeControlMidColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlMidHighBrush" Color="{DynamicResource ThemeControlMidHighColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlHighBrush" Color="{DynamicResource ThemeControlHighColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlVeryHighBrush" Color="{DynamicResource ThemeControlVeryHighColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlHighlightLowBrush" Color="{DynamicResource ThemeControlHighlightLowColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlHighlightMidBrush" Color="{DynamicResource ThemeControlHighlightMidColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeControlHighlightHighBrush" Color="{DynamicResource ThemeControlHighlightHighColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeForegroundBrush" Color="{DynamicResource ThemeForegroundColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeForegroundLowBrush" Color="{DynamicResource ThemeForegroundLowColor}"></SolidColorBrush>
<SolidColorBrush x:Key="HighlightBrush" Color="{DynamicResource HighlightColor}"></SolidColorBrush>
<SolidColorBrush x:Key="HighlightForegroundBrush" Color="{DynamicResource HighlightForegroundColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeAccentBrush" Color="{DynamicResource ThemeAccentColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeAccentBrush2" Color="{DynamicResource ThemeAccentColor2}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeAccentBrush3" Color="{DynamicResource ThemeAccentColor3}"></SolidColorBrush>
<SolidColorBrush x:Key="ThemeAccentBrush4" Color="{DynamicResource ThemeAccentColor4}"></SolidColorBrush>
<SolidColorBrush x:Key="ErrorBrush" Color="{DynamicResource ErrorColor}"></SolidColorBrush>
<SolidColorBrush x:Key="ErrorLowBrush" Color="{DynamicResource ErrorLowColor}"></SolidColorBrush>
<SolidColorBrush x:Key="NotificationCardBackgroundBrush" Color="#444444" Opacity="0.75"/>
<SolidColorBrush x:Key="NotificationCardInformationBackgroundBrush" Color="#007ACC" Opacity="0.75"/>
<SolidColorBrush x:Key="NotificationCardSuccessBackgroundBrush" Color="#1F9E45" Opacity="0.75"/>
<SolidColorBrush x:Key="NotificationCardWarningBackgroundBrush" Color="#FDB328" Opacity="0.75"/>
<SolidColorBrush x:Key="NotificationCardErrorBackgroundBrush" Color="#BD202C" Opacity="0.75"/>
<SolidColorBrush x:Key="DatePickerFlyoutPresenterHighlightFill" Color="{DynamicResource ThemeAccentColor}" Opacity="0.4" />
<SolidColorBrush x:Key="TimePickerFlyoutPresenterHighlightFill" Color="{DynamicResource ThemeAccentColor}" Opacity="0.4" />
<SolidColorBrush x:Key="ThemeControlTransparentBrush" Color="Transparent" />
<Thickness x:Key="ThemeBorderThickness">1</Thickness>
<sys:Double x:Key="ThemeDisabledOpacity">0.5</sys:Double>
<sys:Double x:Key="FontSizeSmall">10</sys:Double>
<sys:Double x:Key="FontSizeNormal">12</sys:Double>
<sys:Double x:Key="FontSizeLarge">16</sys:Double>
<sys:Double x:Key="ScrollBarThickness">18</sys:Double>
<sys:Double x:Key="ScrollBarThumbThickness">8</sys:Double>
<sys:Double x:Key="IconElementThemeHeight">20</sys:Double>
<sys:Double x:Key="IconElementThemeWidth">20</sys:Double>
<SolidColorBrush x:Key="ThemeBackgroundBrush" Color="{StaticResource ThemeBackgroundColor}" />
<SolidColorBrush x:Key="ThemeBorderLowBrush" Color="{StaticResource ThemeBorderLowColor}" />
<SolidColorBrush x:Key="ThemeBorderMidBrush" Color="{StaticResource ThemeBorderMidColor}" />
<SolidColorBrush x:Key="ThemeBorderHighBrush" Color="{StaticResource ThemeBorderHighColor}" />
<SolidColorBrush x:Key="ThemeControlLowBrush" Color="{StaticResource ThemeControlLowColor}" />
<SolidColorBrush x:Key="ThemeControlMidBrush" Color="{StaticResource ThemeControlMidColor}" />
<SolidColorBrush x:Key="ThemeControlMidHighBrush" Color="{StaticResource ThemeControlMidHighColor}" />
<SolidColorBrush x:Key="ThemeControlHighBrush" Color="{StaticResource ThemeControlHighColor}" />
<SolidColorBrush x:Key="ThemeControlVeryHighBrush" Color="{StaticResource ThemeControlVeryHighColor}" />
<SolidColorBrush x:Key="ThemeControlHighlightLowBrush" Color="{StaticResource ThemeControlHighlightLowColor}" />
<SolidColorBrush x:Key="ThemeControlHighlightMidBrush" Color="{StaticResource ThemeControlHighlightMidColor}" />
<SolidColorBrush x:Key="ThemeControlHighlightHighBrush" Color="{StaticResource ThemeControlHighlightHighColor}" />
<SolidColorBrush x:Key="ThemeForegroundBrush" Color="{StaticResource ThemeForegroundColor}" />
<SolidColorBrush x:Key="HighlightBrush" Color="{StaticResource HighlightColor}" />
</Style.Resources>
</Style>

5
src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj

@ -13,10 +13,7 @@
<ProjectReference Include="..\Avalonia.Visuals\Avalonia.Visuals.csproj" />
<ProjectReference Include="..\Avalonia.Styling\Avalonia.Styling.csproj" />
<ProjectReference Include="..\Avalonia.Dialogs\Avalonia.Dialogs.csproj" />
<AvaloniaResource Include="DefaultTheme.xaml" />
<AvaloniaResource Include="Accents/*.xaml" />
<!-- Compatibility with old apps, probably need to replace with AvaloniaResource -->
<EmbeddedResource Include="**/*.xaml" />
<AvaloniaResource Include="**/*.xaml" />
</ItemGroup>
<Import Project="..\..\build\BuildTargets.targets" />
<Import Project="..\..\build\Rx.props" />

0
src/Avalonia.Themes.Default/AutoCompleteBox.xaml → src/Avalonia.Themes.Default/Controls/AutoCompleteBox.xaml

0
src/Avalonia.Themes.Default/Button.xaml → src/Avalonia.Themes.Default/Controls/Button.xaml

0
src/Avalonia.Themes.Default/ButtonSpinner.xaml → src/Avalonia.Themes.Default/Controls/ButtonSpinner.xaml

0
src/Avalonia.Themes.Default/Calendar.xaml → src/Avalonia.Themes.Default/Controls/Calendar.xaml

0
src/Avalonia.Themes.Default/CalendarButton.xaml → src/Avalonia.Themes.Default/Controls/CalendarButton.xaml

0
src/Avalonia.Themes.Default/CalendarDatePicker.xaml → src/Avalonia.Themes.Default/Controls/CalendarDatePicker.xaml

0
src/Avalonia.Themes.Default/CalendarDayButton.xaml → src/Avalonia.Themes.Default/Controls/CalendarDayButton.xaml

0
src/Avalonia.Themes.Default/CalendarItem.xaml → src/Avalonia.Themes.Default/Controls/CalendarItem.xaml

0
src/Avalonia.Themes.Default/CaptionButtons.xaml → src/Avalonia.Themes.Default/Controls/CaptionButtons.xaml

0
src/Avalonia.Themes.Default/Carousel.xaml → src/Avalonia.Themes.Default/Controls/Carousel.xaml

0
src/Avalonia.Themes.Default/CheckBox.xaml → src/Avalonia.Themes.Default/Controls/CheckBox.xaml

0
src/Avalonia.Themes.Default/ComboBox.xaml → src/Avalonia.Themes.Default/Controls/ComboBox.xaml

0
src/Avalonia.Themes.Default/ComboBoxItem.xaml → src/Avalonia.Themes.Default/Controls/ComboBoxItem.xaml

0
src/Avalonia.Themes.Default/ContentControl.xaml → src/Avalonia.Themes.Default/Controls/ContentControl.xaml

0
src/Avalonia.Themes.Default/ContextMenu.xaml → src/Avalonia.Themes.Default/Controls/ContextMenu.xaml

0
src/Avalonia.Themes.Default/DataValidationErrors.xaml → src/Avalonia.Themes.Default/Controls/DataValidationErrors.xaml

0
src/Avalonia.Themes.Default/DatePicker.xaml → src/Avalonia.Themes.Default/Controls/DatePicker.xaml

0
src/Avalonia.Themes.Default/EmbeddableControlRoot.xaml → src/Avalonia.Themes.Default/Controls/EmbeddableControlRoot.xaml

0
src/Avalonia.Themes.Default/Expander.xaml → src/Avalonia.Themes.Default/Controls/Expander.xaml

0
src/Avalonia.Themes.Default/FlyoutPresenter.xaml → src/Avalonia.Themes.Default/Controls/FlyoutPresenter.xaml

0
src/Avalonia.Themes.Default/FocusAdorner.xaml → src/Avalonia.Themes.Default/Controls/FocusAdorner.xaml

0
src/Avalonia.Themes.Default/GridSplitter.xaml → src/Avalonia.Themes.Default/Controls/GridSplitter.xaml

0
src/Avalonia.Themes.Default/ItemsControl.xaml → src/Avalonia.Themes.Default/Controls/ItemsControl.xaml

0
src/Avalonia.Themes.Default/Label.xaml → src/Avalonia.Themes.Default/Controls/Label.xaml

0
src/Avalonia.Themes.Default/ListBox.xaml → src/Avalonia.Themes.Default/Controls/ListBox.xaml

0
src/Avalonia.Themes.Default/ListBoxItem.xaml → src/Avalonia.Themes.Default/Controls/ListBoxItem.xaml

0
src/Avalonia.Themes.Default/ManagedFileChooser.xaml → src/Avalonia.Themes.Default/Controls/ManagedFileChooser.xaml

0
src/Avalonia.Themes.Default/Menu.xaml → src/Avalonia.Themes.Default/Controls/Menu.xaml

0
src/Avalonia.Themes.Default/MenuFlyoutPresenter.xaml → src/Avalonia.Themes.Default/Controls/MenuFlyoutPresenter.xaml

0
src/Avalonia.Themes.Default/MenuItem.xaml → src/Avalonia.Themes.Default/Controls/MenuItem.xaml

0
src/Avalonia.Themes.Default/NativeMenuBar.xaml → src/Avalonia.Themes.Default/Controls/NativeMenuBar.xaml

0
src/Avalonia.Themes.Default/NotificationCard.xaml → src/Avalonia.Themes.Default/Controls/NotificationCard.xaml

0
src/Avalonia.Themes.Default/NumericUpDown.xaml → src/Avalonia.Themes.Default/Controls/NumericUpDown.xaml

0
src/Avalonia.Themes.Default/OverlayPopupHost.xaml → src/Avalonia.Themes.Default/Controls/OverlayPopupHost.xaml

0
src/Avalonia.Themes.Default/PathIcon.xaml → src/Avalonia.Themes.Default/Controls/PathIcon.xaml

0
src/Avalonia.Themes.Default/PopupRoot.xaml → src/Avalonia.Themes.Default/Controls/PopupRoot.xaml

0
src/Avalonia.Themes.Default/ProgressBar.xaml → src/Avalonia.Themes.Default/Controls/ProgressBar.xaml

0
src/Avalonia.Themes.Default/RadioButton.xaml → src/Avalonia.Themes.Default/Controls/RadioButton.xaml

0
src/Avalonia.Themes.Default/RepeatButton.xaml → src/Avalonia.Themes.Default/Controls/RepeatButton.xaml

0
src/Avalonia.Themes.Default/ScrollBar.xaml → src/Avalonia.Themes.Default/Controls/ScrollBar.xaml

0
src/Avalonia.Themes.Default/ScrollViewer.xaml → src/Avalonia.Themes.Default/Controls/ScrollViewer.xaml

0
src/Avalonia.Themes.Default/Separator.xaml → src/Avalonia.Themes.Default/Controls/Separator.xaml

0
src/Avalonia.Themes.Default/Slider.xaml → src/Avalonia.Themes.Default/Controls/Slider.xaml

0
src/Avalonia.Themes.Default/SplitView.xaml → src/Avalonia.Themes.Default/Controls/SplitView.xaml

0
src/Avalonia.Themes.Default/TabControl.xaml → src/Avalonia.Themes.Default/Controls/TabControl.xaml

0
src/Avalonia.Themes.Default/TabItem.xaml → src/Avalonia.Themes.Default/Controls/TabItem.xaml

0
src/Avalonia.Themes.Default/TabStrip.xaml → src/Avalonia.Themes.Default/Controls/TabStrip.xaml

0
src/Avalonia.Themes.Default/TabStripItem.xaml → src/Avalonia.Themes.Default/Controls/TabStripItem.xaml

0
src/Avalonia.Themes.Default/TextBox.xaml → src/Avalonia.Themes.Default/Controls/TextBox.xaml

0
src/Avalonia.Themes.Default/TimePicker.xaml → src/Avalonia.Themes.Default/Controls/TimePicker.xaml

0
src/Avalonia.Themes.Default/TitleBar.xaml → src/Avalonia.Themes.Default/Controls/TitleBar.xaml

0
src/Avalonia.Themes.Default/ToggleButton.xaml → src/Avalonia.Themes.Default/Controls/ToggleButton.xaml

0
src/Avalonia.Themes.Default/ToggleSwitch.xaml → src/Avalonia.Themes.Default/Controls/ToggleSwitch.xaml

0
src/Avalonia.Themes.Default/ToolTip.xaml → src/Avalonia.Themes.Default/Controls/ToolTip.xaml

0
src/Avalonia.Themes.Default/TreeView.xaml → src/Avalonia.Themes.Default/Controls/TreeView.xaml

0
src/Avalonia.Themes.Default/TreeViewItem.xaml → src/Avalonia.Themes.Default/Controls/TreeViewItem.xaml

0
src/Avalonia.Themes.Default/UserControl.xaml → src/Avalonia.Themes.Default/Controls/UserControl.xaml

0
src/Avalonia.Themes.Default/Window.xaml → src/Avalonia.Themes.Default/Controls/Window.xaml

0
src/Avalonia.Themes.Default/WindowNotificationManager.xaml → src/Avalonia.Themes.Default/Controls/WindowNotificationManager.xaml

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

@ -2,65 +2,65 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Avalonia.Themes.Default.DefaultTheme">
<!-- Define ToolTip first so its styles can be overriden by other controls (e.g. TextBox) -->
<StyleInclude Source="resm:Avalonia.Themes.Default.ToolTip.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.DataValidationErrors.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ToolTip.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/DataValidationErrors.xaml"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.FocusAdorner.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.Button.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.Carousel.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.CheckBox.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.CaptionButtons.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ComboBox.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ComboBoxItem.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ContentControl.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.Label.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.GridSplitter.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ItemsControl.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ListBox.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ListBoxItem.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.Menu.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ContextMenu.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.MenuItem.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.OverlayPopupHost.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.PathIcon.xaml?assembly=Avalonia.Themes.Default" />
<StyleInclude Source="resm:Avalonia.Themes.Default.PopupRoot.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ProgressBar.xaml?assembly=Avalonia.Themes.Default"/>
<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.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"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.TabStripItem.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/FocusAdorner.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/Button.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/Carousel.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/CheckBox.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/CaptionButtons.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ComboBox.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ComboBoxItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ContentControl.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/Label.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/GridSplitter.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ItemsControl.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ListBox.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ListBoxItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/Menu.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ContextMenu.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/MenuItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/OverlayPopupHost.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/PathIcon.xaml" />
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/PopupRoot.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ProgressBar.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/RadioButton.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/RepeatButton.xaml" />
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/Separator.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/Slider.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ScrollBar.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ScrollViewer.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/TabStrip.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/TabStripItem.xaml"/>
<!-- TabControl needs to come after TabStrip as it redefines the inner TabStrip.ItemsPanel-->
<StyleInclude Source="resm:Avalonia.Themes.Default.TabControl.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.TabItem.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.TextBox.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ToggleButton.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.Expander.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.TitleBar.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.TreeView.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.TreeViewItem.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.UserControl.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.Window.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.EmbeddableControlRoot.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.CalendarButton.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.CalendarDayButton.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.CalendarItem.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.Calendar.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.CalendarDatePicker.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"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.WindowNotificationManager.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.NotificationCard.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.NativeMenuBar.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ToggleSwitch.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.SplitView.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.DatePicker.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.TimePicker.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.FlyoutPresenter.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.MenuFlyoutPresenter.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="resm:Avalonia.Themes.Default.ManagedFileChooser.xaml?assembly=Avalonia.Themes.Default"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/TabControl.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/TabItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/TextBox.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ToggleButton.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/Expander.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/TitleBar.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/TreeView.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/TreeViewItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/UserControl.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/Window.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/EmbeddableControlRoot.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/CalendarButton.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/CalendarDayButton.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/CalendarItem.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/Calendar.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/CalendarDatePicker.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ButtonSpinner.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/NumericUpDown.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/AutoCompleteBox.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/WindowNotificationManager.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/NotificationCard.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/NativeMenuBar.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ToggleSwitch.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/SplitView.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/DatePicker.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/TimePicker.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/FlyoutPresenter.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/MenuFlyoutPresenter.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Default/Controls/ManagedFileChooser.xaml"/>
</Styles>

1
src/Avalonia.Themes.Default/DefaultTheme.xaml.cs

@ -1,4 +1,3 @@
using Avalonia.Markup.Xaml;
using Avalonia.Styling;
namespace Avalonia.Themes.Default

166
src/Avalonia.Themes.Default/SimpleTheme.cs

@ -0,0 +1,166 @@
using System;
using System.Collections.Generic;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Markup.Xaml.Styling;
using Avalonia.Styling;
#nullable enable
namespace Avalonia.Themes.Default
{
public class SimpleTheme : AvaloniaObject, IStyle, IResourceProvider
{
public static readonly StyledProperty<SimpleThemeMode> ModeProperty =
AvaloniaProperty.Register<SimpleTheme, SimpleThemeMode>(nameof(Mode));
private readonly Uri _baseUri;
private bool _isLoading;
private IStyle? _loaded;
private Styles _sharedStyles = new();
private Styles _simpleDark = new();
private Styles _simpleLight = new();
/// <summary>
/// Initializes a new instance of the <see cref="SimpleTheme"/> class.
/// </summary>
/// <param name="baseUri">The base URL for the XAML context.</param>
public SimpleTheme(Uri baseUri)
{
_baseUri = baseUri;
InitStyles(_baseUri);
}
/// <summary>
/// Initializes a new instance of the <see cref="SimpleTheme"/> class.
/// </summary>
/// <param name="serviceProvider">The XAML service provider.</param>
public SimpleTheme(IServiceProvider serviceProvider)
{
var service = serviceProvider.GetService(typeof(IUriContext));
if (service == null)
{
throw new Exception("There is no service object of type IUriContext!");
}
_baseUri = ((IUriContext)service).BaseUri;
InitStyles(_baseUri);
}
public event EventHandler OwnerChanged
{
add
{
if (Loaded is IResourceProvider rp)
{
rp.OwnerChanged += value;
}
}
remove
{
if (Loaded is IResourceProvider rp)
{
rp.OwnerChanged -= value;
}
}
}
IReadOnlyList<IStyle> IStyle.Children => _loaded?.Children ?? Array.Empty<IStyle>();
bool IResourceNode.HasResources => (Loaded as IResourceProvider)?.HasResources ?? false;
public IStyle Loaded
{
get
{
if (_loaded == null)
{
_isLoading = true;
if (Mode == SimpleThemeMode.Light)
{
_loaded = new Styles { _sharedStyles, _simpleLight };
}
else if (Mode == SimpleThemeMode.Dark)
{
_loaded = new Styles { _sharedStyles, _simpleDark };
}
_isLoading = false;
}
return _loaded!;
}
}
/// <summary>
/// Gets or sets the mode of the fluent theme (light, dark).
/// </summary>
public SimpleThemeMode Mode
{
get => GetValue(ModeProperty);
set => SetValue(ModeProperty, value);
}
public IResourceHost? Owner => (Loaded as IResourceProvider)?.Owner;
void IResourceProvider.AddOwner(IResourceHost owner) => (Loaded as IResourceProvider)?.AddOwner(owner);
void IResourceProvider.RemoveOwner(IResourceHost owner) => (Loaded as IResourceProvider)?.RemoveOwner(owner);
public SelectorMatchResult TryAttach(IStyleable target, IStyleHost? host) => Loaded.TryAttach(target, host);
public bool TryGetResource(object key, out object? value)
{
if (!_isLoading && Loaded is IResourceProvider p)
{
return p.TryGetResource(key, out value);
}
value = null;
return false;
}
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change)
{
base.OnPropertyChanged(change);
if (change.Property == ModeProperty)
{
if (Mode == SimpleThemeMode.Dark)
{
(Loaded as Styles)![1] = _simpleDark[0];
}
else
{
(Loaded as Styles)![1] = _simpleLight[0];
}
}
}
private void InitStyles(Uri baseUri)
{
_sharedStyles = new Styles
{
new StyleInclude(baseUri)
{
Source = new Uri("avares://Avalonia.Themes.Default/DefaultTheme.xaml")
},
new StyleInclude(baseUri)
{
Source = new Uri("avares://Avalonia.Themes.Default/Accents/Base.xaml")
}
};
_simpleLight = new Styles
{
new StyleInclude(baseUri)
{
Source = new Uri("avares://Avalonia.Themes.Default/Accents/BaseLight.xaml")
}
};
_simpleDark = new Styles
{
new StyleInclude(baseUri)
{
Source = new Uri("avares://Avalonia.Themes.Default/Accents/BaseDark.xaml")
}
};
}
}
}

8
src/Avalonia.Themes.Default/SimpleThemeMode.cs

@ -0,0 +1,8 @@
namespace Avalonia.Themes.Default
{
public enum SimpleThemeMode
{
Light,
Dark
}
}

3
src/Avalonia.Themes.Fluent/Controls/ButtonSpinner.xaml

@ -1,7 +1,8 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard"
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls">
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Padding="20"
Background="Black">

2
src/Avalonia.Themes.Fluent/Controls/CalendarButton.xaml

@ -11,7 +11,7 @@
<Setter Property="MinWidth" Value="40"/>
<Setter Property="MinHeight" Value="40"/>
<Setter Property="Margin" Value="1"/>
<Setter Property="Padding" Value="0,0,0,4"/>
<Setter Property="Padding" Value="0,0,0,0"/>
<!--These are actually set on the CalendarView in WinUI-->
<Setter Property="Foreground" Value="{DynamicResource CalendarViewCalendarItemForeground}"/>
<Setter Property="Background" Value="{DynamicResource CalendarViewCalendarItemRevealBackground}"/>

3
src/Avalonia.Themes.Fluent/Controls/CalendarDatePicker.xaml

@ -7,7 +7,8 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard">
xmlns:sys="clr-namespace:System;assembly=netstandard"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Margin="20, 20, 20, 200">
<CalendarDatePicker Width="200"

2
src/Avalonia.Themes.Fluent/Controls/CalendarDayButton.xaml

@ -11,7 +11,7 @@
<Setter Property="MinWidth" Value="40"/>
<Setter Property="MinHeight" Value="40"/>
<Setter Property="Margin" Value="1"/>
<Setter Property="Padding" Value="0,0,0,4"/>
<Setter Property="Padding" Value="0,0,0,0"/>
<!--These are actually set on the CalendarView in WinUI-->
<Setter Property="Foreground" Value="{DynamicResource CalendarViewCalendarItemForeground}"/>
<Setter Property="Background" Value="{DynamicResource CalendarViewCalendarItemRevealBackground}"/>

5
src/Avalonia.Themes.Fluent/Controls/CalendarItem.xaml

@ -6,7 +6,9 @@
-->
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True"
x:DataType="CalendarItem">
<Design.PreviewWith>
<Border Padding="20">
<Calendar />
@ -32,6 +34,7 @@
<Style Selector="Button.CalendarHeader">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Background" Value="{DynamicResource CalendarViewNavigationButtonBackground}"/>
<Setter Property="Template">

8
src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml

@ -1,6 +1,8 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="using:System">
xmlns:sys="using:System"
x:CompileBindings="True"
x:DataType="DataValidationErrors">
<Design.PreviewWith>
<Border Padding="20">
<StackPanel Spacing="20">
@ -27,7 +29,7 @@
<Style Selector="DataValidationErrors">
<Style.Resources>
<DataTemplate x:Key="InlineDataValidationErrorTemplate">
<ItemsControl Items="{Binding}" TextBlock.Foreground="{DynamicResource SystemControlErrorTextForegroundBrush}">
<ItemsControl Items="{Binding}" x:DataType="DataValidationErrors" TextBlock.Foreground="{DynamicResource SystemControlErrorTextForegroundBrush}">
<ItemsControl.Styles>
<Style Selector="TextBlock">
<Setter Property="TextWrapping" Value="Wrap" />
@ -54,7 +56,7 @@
</DockPanel>
</ControlTemplate>
<DataTemplate x:Key="TooltipDataValidationErrorTemplate">
<DataTemplate x:DataType="DataValidationErrors" x:Key="TooltipDataValidationErrorTemplate">
<Panel Name="PART_InlineErrorTemplatePanel" Background="Transparent">
<Panel.Styles>
<Style Selector="Panel#PART_InlineErrorTemplatePanel">

3
src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml

@ -7,7 +7,8 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard">
xmlns:sys="clr-namespace:System;assembly=netstandard"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Padding="20">
<DatePicker CornerRadius="10" />

8
src/Avalonia.Themes.Fluent/Controls/Expander.xaml

@ -1,4 +1,6 @@
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Padding="20">
<StackPanel Orientation="Vertical" Spacing="20" Width="350">
@ -69,13 +71,13 @@
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}"
IsEnabled="{TemplateBinding IsEnabled}" />
<Border x:Name="ExpanderContent"
Padding="{DynamicResource ExpanderContentPadding}"
Background="{DynamicResource ExpanderDropDownBackground}"
BorderBrush="{DynamicResource ExpanderDropDownBorderBrush}"
IsVisible="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
IsVisible="{TemplateBinding IsExpanded, Mode=TwoWay}">
<ContentPresenter x:Name="PART_ContentPresenter"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"

4
src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml

@ -142,7 +142,7 @@
<Rectangle Fill="{DynamicResource SystemControlHighlightAltBaseMediumLowBrush}" Height="1" Margin="0,5,0,0" DockPanel.Dock="Bottom"/>
<DockPanel Margin="4,0">
<Button Command="{Binding GoUp}" DockPanel.Dock="Left">
<Path Data="M 0 7 L 7 0 L 14 7 M 7 0 L 7 16" Stroke="{Binding $parent[Button].Foreground}" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,1,0,-1"/>
<Path Data="M 0 7 L 7 0 L 14 7 M 7 0 L 7 16" Stroke="{CompiledBinding $parent[Button].Foreground}" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,1,0,-1"/>
</Button>
<TextBox x:Name="Location" Text="{Binding Location}">
<TextBox.KeyBindings>
@ -321,4 +321,4 @@
<Style Selector="dialogs|ManagedFileChooser /template/ UniformGrid#Finalize > Button /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
</Styles>
</Styles>

6
src/Avalonia.Themes.Fluent/Controls/MenuItem.xaml

@ -1,7 +1,9 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls"
xmlns:sys="clr-namespace:System;assembly=netstandard">
xmlns:sys="clr-namespace:System;assembly=netstandard"
x:DataType="MenuItem"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Padding="20"
Width="400"
@ -158,7 +160,7 @@
</ContentPresenter>
<Popup Name="PART_Popup"
WindowManagerAddShadowHint="False"
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
MinWidth="{ReflectionBinding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
IsLightDismissEnabled="True"
IsOpen="{TemplateBinding IsSubMenuOpen, Mode=TwoWay}"
OverlayInputPassThroughElement="{Binding $parent[Menu]}">

3
src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml

@ -1,6 +1,7 @@
<Style xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Avalonia.Themes.Fluent"
x:CompileBindings="True"
Selector="NativeMenuBar">
<Style.Resources>
<local:InverseBooleanValueConverter x:Key="AvaloniaThemesDefaultNativeMenuBarInverseBooleanValueConverter" Default="True"/>
@ -11,7 +12,7 @@
IsVisible="{Binding $parent[TopLevel].(NativeMenu.IsNativeMenuExported), Converter={StaticResource AvaloniaThemesDefaultNativeMenuBarInverseBooleanValueConverter}}"
Items="{Binding $parent[TopLevel].(NativeMenu.Menu).Items}">
<Menu.Styles>
<Style Selector="MenuItem">
<Style x:DataType="NativeMenuItem" Selector="MenuItem">
<Setter Property="Header" Value="{Binding Header}"/>
<Setter Property="InputGesture" Value="{Binding Gesture}"/>
<Setter Property="Items" Value="{Binding Menu.Items}"/>

4
src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml

@ -38,7 +38,7 @@
BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="{TemplateBinding CornerRadius}"
Padding="0"
MinWidth="{TemplateBinding MinWidth}"
MinWidth="0"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
AllowSpin="{TemplateBinding AllowSpin}"
@ -50,7 +50,7 @@
BorderBrush="Transparent"
Margin="-1"
Padding="{TemplateBinding Padding}"
MinWidth="{TemplateBinding MinWidth}"
MinWidth="0"
Foreground="{TemplateBinding Foreground}"
FontSize="{TemplateBinding FontSize}"
Watermark="{TemplateBinding Watermark}"

8
src/Avalonia.Themes.Fluent/Controls/ProgressBar.xaml

@ -1,4 +1,6 @@
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Padding="20">
<StackPanel Spacing="10">
@ -29,8 +31,8 @@
<Border x:Name="IndeterminateProgressBarIndicator" CornerRadius="{TemplateBinding CornerRadius}" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Foreground}" />
<Border x:Name="IndeterminateProgressBarIndicator2" CornerRadius="{TemplateBinding CornerRadius}" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Foreground}" />
</Panel>
<LayoutTransformControl x:Name="PART_LayoutTransformControl" HorizontalAlignment="Center" VerticalAlignment="Center" IsVisible="{Binding ShowProgressText, RelativeSource={RelativeSource TemplatedParent}}">
<TextBlock Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat={}{0:0}%}" />
<LayoutTransformControl x:Name="PART_LayoutTransformControl" HorizontalAlignment="Center" VerticalAlignment="Center" IsVisible="{TemplateBinding ShowProgressText}">
<TextBlock Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" Text="{ReflectionBinding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat={}{0:0}%}" />
</LayoutTransformControl>
</Panel>
</Border>

3
src/Avalonia.Themes.Fluent/Controls/TabItem.xaml

@ -1,5 +1,6 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Padding="20">
<StackPanel Spacing="20">

3
src/Avalonia.Themes.Fluent/Controls/TabStripItem.xaml

@ -1,5 +1,6 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Padding="20">
<StackPanel Spacing="20">

2
src/Avalonia.Themes.Fluent/Controls/TextBox.xaml

@ -166,7 +166,7 @@
<Setter Property="InnerRightContent">
<Template>
<ToggleButton Classes="passwordBoxRevealButton"
IsChecked="{Binding $parent[TextBox].RevealPassword, Mode=TwoWay}" />
IsChecked="{CompiledBinding $parent[TextBox].RevealPassword, Mode=TwoWay}" />
</Template>
</Setter>
</Style>

3
src/Avalonia.Themes.Fluent/Controls/TimePicker.xaml

@ -7,7 +7,8 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard">
xmlns:sys="clr-namespace:System;assembly=netstandard"
x:CompileBindings="True">
<Styles.Resources>
<x:Double x:Key="TimePickerFlyoutPresenterItemHeight">40</x:Double>
<x:Double x:Key="TimePickerSpacerThemeWidth">1</x:Double>

3
src/Avalonia.Themes.Fluent/Controls/ToolTip.xaml

@ -1,6 +1,7 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard">
xmlns:sys="clr-namespace:System;assembly=netstandard"
x:CompileBindings="True">
<Design.PreviewWith>
<Grid RowDefinitions="Auto,Auto"

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save