diff --git a/appveyor.yml b/appveyor.yml
index cef8c4a2cc..aa8c19ace4 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -16,9 +16,7 @@ environment:
init:
- ps: if (Test-Path env:nuget_address) {[System.IO.File]::AppendAllText("C:\Windows\System32\drivers\etc\hosts", "`n$($env:nuget_address)`tapi.nuget.org")}
install:
- - if not exist gtk-sharp-2.12.26.msi appveyor DownloadFile http://download.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.26.msi
- if not exist dotnet-2.0.0.exe appveyor DownloadFile https://download.microsoft.com/download/0/F/D/0FD852A4-7EA1-4E2A-983A-0484AC19B92C/dotnet-sdk-2.0.0-win-x64.exe -FileName "dotnet-2.0.0.exe"
- - ps: Start-Process -FilePath "msiexec" -ArgumentList "/i gtk-sharp-2.12.26.msi /quiet /qn /norestart" -Wait
- ps: Start-Process -FilePath "dotnet-2.0.0.exe" -ArgumentList "/quiet" -Wait
- cmd: set PATH=%programfiles(x86)%\GtkSharp\2.12\bin\;%PATH%
before_build:
@@ -36,5 +34,4 @@ artifacts:
- path: artifacts\zip\*.zip
- path: artifacts\inspectcode.xml
cache:
- - gtk-sharp-2.12.26.msi
- dotnet-2.0.0.exe
diff --git a/build/NetCore.props b/build/NetCore.props
index cebb02c7f5..b9cde28015 100644
--- a/build/NetCore.props
+++ b/build/NetCore.props
@@ -1,6 +1,4 @@
-
-
diff --git a/docs/guidelines/build.md b/docs/guidelines/build.md
index 828a4ddab3..559790b197 100644
--- a/docs/guidelines/build.md
+++ b/docs/guidelines/build.md
@@ -4,12 +4,6 @@
Avalonia requires at least Visual Studio 2017 and .NET Core SDK 2.0 to build on Windows.
-### Install GTK Sharp
-
-For the moment under windows, you must have [gtk-sharp](http://www.mono-project.com/download/#download-win)
-installed. Note that after installing the package your machine may require a restart before GTK# is
-added to your path. We hope to remove or make this dependency optional at some point in the future.
-
### Clone the Avalonia repository
```
diff --git a/readme.md b/readme.md
index 9f16405726..3f4840fce2 100644
--- a/readme.md
+++ b/readme.md
@@ -7,7 +7,7 @@
A multi-platform .NET UI framework. It can run on Windows, Linux, Mac OS X, iOS and Android.
-
+[](https://youtu.be/wHcB3sGLVYg)
Desktop platforms:
@@ -36,7 +36,7 @@ Try out the ControlCatalog to give it a quick demo.
Avalonia is a multi-platform windowing toolkit - somewhat like WPF - that is intended to be multi-
platform. It supports XAML, lookless controls and a flexible styling system, and runs on Windows
-using Direct2D and other operating systems using Gtk & Cairo.
+using Direct2D and other operating systems using Skia and OS-specific windowing backend (GTK, Cocoa, etc).
## Current Status
diff --git a/samples/ControlCatalog/Assets/test_icon.ico b/samples/ControlCatalog/Assets/test_icon.ico
index 9d1074ad13..da8d49ff9b 100644
Binary files a/samples/ControlCatalog/Assets/test_icon.ico and b/samples/ControlCatalog/Assets/test_icon.ico differ
diff --git a/samples/ControlCatalog/ControlCatalog.csproj b/samples/ControlCatalog/ControlCatalog.csproj
index 340905a7f7..11ff531514 100644
--- a/samples/ControlCatalog/ControlCatalog.csproj
+++ b/samples/ControlCatalog/ControlCatalog.csproj
@@ -69,6 +69,9 @@
Designer
+
+ Designer
+
Designer
@@ -131,6 +134,9 @@
MenuPage.xaml
+
+ ProgressBarPage.xaml
+
RadioButtonPage.xaml
diff --git a/samples/ControlCatalog/MainView.xaml b/samples/ControlCatalog/MainView.xaml
index 6c432a90ac..0940316ce9 100644
--- a/samples/ControlCatalog/MainView.xaml
+++ b/samples/ControlCatalog/MainView.xaml
@@ -16,6 +16,7 @@
+
diff --git a/samples/ControlCatalog/Pages/ProgressBarPage.xaml b/samples/ControlCatalog/Pages/ProgressBarPage.xaml
new file mode 100644
index 0000000000..bf40e68630
--- /dev/null
+++ b/samples/ControlCatalog/Pages/ProgressBarPage.xaml
@@ -0,0 +1,24 @@
+
+
+ ProgressBar
+ A progress bar control
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/ControlCatalog/Pages/ProgressBarPage.xaml.cs b/samples/ControlCatalog/Pages/ProgressBarPage.xaml.cs
new file mode 100644
index 0000000000..56792b3908
--- /dev/null
+++ b/samples/ControlCatalog/Pages/ProgressBarPage.xaml.cs
@@ -0,0 +1,18 @@
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace ControlCatalog.Pages
+{
+ public class ProgressBarPage : UserControl
+ {
+ public ProgressBarPage()
+ {
+ this.InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+ }
+}
diff --git a/samples/ControlCatalog/Pages/ToolTipPage.xaml b/samples/ControlCatalog/Pages/ToolTipPage.xaml
index 5cf7fee4d1..aa7d60bd11 100644
--- a/samples/ControlCatalog/Pages/ToolTipPage.xaml
+++ b/samples/ControlCatalog/Pages/ToolTipPage.xaml
@@ -10,7 +10,7 @@
HorizontalAlignment="Center">
@@ -24,7 +24,7 @@
diff --git a/samples/interop/Direct3DInteropSample/MainWindow.cs b/samples/interop/Direct3DInteropSample/MainWindow.cs
index ad40e81895..ffa0de0a36 100644
--- a/samples/interop/Direct3DInteropSample/MainWindow.cs
+++ b/samples/interop/Direct3DInteropSample/MainWindow.cs
@@ -253,8 +253,9 @@ namespace Direct3DInteropSample
public IDrawingContextImpl CreateDrawingContext(IVisualBrushRenderer visualBrushRenderer)
{
- return new DrawingContextImpl(visualBrushRenderer, _window._d2dRenderTarget,
- AvaloniaLocator.Current.GetService());
+ return new DrawingContextImpl(visualBrushRenderer, null, _window._d2dRenderTarget,
+ AvaloniaLocator.Current.GetService(),
+ AvaloniaLocator.Current.GetService());
}
}
diff --git a/src/Android/Avalonia.Android/AndroidThreadingInterface.cs b/src/Android/Avalonia.Android/AndroidThreadingInterface.cs
index 2e5b2902f4..77dfc60b83 100644
--- a/src/Android/Avalonia.Android/AndroidThreadingInterface.cs
+++ b/src/Android/Avalonia.Android/AndroidThreadingInterface.cs
@@ -30,7 +30,7 @@ namespace Avalonia.Android
return;
}
- public IDisposable StartTimer(TimeSpan interval, Action tick)
+ public IDisposable StartTimer(DispatcherPriority priority, TimeSpan interval, Action tick)
{
if (interval.TotalMilliseconds < 10)
interval = TimeSpan.FromMilliseconds(10);
diff --git a/src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs b/src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs
index 68f9e2c631..9f5417ca95 100644
--- a/src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs
+++ b/src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs
@@ -17,10 +17,11 @@ namespace Avalonia.Platform
///
/// Starts a timer.
///
+ ///
/// The interval.
/// The action to call on each tick.
/// An used to stop the timer.
- IDisposable StartTimer(TimeSpan interval, Action tick);
+ IDisposable StartTimer(DispatcherPriority priority, TimeSpan interval, Action tick);
void Signal(DispatcherPriority priority);
diff --git a/src/Avalonia.Base/Platform/IRuntimePlatform.cs b/src/Avalonia.Base/Platform/IRuntimePlatform.cs
index e1a09f094d..66253dc5b2 100644
--- a/src/Avalonia.Base/Platform/IRuntimePlatform.cs
+++ b/src/Avalonia.Base/Platform/IRuntimePlatform.cs
@@ -14,6 +14,15 @@ namespace Avalonia.Platform
IDisposable StartSystemTimer(TimeSpan interval, Action tick);
string GetStackTrace();
RuntimePlatformInfo GetRuntimeInfo();
+ IUnmanagedBlob AllocBlob(int size);
+ }
+
+ public interface IUnmanagedBlob : IDisposable
+ {
+ IntPtr Address { get; }
+ int Size { get; }
+ bool IsDisposed { get; }
+
}
public struct RuntimePlatformInfo
diff --git a/src/Avalonia.Base/Threading/Dispatcher.cs b/src/Avalonia.Base/Threading/Dispatcher.cs
index a60b663bed..a4b1aaafbc 100644
--- a/src/Avalonia.Base/Threading/Dispatcher.cs
+++ b/src/Avalonia.Base/Threading/Dispatcher.cs
@@ -84,6 +84,19 @@ namespace Avalonia.Threading
_jobRunner?.Post(action, priority);
}
+ ///
+ /// This is needed for platform backends that don't have internal priority system (e. g. win32)
+ /// To ensure that there are no jobs with higher priority
+ ///
+ ///
+ internal void EnsurePriority(DispatcherPriority currentPriority)
+ {
+ if (currentPriority == DispatcherPriority.MaxValue)
+ return;
+ currentPriority += 1;
+ _jobRunner.RunJobs(currentPriority);
+ }
+
///
/// Allows unit tests to change the platform threading interface.
///
diff --git a/src/Avalonia.Base/Threading/DispatcherTimer.cs b/src/Avalonia.Base/Threading/DispatcherTimer.cs
index 972fdb2049..4a8a9d673f 100644
--- a/src/Avalonia.Base/Threading/DispatcherTimer.cs
+++ b/src/Avalonia.Base/Threading/DispatcherTimer.cs
@@ -17,13 +17,11 @@ namespace Avalonia.Threading
private readonly DispatcherPriority _priority;
private TimeSpan _interval;
-
- private readonly Action _raiseTickAction;
-
+
///
/// Initializes a new instance of the class.
///
- public DispatcherTimer() : this(DispatcherPriority.Normal)
+ public DispatcherTimer() : this(DispatcherPriority.Background)
{
}
@@ -34,7 +32,6 @@ namespace Avalonia.Threading
public DispatcherTimer(DispatcherPriority priority)
{
_priority = priority;
- _raiseTickAction = RaiseTick;
}
///
@@ -187,7 +184,7 @@ namespace Avalonia.Threading
throw new Exception("Could not start timer: IPlatformThreadingInterface is not registered.");
}
- _timer = threading.StartTimer(Interval, InternalTick);
+ _timer = threading.StartTimer(_priority, Interval, InternalTick);
}
}
@@ -210,14 +207,7 @@ namespace Avalonia.Threading
///
private void InternalTick()
{
- Dispatcher.UIThread.InvokeAsync(_raiseTickAction, _priority);
- }
-
- ///
- /// Raises the event.
- ///
- private void RaiseTick()
- {
+ Dispatcher.UIThread.EnsurePriority(_priority);
Tick?.Invoke(this, EventArgs.Empty);
}
}
diff --git a/src/Avalonia.Controls/MenuItem.cs b/src/Avalonia.Controls/MenuItem.cs
index 926c240e57..dadd3b910b 100644
--- a/src/Avalonia.Controls/MenuItem.cs
+++ b/src/Avalonia.Controls/MenuItem.cs
@@ -307,6 +307,21 @@ namespace Avalonia.Controls
() => IsSubMenuOpen = true,
TimeSpan.FromMilliseconds(400));
}
+ else
+ {
+ var parentItem = Parent as MenuItem;
+ if (parentItem != null)
+ {
+ foreach (var sibling in parentItem.Items
+ .OfType