diff --git a/build/SkiaSharp.props b/build/SkiaSharp.props
index cf8e0fd13a..c03ad0fefd 100644
--- a/build/SkiaSharp.props
+++ b/build/SkiaSharp.props
@@ -1,6 +1,6 @@
-
+
diff --git a/samples/ControlCatalog.NetCore/Program.cs b/samples/ControlCatalog.NetCore/Program.cs
index 40321496c0..de9ca02ed1 100644
--- a/samples/ControlCatalog.NetCore/Program.cs
+++ b/samples/ControlCatalog.NetCore/Program.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Threading;
using Avalonia;
using Avalonia.Controls;
+using Avalonia.LinuxFramebuffer.Output;
using Avalonia.Skia;
using Avalonia.ReactiveUI;
@@ -29,8 +30,13 @@ namespace ControlCatalog.NetCore
var builder = BuildAvaloniaApp();
if (args.Contains("--fbdev"))
{
- System.Threading.ThreadPool.QueueUserWorkItem(_ => ConsoleSilencer());
- return builder.StartLinuxFramebuffer(args);
+ SilenceConsole();
+ return builder.StartLinuxFbDev(args);
+ }
+ else if (args.Contains("--drm"))
+ {
+ SilenceConsole();
+ return builder.StartLinuxDrm(args);
}
else
return builder.StartWithClassicDesktopLifetime(args);
@@ -51,11 +57,14 @@ namespace ControlCatalog.NetCore
.UseSkia()
.UseReactiveUI();
- static void ConsoleSilencer()
+ static void SilenceConsole()
{
- Console.CursorVisible = false;
- while (true)
- Console.ReadKey(true);
+ new Thread(() =>
+ {
+ Console.CursorVisible = false;
+ while (true)
+ Console.ReadKey(true);
+ }) {IsBackground = true}.Start();
}
}
}
diff --git a/src/Avalonia.Base/AvaloniaObject.cs b/src/Avalonia.Base/AvaloniaObject.cs
index 7601b64ce9..a3d5803ab0 100644
--- a/src/Avalonia.Base/AvaloniaObject.cs
+++ b/src/Avalonia.Base/AvaloniaObject.cs
@@ -466,7 +466,7 @@ namespace Avalonia
/// The old property value.
/// The new property value.
/// The priority of the binding that produced the value.
- protected void RaisePropertyChanged(
+ protected internal void RaisePropertyChanged(
AvaloniaProperty property,
object oldValue,
object newValue,
@@ -508,45 +508,6 @@ namespace Avalonia
}
}
- ///
- /// A callback type for encapsulating complex logic for setting direct properties.
- ///
- /// The type of the property.
- /// The value to which to set the property.
- /// The backing field for the property.
- /// A wrapper for the property-changed notification.
- protected delegate void SetAndRaiseCallback(T value, ref T field, Action notifyWrapper);
-
- ///
- /// Sets the backing field for a direct avalonia property, raising the
- /// event if the value has changed.
- ///
- /// The type of the property.
- /// The property.
- /// The backing field.
- /// A callback called to actually set the value to the backing field.
- /// The value.
- ///
- /// True if the value changed, otherwise false.
- ///
- protected bool SetAndRaise(
- AvaloniaProperty property,
- ref T field,
- SetAndRaiseCallback setterCallback,
- T value)
- {
- Contract.Requires(setterCallback != null);
- return Values.Setter.SetAndNotify(
- property,
- ref field,
- (object update, ref T backing, Action notify) =>
- {
- setterCallback((T)update, ref backing, notify);
- return true;
- },
- value);
- }
-
///
/// Sets the backing field for a direct avalonia property, raising the
/// event if the value has changed.
@@ -561,32 +522,15 @@ namespace Avalonia
protected bool SetAndRaise(AvaloniaProperty property, ref T field, T value)
{
VerifyAccess();
- return SetAndRaise(
- property,
- ref field,
- (T val, ref T backing, Action notifyWrapper)
- => SetAndRaiseCore(property, ref backing, val, notifyWrapper),
- value);
- }
- ///
- /// Default assignment logic for SetAndRaise.
- ///
- /// The type of the property.
- /// The property.
- /// The backing field.
- /// The value.
- /// A wrapper for the property-changed notification.
- ///
- /// True if the value changed, otherwise false.
- ///
- private bool SetAndRaiseCore(AvaloniaProperty property, ref T field, T value, Action notifyWrapper)
- {
- var old = field;
- field = value;
+ if (EqualityComparer.Default.Equals(field, value))
+ {
+ return false;
+ }
+
+ DeferredSetter setter = Values.GetDirectDeferredSetter(property);
- notifyWrapper(() => RaisePropertyChanged(property, old, value, BindingPriority.LocalValue));
- return true;
+ return setter.SetAndNotify(this, property, ref field, value);
}
///
diff --git a/src/Avalonia.Base/IPriorityValueOwner.cs b/src/Avalonia.Base/IPriorityValueOwner.cs
index 540b1bf19b..1d6e5e59ad 100644
--- a/src/Avalonia.Base/IPriorityValueOwner.cs
+++ b/src/Avalonia.Base/IPriorityValueOwner.cs
@@ -29,6 +29,13 @@ namespace Avalonia
/// The notification.
void BindingNotificationReceived(AvaloniaProperty property, BindingNotification notification);
+ ///
+ /// Returns deferred setter for given non-direct property.
+ ///
+ /// Property.
+ /// Deferred setter for given property.
+ DeferredSetter
void VerifyAccess();
-
- DeferredSetter