瀏覽代碼

Merge branch 'master' into feature/wraplayout-for-itemsrepeater

danwalmsley 5 年之前
父節點
當前提交
03cd545761
共有 100 個文件被更改,包括 2752 次插入298 次删除
  1. 1 1
      .gitmodules
  2. 5 0
      .ncrunch/NativeEmbedSample.v3.ncrunchproject
  3. 107 29
      Avalonia.sln
  4. 32 0
      NOTICE.md
  5. 2 0
      build.sh
  6. 1 1
      build/CoreLibraries.props
  7. 1 1
      build/Moq.props
  8. 0 7
      build/Serilog.props
  9. 1 3
      build/readme.md
  10. 39 1
      native/Avalonia.Native/inc/avalonia-native.h
  11. 8 0
      native/Avalonia.Native/src/OSX/Avalonia.Native.OSX.xcodeproj/project.pbxproj
  12. 1 0
      native/Avalonia.Native/src/OSX/AvnString.h
  13. 12 0
      native/Avalonia.Native/src/OSX/AvnString.mm
  14. 35 1
      native/Avalonia.Native/src/OSX/app.mm
  15. 34 0
      native/Avalonia.Native/src/OSX/clipboard.mm
  16. 9 0
      native/Avalonia.Native/src/OSX/common.h
  17. 160 0
      native/Avalonia.Native/src/OSX/controlhost.mm
  18. 17 0
      native/Avalonia.Native/src/OSX/deadlock.mm
  19. 10 3
      native/Avalonia.Native/src/OSX/window.h
  20. 347 40
      native/Avalonia.Native/src/OSX/window.mm
  21. 4 2
      nukebuild/Build.cs
  22. 76 0
      nukebuild/BuildTasksPatcher.cs
  23. 1 1
      nukebuild/Numerge
  24. 3 0
      nukebuild/_build.csproj
  25. 4 0
      packages/Avalonia/Avalonia.csproj
  26. 9 1
      packages/Avalonia/AvaloniaBuildTasks.props
  27. 20 2
      packages/Avalonia/AvaloniaBuildTasks.targets
  28. 18 0
      packages/Avalonia/AvaloniaItemSchema.xaml
  29. 22 15
      readme.md
  30. 0 2
      samples/BindingDemo/App.xaml.cs
  31. 0 1
      samples/BindingDemo/BindingDemo.csproj
  32. 3 2
      samples/BindingDemo/MainWindow.xaml
  33. 2 2
      samples/BindingDemo/ViewModels/MainWindowViewModel.cs
  34. 0 1
      samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj
  35. 0 2
      samples/ControlCatalog.Desktop/Program.cs
  36. 2 1
      samples/ControlCatalog.NetCore/ControlCatalog.NetCore.csproj
  37. 55 3
      samples/ControlCatalog.NetCore/Program.cs
  38. 1 3
      samples/ControlCatalog/App.xaml
  39. 45 0
      samples/ControlCatalog/App.xaml.cs
  40. 0 1
      samples/ControlCatalog/ControlCatalog.csproj
  41. 16 5
      samples/ControlCatalog/MainView.xaml
  42. 9 21
      samples/ControlCatalog/MainView.xaml.cs
  43. 28 13
      samples/ControlCatalog/MainWindow.xaml
  44. 3 3
      samples/ControlCatalog/Models/Person.cs
  45. 139 0
      samples/ControlCatalog/Pages/AcrylicPage.xaml
  46. 19 0
      samples/ControlCatalog/Pages/AcrylicPage.xaml.cs
  47. 12 5
      samples/ControlCatalog/Pages/BorderPage.xaml
  48. 12 7
      samples/ControlCatalog/Pages/ButtonPage.xaml
  49. 20 0
      samples/ControlCatalog/Pages/ButtonPage.xaml.cs
  50. 9 9
      samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml
  51. 7 7
      samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml.cs
  52. 2 2
      samples/ControlCatalog/Pages/ComboBoxPage.xaml
  53. 2 2
      samples/ControlCatalog/Pages/ContextMenuPage.xaml
  54. 123 0
      samples/ControlCatalog/Pages/DateTimePickerPage.xaml
  55. 30 0
      samples/ControlCatalog/Pages/DateTimePickerPage.xaml.cs
  56. 2 0
      samples/ControlCatalog/Pages/DialogsPage.xaml
  57. 15 0
      samples/ControlCatalog/Pages/DialogsPage.xaml.cs
  58. 3 3
      samples/ControlCatalog/Pages/DragAndDropPage.xaml
  59. 4 2
      samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml
  60. 31 3
      samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs
  61. 4 4
      samples/ControlCatalog/Pages/LayoutTransformControlPage.xaml
  62. 6 6
      samples/ControlCatalog/Pages/NumericUpDownPage.xaml
  63. 8 18
      samples/ControlCatalog/Pages/ProgressBarPage.xaml
  64. 35 0
      samples/ControlCatalog/Pages/ScrollViewerPage.xaml
  65. 65 0
      samples/ControlCatalog/Pages/ScrollViewerPage.xaml.cs
  66. 17 4
      samples/ControlCatalog/Pages/SliderPage.xaml
  67. 97 0
      samples/ControlCatalog/Pages/SplitViewPage.xaml
  68. 21 0
      samples/ControlCatalog/Pages/SplitViewPage.xaml.cs
  69. 30 39
      samples/ControlCatalog/Pages/TextBlockPage.xaml
  70. 79 0
      samples/ControlCatalog/Pages/ToggleSwitchPage.xaml
  71. 19 0
      samples/ControlCatalog/Pages/ToggleSwitchPage.xaml.cs
  72. 3 3
      samples/ControlCatalog/Pages/ToolTipPage.xaml
  73. 1 0
      samples/ControlCatalog/Pages/TreeViewPage.xaml
  74. 19 0
      samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml
  75. 19 0
      samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml.cs
  76. 6 3
      samples/ControlCatalog/SideBar.xaml
  77. 11 2
      samples/ControlCatalog/ViewModels/ItemsRepeaterPageViewModel.cs
  78. 65 0
      samples/ControlCatalog/ViewModels/MainWindowViewModel.cs
  79. 46 0
      samples/ControlCatalog/ViewModels/SplitViewPageViewModel.cs
  80. 11 0
      samples/ControlCatalog/ViewModels/TreeViewPageViewModel.cs
  81. 0 2
      samples/RenderDemo/App.xaml.cs
  82. 3 0
      samples/RenderDemo/MainWindow.xaml
  83. 2 2
      samples/RenderDemo/Pages/ClippingPage.xaml
  84. 115 0
      samples/RenderDemo/Pages/TransitionsPage.xaml
  85. 37 0
      samples/RenderDemo/Pages/TransitionsPage.xaml.cs
  86. 0 1
      samples/RenderDemo/RenderDemo.csproj
  87. 2 2
      samples/RenderDemo/SideBar.xaml
  88. 0 2
      samples/VirtualizationDemo/Program.cs
  89. 0 1
      samples/VirtualizationDemo/VirtualizationDemo.csproj
  90. 0 1
      samples/interop/Direct3DInteropSample/Direct3DInteropSample.csproj
  91. 8 0
      samples/interop/NativeEmbedSample/App.xaml
  92. 22 0
      samples/interop/NativeEmbedSample/App.xaml.cs
  93. 121 0
      samples/interop/NativeEmbedSample/EmbedSample.cs
  94. 58 0
      samples/interop/NativeEmbedSample/GtkHelper.cs
  95. 39 0
      samples/interop/NativeEmbedSample/MacHelper.cs
  96. 52 0
      samples/interop/NativeEmbedSample/MainWindow.xaml
  97. 36 0
      samples/interop/NativeEmbedSample/MainWindow.xaml.cs
  98. 31 0
      samples/interop/NativeEmbedSample/NativeEmbedSample.csproj
  99. 17 0
      samples/interop/NativeEmbedSample/Program.cs
  100. 74 0
      samples/interop/NativeEmbedSample/WinApi.cs

+ 1 - 1
.gitmodules

@@ -3,4 +3,4 @@
 	url = https://github.com/kekekeks/Numerge.git
 [submodule "src/Markup/Avalonia.Markup.Xaml/XamlIl/xamlil.github"]
 	path = src/Markup/Avalonia.Markup.Xaml/XamlIl/xamlil.github
-	url = https://github.com/kekekeks/XamlIl.git
+	url = https://github.com/kekekeks/XamlX.git

+ 5 - 0
.ncrunch/NativeEmbedSample.v3.ncrunchproject

@@ -0,0 +1,5 @@
+<ProjectConfiguration>
+  <Settings>
+    <IgnoreThisComponentCompletely>True</IgnoreThisComponentCompletely>
+  </Settings>
+</ProjectConfiguration>

+ 107 - 29
Avalonia.sln

@@ -95,8 +95,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.UnitTests", "tests
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Benchmarks", "tests\Avalonia.Benchmarks\Avalonia.Benchmarks.csproj", "{410AC439-81A1-4EB5-B5E9-6A7FC6B77F4B}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Logging.Serilog", "src\Avalonia.Logging.Serilog\Avalonia.Logging.Serilog.csproj", "{B61B66A3-B82D-4875-8001-89D3394FE0C9}"
-EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.DesignerSupport", "src\Avalonia.DesignerSupport\Avalonia.DesignerSupport.csproj", "{799A7BB5-3C2C-48B6-85A7-406A12C420DA}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlCatalog", "samples\ControlCatalog\ControlCatalog.csproj", "{D0A739B9-3C68-4BA6-A328-41606954B6BD}"
@@ -140,7 +138,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Props", "Props", "{F3AC8BC1
 		build\ReactiveUI.props = build\ReactiveUI.props
 		build\Rx.props = build\Rx.props
 		build\SampleApp.props = build\SampleApp.props
-		build\Serilog.props = build\Serilog.props
 		build\SharpDX.props = build\SharpDX.props
 		build\SkiaSharp.props = build\SkiaSharp.props
 		build\System.Memory.props = build\System.Memory.props
@@ -206,12 +203,20 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.FreeDesktop", "src
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Controls.DataGrid.UnitTests", "tests\Avalonia.Controls.DataGrid.UnitTests\Avalonia.Controls.DataGrid.UnitTests.csproj", "{351337F5-D66F-461B-A957-4EF60BDB4BA6}"
 EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NativeEmbedSample", "samples\interop\NativeEmbedSample\NativeEmbedSample.csproj", "{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Themes.Fluent", "src\Avalonia.Themes.Fluent\Avalonia.Themes.Fluent.csproj", "{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.Headless", "src\Avalonia.Headless\Avalonia.Headless.csproj", "{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.Headless.Vnc", "src\Avalonia.Headless.Vnc\Avalonia.Headless.Vnc.csproj", "{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}"
+EndProject
 Global
 	GlobalSection(SharedMSBuildProjectFiles) = preSolution
 		src\Shared\RenderHelpers\RenderHelpers.projitems*{3c4c0cb4-0c0f-4450-a37b-148c84ff905f}*SharedItemsImports = 13
 		src\Shared\RenderHelpers\RenderHelpers.projitems*{3e908f67-5543-4879-a1dc-08eace79b3cd}*SharedItemsImports = 5
-		src\Shared\PlatformSupport\PlatformSupport.projitems*{4488ad85-1495-4809-9aa4-ddfe0a48527e}*SharedItemsImports = 4
-		src\Shared\PlatformSupport\PlatformSupport.projitems*{7b92af71-6287-4693-9dcb-bd5b6e927e23}*SharedItemsImports = 4
+		src\Shared\PlatformSupport\PlatformSupport.projitems*{4488ad85-1495-4809-9aa4-ddfe0a48527e}*SharedItemsImports = 5
+		src\Shared\PlatformSupport\PlatformSupport.projitems*{7b92af71-6287-4693-9dcb-bd5b6e927e23}*SharedItemsImports = 5
 		src\Shared\RenderHelpers\RenderHelpers.projitems*{7d2d3083-71dd-4cc9-8907-39a0d86fb322}*SharedItemsImports = 5
 		src\Shared\PlatformSupport\PlatformSupport.projitems*{88060192-33d5-4932-b0f9-8bd2763e857d}*SharedItemsImports = 5
 		src\Shared\PlatformSupport\PlatformSupport.projitems*{e4d9629c-f168-4224-3f51-a5e482ffbc42}*SharedItemsImports = 13
@@ -1025,30 +1030,6 @@ Global
 		{410AC439-81A1-4EB5-B5E9-6A7FC6B77F4B}.Release|iPhone.Build.0 = Release|Any CPU
 		{410AC439-81A1-4EB5-B5E9-6A7FC6B77F4B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
 		{410AC439-81A1-4EB5-B5E9-6A7FC6B77F4B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.AppStore|Any CPU.Build.0 = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.AppStore|iPhone.ActiveCfg = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.AppStore|iPhone.Build.0 = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Debug|iPhone.ActiveCfg = Debug|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Debug|iPhone.Build.0 = Debug|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Release|Any CPU.Build.0 = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Release|iPhone.ActiveCfg = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Release|iPhone.Build.0 = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
-		{B61B66A3-B82D-4875-8001-89D3394FE0C9}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
 		{799A7BB5-3C2C-48B6-85A7-406A12C420DA}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
 		{799A7BB5-3C2C-48B6-85A7-406A12C420DA}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
 		{799A7BB5-3C2C-48B6-85A7-406A12C420DA}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
@@ -1849,6 +1830,54 @@ Global
 		{3278F3A9-9509-4A3F-A15B-BDC8B5BFF632}.Release|iPhone.Build.0 = Release|Any CPU
 		{3278F3A9-9509-4A3F-A15B-BDC8B5BFF632}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
 		{3278F3A9-9509-4A3F-A15B-BDC8B5BFF632}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.AppStore|Any CPU.Build.0 = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.AppStore|iPhone.Build.0 = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Debug|iPhone.Build.0 = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Release|Any CPU.Build.0 = Release|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Release|iPhone.ActiveCfg = Release|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Release|iPhone.Build.0 = Release|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+		{8C89950F-F5D9-47FC-8066-CBC1EC3DF8FC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.AppStore|Any CPU.Build.0 = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.AppStore|iPhone.Build.0 = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Debug|iPhone.Build.0 = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Release|iPhone.ActiveCfg = Release|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Release|iPhone.Build.0 = Release|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+		{B859AE7C-F34F-4A9E-88AE-E0E7229FDE1E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
 		{4D55985A-1EE2-4F25-AD39-6EA8BC04F8FB}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
 		{4D55985A-1EE2-4F25-AD39-6EA8BC04F8FB}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
 		{4D55985A-1EE2-4F25-AD39-6EA8BC04F8FB}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
@@ -1921,6 +1950,54 @@ Global
 		{351337F5-D66F-461B-A957-4EF60BDB4BA6}.Release|iPhone.Build.0 = Release|Any CPU
 		{351337F5-D66F-461B-A957-4EF60BDB4BA6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
 		{351337F5-D66F-461B-A957-4EF60BDB4BA6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.AppStore|Any CPU.Build.0 = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.AppStore|iPhone.Build.0 = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Debug|iPhone.Build.0 = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Release|Any CPU.Build.0 = Release|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Release|iPhone.ActiveCfg = Release|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Release|iPhone.Build.0 = Release|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.AppStore|Any CPU.Build.0 = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.AppStore|iPhone.Build.0 = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Debug|iPhone.Build.0 = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Release|Any CPU.Build.0 = Release|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Release|iPhone.ActiveCfg = Release|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Release|iPhone.Build.0 = Release|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+		{C42D2FC1-A531-4ED4-84B9-89AEC7C962FC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -1978,6 +2055,7 @@ Global
 		{D775DECB-4E00-4ED5-A75A-5FCE58ADFF0B} = {9B9E3891-2366-4253-A952-D08BCEB71098}
 		{AF915D5C-AB00-4EA0-B5E6-001F4AE84E68} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B}
 		{351337F5-D66F-461B-A957-4EF60BDB4BA6} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B}
+		{3C84E04B-36CF-4D0D-B965-C26DD649D1F3} = {A0CC0258-D18C-4AB3-854F-7101680FC3F9}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {87366D66-1391-4D90-8999-95A620AD786A}

+ 32 - 0
NOTICE.md

@@ -271,3 +271,35 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE
+
+# Chromium
+
+https://github.com/chromium/chromium
+
+// Copyright 2015 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 2 - 0
build.sh

@@ -67,6 +67,8 @@ else
     fi
 fi
 
+export PATH=$DOTNET_DIRECTORY:$PATH
+
 echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"
 
 "$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" -- ${BUILD_ARGUMENTS[@]}

+ 1 - 1
build/CoreLibraries.props

@@ -7,10 +7,10 @@
       <ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Input/Avalonia.Input.csproj" />
       <ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Interactivity/Avalonia.Interactivity.csproj" />
       <ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Layout/Avalonia.Layout.csproj" />
-      <ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj" />
       <ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Visuals/Avalonia.Visuals.csproj" />
       <ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Styling/Avalonia.Styling.csproj" />
       <ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj" />
+      <ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Themes.Fluent/Avalonia.Themes.Fluent.csproj" />
       <ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.OpenGL/Avalonia.OpenGL.csproj" />
       <ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Avalonia.Dialogs/Avalonia.Dialogs.csproj" />
       <ProjectReference Include="$(MSBuildThisFileDirectory)/../src/Markup/Avalonia.Markup/Avalonia.Markup.csproj" />

+ 1 - 1
build/Moq.props

@@ -1,5 +1,5 @@
 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
-    <PackageReference Include="Moq" Version="4.7.99" />
+    <PackageReference Include="Moq" Version="4.14.1" />
   </ItemGroup>
 </Project>

+ 0 - 7
build/Serilog.props

@@ -1,7 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <PackageReference Include="Serilog" Version="2.5.0" />
-    <PackageReference Include="Serilog.Sinks.Trace" Version="2.1.0" />
-    <PackageReference Include="Serilog.Sinks.Debug" Version="1.0.0" />
-  </ItemGroup>
-</Project>

+ 1 - 3
build/readme.md

@@ -9,8 +9,6 @@
 <Import Project="..\..\build\Moq.props" />
 <Import Project="..\..\build\NetCore.props" />
 <Import Project="..\..\build\Rx.props" />
-<Import Project="..\..\build\Serilog.props" />
-<Import Project="..\..\build\Serilog.Sinks.Trace.props" />
 <Import Project="..\..\build\SharpDX.props" />
 <Import Project="..\..\build\SkiaSharp.Desktop.props" />
 <Import Project="..\..\build\SkiaSharp.props" />
@@ -22,4 +20,4 @@
 
 ```XML
 <Import Project="..\..\build\UnitTests.NetCore.targets" />
-```
+```

+ 39 - 1
native/Avalonia.Native/inc/avalonia-native.h

@@ -26,7 +26,8 @@ struct IAvnStringArray;
 struct IAvnDndResultCallback;
 struct IAvnGCHandleDeallocatorCallback;
 struct IAvnMenuEvents;
-
+struct IAvnNativeControlHost;
+struct IAvnNativeControlHostTopLevelAttachment;
 enum SystemDecorations {
     SystemDecorationsNone = 0,
     SystemDecorationsBorderOnly = 1,
@@ -204,6 +205,15 @@ enum AvnMenuItemToggleType
     Radio
 };
 
+enum AvnExtendClientAreaChromeHints
+{
+    AvnNoChrome = 0,
+    AvnSystemChrome = 0x01,
+    AvnPreferSystemChrome = 0x02,
+    AvnOSXThickTitleBar = 0x08,
+    AvnDefaultChrome = AvnSystemChrome,
+};
+
 AVNCOM(IAvaloniaNativeFactory, 01) : IUnknown
 {
 public:
@@ -256,6 +266,7 @@ AVNCOM(IAvnWindowBase, 02) : IUnknown
     virtual HRESULT ObtainNSWindowHandleRetained(void** retOut) = 0;
     virtual HRESULT ObtainNSViewHandle(void** retOut) = 0;
     virtual HRESULT ObtainNSViewHandleRetained(void** retOut) = 0;
+    virtual HRESULT CreateNativeControlHost(IAvnNativeControlHost** retOut) = 0;
     virtual HRESULT BeginDragAndDropOperation(AvnDragDropEffects effects, AvnPoint point,
                                               IAvnClipboard* clipboard, IAvnDndResultCallback* cb, void* sourceHandle) = 0;
     virtual HRESULT SetBlurEnabled (bool enable) = 0;
@@ -276,6 +287,11 @@ AVNCOM(IAvnWindow, 04) : virtual IAvnWindowBase
     virtual HRESULT SetTitleBarColor (AvnColor color) = 0;
     virtual HRESULT SetWindowState(AvnWindowState state) = 0;
     virtual HRESULT GetWindowState(AvnWindowState*ret) = 0;
+    virtual HRESULT TakeFocusFromChildren() = 0;
+    virtual HRESULT SetExtendClientArea (bool enable) = 0;
+    virtual HRESULT SetExtendClientAreaHints (AvnExtendClientAreaChromeHints hints) = 0;
+    virtual HRESULT GetExtendTitleBarHeight (double*ret) = 0;
+    virtual HRESULT SetExtendTitleBarHeight (double value) = 0;
 };
 
 AVNCOM(IAvnWindowBaseEvents, 05) : IUnknown
@@ -295,6 +311,7 @@ AVNCOM(IAvnWindowBaseEvents, 05) : IUnknown
     virtual bool RawTextInputEvent (unsigned int timeStamp, const char* text) = 0;
     virtual void ScalingChanged(double scaling) = 0;
     virtual void RunRenderPriorityJobs() = 0;
+    virtual void LostFocus() = 0;
     virtual AvnDragDropEffects DragEvent(AvnDragEventType type, AvnPoint position,
                                          AvnInputModifiers modifiers, AvnDragDropEffects effects,
                                          IAvnClipboard* clipboard, void* dataObjectHandle) = 0;
@@ -387,6 +404,9 @@ AVNCOM(IAvnClipboard, 0f) : IUnknown
     virtual HRESULT SetText (char* type, void* utf8Text) = 0;
     virtual HRESULT ObtainFormats(IAvnStringArray**ppv) = 0;
     virtual HRESULT GetStrings(char* type, IAvnStringArray**ppv) = 0;
+    virtual HRESULT SetBytes(char* type, void* utf8Text, int len) = 0;
+    virtual HRESULT GetBytes(char* type, IAvnString**ppv) = 0;
+    
     virtual HRESULT Clear() = 0;
 };
 
@@ -475,4 +495,22 @@ AVNCOM(IAvnGCHandleDeallocatorCallback, 22) : IUnknown
     virtual void FreeGCHandle(void* handle) = 0;
 };
 
+AVNCOM(IAvnNativeControlHost, 20) : IUnknown
+{
+    virtual HRESULT CreateDefaultChild(void* parent, void** retOut) = 0;
+    virtual IAvnNativeControlHostTopLevelAttachment* CreateAttachment() = 0;
+    virtual void DestroyDefaultChild(void* child) = 0;
+};
+
+AVNCOM(IAvnNativeControlHostTopLevelAttachment, 21) : IUnknown
+{
+    virtual void* GetParentHandle() = 0;
+    virtual HRESULT InitializeWithChildHandle(void* child) = 0;
+    virtual HRESULT AttachTo(IAvnNativeControlHost* host) = 0;
+    virtual void ShowInBounds(float x, float y, float width, float height) = 0;
+    virtual void HideWithSize(float width, float height) = 0;
+    virtual void ReleaseChild() = 0;
+};
+
+
 extern "C" IAvaloniaNativeFactory* CreateAvaloniaNative();

+ 8 - 0
native/Avalonia.Native/src/OSX/Avalonia.Native.OSX.xcodeproj/project.pbxproj

@@ -10,6 +10,8 @@
 		1A002B9E232135EE00021753 /* app.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A002B9D232135EE00021753 /* app.mm */; };
 		1A3E5EA823E9E83B00EDE661 /* rendertarget.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3E5EA723E9E83B00EDE661 /* rendertarget.mm */; };
 		1A3E5EAA23E9F26C00EDE661 /* IOSurface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A3E5EA923E9F26C00EDE661 /* IOSurface.framework */; };
+		1A1852DC23E05814008F0DED /* deadlock.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A1852DB23E05814008F0DED /* deadlock.mm */; };
+		1AFD334123E03C4F0042899B /* controlhost.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AFD334023E03C4F0042899B /* controlhost.mm */; };
 		1A3E5EAE23E9FB1300EDE661 /* cgl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3E5EAD23E9FB1300EDE661 /* cgl.mm */; };
 		1A3E5EB023E9FE8300EDE661 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A3E5EAF23E9FE8300EDE661 /* QuartzCore.framework */; };
 		1A465D10246AB61600C5858B /* dnd.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A465D0F246AB61600C5858B /* dnd.mm */; };
@@ -32,6 +34,8 @@
 		1A002B9D232135EE00021753 /* app.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = app.mm; sourceTree = "<group>"; };
 		1A3E5EA723E9E83B00EDE661 /* rendertarget.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = rendertarget.mm; sourceTree = "<group>"; };
 		1A3E5EA923E9F26C00EDE661 /* IOSurface.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOSurface.framework; path = System/Library/Frameworks/IOSurface.framework; sourceTree = SDKROOT; };
+		1A1852DB23E05814008F0DED /* deadlock.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = deadlock.mm; sourceTree = "<group>"; };
+		1AFD334023E03C4F0042899B /* controlhost.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = controlhost.mm; sourceTree = "<group>"; };
 		1A3E5EAD23E9FB1300EDE661 /* cgl.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = cgl.mm; sourceTree = "<group>"; };
 		1A3E5EAF23E9FE8300EDE661 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
 		1A465D0F246AB61600C5858B /* dnd.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = dnd.mm; sourceTree = "<group>"; };
@@ -86,11 +90,13 @@
 		AB7A61E62147C814003C5833 = {
 			isa = PBXGroup;
 			children = (
+				1A1852DB23E05814008F0DED /* deadlock.mm */,
 				1A002B9D232135EE00021753 /* app.mm */,
 				37DDA9B121933371002E132B /* AvnString.h */,
 				37DDA9AF219330F8002E132B /* AvnString.mm */,
 				37A4E71A2178846A00EACBCD /* headers */,
 				1A3E5EAD23E9FB1300EDE661 /* cgl.mm */,
+				1AFD334023E03C4F0042899B /* controlhost.mm */,
 				5BF943652167AD1D009CAE35 /* cursor.h */,
 				5B21A981216530F500CEE36E /* cursor.mm */,
 				5B8BD94E215BFEA6005ED2A7 /* clipboard.mm */,
@@ -191,6 +197,7 @@
 			files = (
 				1A002B9E232135EE00021753 /* app.mm in Sources */,
 				5B8BD94F215BFEA6005ED2A7 /* clipboard.mm in Sources */,
+				1A1852DC23E05814008F0DED /* deadlock.mm in Sources */,
 				5B21A982216530F500CEE36E /* cursor.mm in Sources */,
 				37DDA9B0219330F8002E132B /* AvnString.mm in Sources */,
 				AB8F7D6B21482D7F0057DBA5 /* platformthreading.mm in Sources */,
@@ -199,6 +206,7 @@
 				37E2330F21583241000CB7E2 /* KeyTransform.mm in Sources */,
 				520624B322973F4100C4DCEF /* menu.mm in Sources */,
 				37A517B32159597E00FBA241 /* Screens.mm in Sources */,
+				1AFD334123E03C4F0042899B /* controlhost.mm in Sources */,
 				1A465D10246AB61600C5858B /* dnd.mm in Sources */,
 				AB00E4F72147CA920032A60A /* main.mm in Sources */,
 				37C09D8821580FE4006A6758 /* SystemDialogs.mm in Sources */,

+ 1 - 0
native/Avalonia.Native/src/OSX/AvnString.h

@@ -12,4 +12,5 @@
 extern IAvnString* CreateAvnString(NSString* string);
 extern IAvnStringArray* CreateAvnStringArray(NSArray<NSString*>* array);
 extern IAvnStringArray* CreateAvnStringArray(NSString* string);
+extern IAvnString* CreateByteArray(void* data, int len);
 #endif /* AvnString_h */

+ 12 - 0
native/Avalonia.Native/src/OSX/AvnString.mm

@@ -29,6 +29,13 @@ public:
         memcpy((void*)_cstring, (void*)cstring, _length);
     }
     
+    AvnStringImpl(void*ptr, int len)
+    {
+        _length = len;
+        _cstring = (const char*)malloc(_length);
+        memcpy((void*)_cstring, ptr, len);
+    }
+    
     virtual ~AvnStringImpl()
     {
         free((void*)_cstring);
@@ -114,3 +121,8 @@ IAvnStringArray* CreateAvnStringArray(NSString* string)
 {
     return new AvnStringArrayImpl(string);
 }
+
+IAvnString* CreateByteArray(void* data, int len)
+{
+    return new AvnStringImpl(data, len);
+}

+ 35 - 1
native/Avalonia.Native/src/OSX/app.mm

@@ -29,9 +29,43 @@ NSApplicationActivationPolicy AvnDesiredActivationPolicy = NSApplicationActivati
 
 @end
 
+@interface AvnApplication : NSApplication
+
+
+@end
+
+@implementation AvnApplication
+{
+    BOOL _isHandlingSendEvent;
+}
+
+- (void)sendEvent:(NSEvent *)event
+{
+    bool oldHandling = _isHandlingSendEvent;
+    _isHandlingSendEvent = true;
+    @try {
+        [super sendEvent: event];
+    } @finally {
+        _isHandlingSendEvent = oldHandling;
+    }
+}
+
+// This is needed for certain embedded controls
+- (BOOL) isHandlingSendEvent
+{
+    return _isHandlingSendEvent;
+}
+
+- (void)setHandlingSendEvent:(BOOL)handlingSendEvent
+{
+    _isHandlingSendEvent = handlingSendEvent;
+}
+
+@end
+
 extern void InitializeAvnApp()
 {
-    NSApplication* app = [NSApplication sharedApplication];
+    NSApplication* app = [AvnApplication sharedApplication];
     id delegate = [AvnAppDelegate new];
     [app setDelegate:delegate];
 }

+ 34 - 0
native/Avalonia.Native/src/OSX/clipboard.mm

@@ -82,6 +82,40 @@ public:
         
         return S_OK;
     }
+    
+    virtual HRESULT SetBytes(char* type, void* bytes, int len) override
+    {
+        auto typeString = [NSString stringWithUTF8String:(const char*)type];
+        auto data = [NSData dataWithBytes:bytes length:len];
+        if(_item == nil)
+            [_pb setData:data forType:typeString];
+        else
+            [_item setData:data forType:typeString];
+        return S_OK;
+    }
+       
+    virtual HRESULT GetBytes(char* type, IAvnString**ppv) override
+    {
+        *ppv = nil;
+        auto typeString = [NSString stringWithUTF8String:(const char*)type];
+        NSData*data;
+        @try
+        {
+            if(_item)
+                data = [_item dataForType:typeString];
+            else
+                data = [_pb dataForType:typeString];
+            if(data == nil)
+                return E_FAIL;
+        }
+        @catch(NSException* e)
+        {
+            return E_FAIL;
+        }
+        *ppv = CreateByteArray((void*)data.bytes, (int)data.length);
+        return S_OK;
+    }
+
 
     virtual HRESULT Clear() override
     {

+ 9 - 0
native/Avalonia.Native/src/OSX/common.h

@@ -24,6 +24,7 @@ extern IAvnGlDisplay* GetGlDisplay();
 extern IAvnMenu* CreateAppMenu(IAvnMenuEvents* events);
 extern IAvnMenuItem* CreateAppMenuItem();
 extern IAvnMenuItem* CreateAppMenuItemSeperator();
+extern IAvnNativeControlHost* CreateNativeControlHost(NSView* parent);
 extern void SetAppMenu (NSString* appName, IAvnMenu* appMenu);
 extern IAvnMenu* GetAppMenu ();
 extern NSMenuItem* GetAppMenuItem ();
@@ -54,4 +55,12 @@ template<typename T> inline T* objc_cast(id from) {
 - (void) action;
 @end
 
+class AvnInsidePotentialDeadlock
+{
+public:
+    static bool IsInside();
+    AvnInsidePotentialDeadlock();
+    ~AvnInsidePotentialDeadlock();
+};
+
 #endif

+ 160 - 0
native/Avalonia.Native/src/OSX/controlhost.mm

@@ -0,0 +1,160 @@
+#include "common.h"
+
+
+IAvnNativeControlHostTopLevelAttachment* CreateAttachment();
+
+class AvnNativeControlHost :
+    public ComSingleObject<IAvnNativeControlHost, &IID_IAvnNativeControlHost>
+{
+public:
+    FORWARD_IUNKNOWN();
+    NSView* View;
+    AvnNativeControlHost(NSView* view)
+    {
+        View = view;
+    }
+    
+    virtual HRESULT CreateDefaultChild(void* parent, void** retOut) override
+    {
+        NSView* view = [NSView new];
+        [view setWantsLayer: true];
+        
+        *retOut = (__bridge_retained void*)view;
+        return S_OK;
+    };
+    
+    virtual IAvnNativeControlHostTopLevelAttachment* CreateAttachment() override
+    {
+        return ::CreateAttachment();
+    };
+    
+    virtual void DestroyDefaultChild(void* child) override
+    {
+        // ARC will release the object for us
+        (__bridge_transfer NSView*) child;
+    }
+};
+
+class AvnNativeControlHostTopLevelAttachment :
+public ComSingleObject<IAvnNativeControlHostTopLevelAttachment, &IID_IAvnNativeControlHostTopLevelAttachment>
+{
+    NSView* _holder;
+    NSView* _child;
+public:
+    FORWARD_IUNKNOWN();
+    
+    AvnNativeControlHostTopLevelAttachment()
+    {
+        _holder = [NSView new];
+        [_holder setWantsLayer:true];
+    }
+    
+    virtual ~AvnNativeControlHostTopLevelAttachment()
+    {
+        if(_child != nil && [_child superview] == _holder)
+        {
+            [_child removeFromSuperview];
+        }
+        
+        if([_holder superview] != nil)
+        {
+            [_holder removeFromSuperview];
+        }
+    }
+    
+    virtual void* GetParentHandle() override
+    {
+        return (__bridge void*)_holder;
+    };
+    
+    virtual HRESULT InitializeWithChildHandle(void* child) override
+    {
+        if(_child != nil)
+            return E_FAIL;
+        _child = (__bridge NSView*)child;
+        if(_child == nil)
+            return E_FAIL;
+        [_holder addSubview:_child];
+        [_child setHidden: false];
+        return S_OK;
+    };
+    
+    virtual HRESULT AttachTo(IAvnNativeControlHost* host) override
+    {
+        if(host == nil)
+        {
+            [_holder removeFromSuperview];
+            [_holder setHidden: true];
+        }
+        else
+        {
+            AvnNativeControlHost* chost = dynamic_cast<AvnNativeControlHost*>(host);
+            if(chost == nil || chost->View == nil)
+                return E_FAIL;
+            [_holder setHidden:true];
+            [chost->View addSubview:_holder];
+        }
+        return S_OK;
+    };
+    
+    virtual void ShowInBounds(float x, float y, float width, float height) override
+    {
+        if(_child == nil)
+            return;
+        if(AvnInsidePotentialDeadlock::IsInside())
+        {
+            IAvnNativeControlHostTopLevelAttachment* slf = this;
+            slf->AddRef();
+            dispatch_async(dispatch_get_main_queue(), ^{
+                slf->ShowInBounds(x, y, width, height);
+                slf->Release();
+            });
+            return;
+        }
+        
+        NSRect childFrame = {0, 0, width, height};
+        NSRect holderFrame = {x, y, width, height};
+        
+        [_child setFrame: childFrame];
+        [_holder setFrame: holderFrame];
+        [_holder setHidden: false];
+        if([_holder superview] != nil)
+            [[_holder superview] setNeedsDisplay:true];
+    }
+    
+    virtual void HideWithSize(float width, float height) override
+    {
+        if(_child == nil)
+            return;
+        if(AvnInsidePotentialDeadlock::IsInside())
+        {
+            IAvnNativeControlHostTopLevelAttachment* slf = this;
+            slf->AddRef();
+            dispatch_async(dispatch_get_main_queue(), ^{
+                slf->HideWithSize(width, height);
+                slf->Release();
+            });
+            return;
+        }
+        
+        NSRect frame = {0, 0, width, height};
+        [_holder setHidden: true];
+        [_child setFrame: frame];
+    }
+    
+    virtual void ReleaseChild() override
+    {
+        [_child removeFromSuperview];
+        _child = nil;
+    }
+};
+
+IAvnNativeControlHostTopLevelAttachment* CreateAttachment()
+{
+    return new AvnNativeControlHostTopLevelAttachment();
+}
+
+extern IAvnNativeControlHost* CreateNativeControlHost(NSView* parent)
+{
+    return new AvnNativeControlHost(parent);
+}

+ 17 - 0
native/Avalonia.Native/src/OSX/deadlock.mm

@@ -0,0 +1,17 @@
+#include "common.h"
+
+static int Counter = 0;
+AvnInsidePotentialDeadlock::AvnInsidePotentialDeadlock()
+{
+    Counter++;
+}
+
+AvnInsidePotentialDeadlock::~AvnInsidePotentialDeadlock()
+{
+    Counter--;
+}
+
+bool AvnInsidePotentialDeadlock::IsInside()
+{
+    return Counter!=0;
+}

+ 10 - 3
native/Avalonia.Native/src/OSX/window.h

@@ -3,9 +3,6 @@
 
 class WindowBaseImpl;
 
-@interface AutoFitContentVisualEffectView : NSVisualEffectView
-@end
-
 @interface AvnView : NSView<NSTextInputClient, NSDraggingDestination>
 -(AvnView* _Nonnull) initWithParent: (WindowBaseImpl* _Nonnull) parent;
 -(NSEvent* _Nonnull) lastMouseDownEvent;
@@ -15,6 +12,14 @@ class WindowBaseImpl;
 -(AvnPixelSize) getPixelSize;
 @end
 
+@interface AutoFitContentView : NSView
+-(AutoFitContentView* _Nonnull) initWithContent: (NSView* _Nonnull) content;
+-(void) ShowTitleBar: (bool) show;
+-(void) SetTitleBarHeightHint: (double) height;
+-(void) SetContent: (NSView* _Nonnull) content;
+-(void) ShowBlur: (bool) show;
+@end
+
 @interface AvnWindow : NSWindow <NSWindowDelegate>
 +(void) closeAll;
 -(AvnWindow* _Nonnull) initWithParent: (WindowBaseImpl* _Nonnull) parent;
@@ -27,6 +32,8 @@ class WindowBaseImpl;
 -(void) showWindowMenuWithAppMenu;
 -(void) applyMenu:(NSMenu* _Nullable)menu;
 -(double) getScaling;
+-(double) getExtendedTitleBarHeight;
+-(void) setIsExtended:(bool)value;
 @end
 
 struct INSWindowHolder

+ 347 - 40
native/Avalonia.Native/src/OSX/window.mm

@@ -6,8 +6,6 @@
 #include <OpenGL/gl.h>
 #include "rendertarget.h"
 
-
-
 class WindowBaseImpl : public virtual ComSingleObject<IAvnWindowBase, &IID_IAvnWindowBase>, public INSWindowHolder
 {
 private:
@@ -20,7 +18,7 @@ public:
         View = NULL;
         Window = NULL;
     }
-    NSVisualEffectView* VisualEffect;
+    AutoFitContentView* StandardContainer;
     AvnView* View;
     AvnWindow* Window;
     ComPtr<IAvnWindowBaseEvents> BaseEvents;
@@ -39,6 +37,7 @@ public:
         _glContext = gl;
         renderTarget = [[IOSurfaceRenderTarget alloc] initWithOpenGlContext: gl];
         View = [[AvnView alloc] initWithParent:this];
+        StandardContainer = [[AutoFitContentView new] initWithContent:View];
 
         Window = [[AvnWindow alloc] initWithParent:this];
         
@@ -49,12 +48,8 @@ public:
         [Window setStyleMask:NSWindowStyleMaskBorderless];
         [Window setBackingType:NSBackingStoreBuffered];
         
-        VisualEffect = [AutoFitContentVisualEffectView new];
-        [VisualEffect setBlendingMode:NSVisualEffectBlendingModeBehindWindow];
-        [VisualEffect setMaterial:NSVisualEffectMaterialLight];
-        [VisualEffect setAutoresizesSubviews:true];
-        
-        [Window setContentView: View];
+        [Window setOpaque:false];
+        [Window setContentView: StandardContainer];
     }
     
     virtual HRESULT ObtainNSWindowHandle(void** ret) override
@@ -116,10 +111,15 @@ public:
         {
             SetPosition(lastPositionSet);
             UpdateStyle();
-            
-            [Window makeKeyAndOrderFront:Window];
-            [NSApp activateIgnoringOtherApps:YES];
-            
+            if(ShouldTakeFocusOnShow())
+            {
+                [Window makeKeyAndOrderFront:Window];
+                [NSApp activateIgnoringOtherApps:YES];
+            }
+            else
+            {
+                [Window orderFront: Window];
+            }
             [Window setTitle:_lastTitle];
             
             _shown = true;
@@ -128,6 +128,11 @@ public:
         }
     }
     
+    virtual bool ShouldTakeFocusOnShow()
+    {
+        return true;
+    }
+    
     virtual HRESULT Hide () override
     {
         @autoreleasepool
@@ -390,14 +395,17 @@ public:
         return *ppv == nil ? E_FAIL : S_OK;
     }
     
+    virtual HRESULT CreateNativeControlHost(IAvnNativeControlHost** retOut) override
+    {
+        if(View == NULL)
+            return E_FAIL;
+        *retOut = ::CreateNativeControlHost(View);
+        return S_OK;
+    }
+    
     virtual HRESULT SetBlurEnabled (bool enable) override
     {
-        [Window setContentView: enable ? VisualEffect : View];
-        
-        if(enable)
-        {
-            [VisualEffect addSubview:View];
-        }
+        [StandardContainer ShowBlur:enable];
         
         return S_OK;
     }
@@ -474,6 +482,8 @@ private:
     bool _inSetWindowState;
     NSRect _preZoomSize;
     bool _transitioningWindowState;
+    bool _isClientAreaExtended;
+    AvnExtendClientAreaChromeHints _extendClientHints;
     
     FORWARD_IUNKNOWN()
     BEGIN_INTERFACE_MAP()
@@ -487,6 +497,8 @@ private:
     ComPtr<IAvnWindowEvents> WindowEvents;
     WindowImpl(IAvnWindowEvents* events, IAvnGlContext* gl) : WindowBaseImpl(events, gl)
     {
+        _isClientAreaExtended = false;
+        _extendClientHints = AvnDefaultChrome;
         _fullScreenActive = false;
         _canResize = true;
         _decorations = SystemDecorationsFull;
@@ -505,8 +517,20 @@ private:
             if ([subview isKindOfClass:NSClassFromString(@"NSTitlebarContainerView")]) {
                 NSView *titlebarView = [subview subviews][0];
                 for (id button in titlebarView.subviews) {
-                    if ([button isKindOfClass:[NSButton class]]) {
-                        [button setHidden: (_decorations != SystemDecorationsFull)];
+                    if ([button isKindOfClass:[NSButton class]])
+                    {
+                        if(_isClientAreaExtended)
+                        {
+                            auto wantsChrome = (_extendClientHints & AvnSystemChrome) || (_extendClientHints & AvnPreferSystemChrome);
+                            
+                            [button setHidden: !wantsChrome];
+                        }
+                        else
+                        {
+                            [button setHidden: (_decorations != SystemDecorationsFull)];
+                        }
+                        
+                        [button setWantsLayer:true];
                     }
                 }
             }
@@ -582,6 +606,35 @@ private:
             
             if(_lastWindowState != state)
             {
+                if(_isClientAreaExtended)
+                {
+                    if(_lastWindowState == FullScreen)
+                    {
+                        // we exited fs.
+                       if(_extendClientHints & AvnOSXThickTitleBar)
+                       {
+                          Window.toolbar = [NSToolbar new];
+                          Window.toolbar.showsBaselineSeparator = false;
+                       }
+
+                       [Window setTitlebarAppearsTransparent:true];
+
+                       [StandardContainer setFrameSize: StandardContainer.frame.size];
+                    }
+                    else if(state == FullScreen)
+                    {
+                        // we entered fs.
+                        if(_extendClientHints & AvnOSXThickTitleBar)
+                        {
+                            Window.toolbar = nullptr;
+                        }
+                       
+                        [Window setTitlebarAppearsTransparent:false];
+                        
+                        [StandardContainer setFrameSize: StandardContainer.frame.size];
+                    }
+                }
+                
                 _lastWindowState = state;
                 WindowEvents->WindowStateChanged(state);
             }
@@ -638,8 +691,6 @@ private:
                 return S_OK;
             }
             
-            auto currentFrame = [Window frame];
-            
             UpdateStyle();
             
             HideOrShowTrafficLights();
@@ -766,6 +817,90 @@ private:
         }
     }
     
+    virtual HRESULT TakeFocusFromChildren () override
+    {
+        if(Window == nil)
+            return S_OK;
+        if([Window isKeyWindow])
+            [Window makeFirstResponder: View];
+        
+        return S_OK;
+    }
+    
+    virtual HRESULT SetExtendClientArea (bool enable) override
+    {
+        _isClientAreaExtended = enable;
+        
+        if(enable)
+        {
+            Window.titleVisibility = NSWindowTitleHidden;
+            
+            [Window setTitlebarAppearsTransparent:true];
+            
+            auto wantsTitleBar = (_extendClientHints & AvnSystemChrome) || (_extendClientHints & AvnPreferSystemChrome);
+            
+            if (wantsTitleBar)
+            {
+                [StandardContainer ShowTitleBar:true];
+            }
+            else
+            {
+                [StandardContainer ShowTitleBar:false];
+            }
+            
+            if(_extendClientHints & AvnOSXThickTitleBar)
+            {
+                Window.toolbar = [NSToolbar new];
+                Window.toolbar.showsBaselineSeparator = false;
+            }
+            else
+            {
+                Window.toolbar = nullptr;
+            }
+        }
+        else
+        {
+            Window.titleVisibility = NSWindowTitleVisible;
+            Window.toolbar = nullptr;
+            [Window setTitlebarAppearsTransparent:false];
+            View.layer.zPosition = 0;
+        }
+        
+        [Window setIsExtended:enable];
+        
+        HideOrShowTrafficLights();
+        
+        UpdateStyle();
+        
+        return S_OK;
+    }
+    
+    virtual HRESULT SetExtendClientAreaHints (AvnExtendClientAreaChromeHints hints) override
+    {
+        _extendClientHints = hints;
+        
+        SetExtendClientArea(_isClientAreaExtended);
+        return S_OK;
+    }
+    
+    virtual HRESULT GetExtendTitleBarHeight (double*ret) override
+    {
+        if(ret == nullptr)
+        {
+            return E_POINTER;
+        }
+        
+        *ret = [Window getExtendedTitleBarHeight];
+        
+        return S_OK;
+    }
+    
+    virtual HRESULT SetExtendTitleBarHeight (double value) override
+    {
+        [StandardContainer SetTitleBarHeightHint:value];
+        return S_OK;
+    }
+    
     void EnterFullScreenMode ()
     {
         _fullScreenActive = true;
@@ -775,8 +910,9 @@ private:
         [Window setTitlebarAppearsTransparent:NO];
         [Window setTitle:_lastTitle];
         
-        [Window setStyleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskResizable];
-        
+        Window.styleMask = Window.styleMask | NSWindowStyleMaskTitled | NSWindowStyleMaskResizable;
+        Window.styleMask = Window.styleMask & ~NSWindowStyleMaskFullSizeContentView;
+    
         [Window toggleFullScreen:nullptr];
     }
     
@@ -924,19 +1060,120 @@ protected:
         {
             s |= NSWindowStyleMaskMiniaturizable;
         }
+        
+        if(_isClientAreaExtended)
+        {
+            s |= NSWindowStyleMaskFullSizeContentView | NSWindowStyleMaskTexturedBackground;
+        }
         return s;
     }
 };
 
 NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEventTrackingRunLoopMode, NSModalPanelRunLoopMode, NSRunLoopCommonModes, NSConnectionReplyMode, nil];
 
-@implementation AutoFitContentVisualEffectView
+@implementation AutoFitContentView
+{
+    NSVisualEffectView* _titleBarMaterial;
+    NSBox* _titleBarUnderline;
+    NSView* _content;
+    NSVisualEffectView* _blurBehind;
+    double _titleBarHeightHint;
+    bool _settingSize;
+}
+
+-(AutoFitContentView* _Nonnull) initWithContent:(NSView *)content
+{
+    _titleBarHeightHint = -1;
+    _content = content;
+    _settingSize = false;
+
+    [self setAutoresizesSubviews:true];
+    [self setWantsLayer:true];
+    
+    _titleBarMaterial = [NSVisualEffectView new];
+    [_titleBarMaterial setBlendingMode:NSVisualEffectBlendingModeWithinWindow];
+    [_titleBarMaterial setMaterial:NSVisualEffectMaterialTitlebar];
+    [_titleBarMaterial setWantsLayer:true];
+    _titleBarMaterial.hidden = true;
+    
+    _titleBarUnderline = [NSBox new];
+    _titleBarUnderline.boxType = NSBoxSeparator;
+    _titleBarUnderline.fillColor = [NSColor underPageBackgroundColor];
+    _titleBarUnderline.hidden = true;
+    
+    [self addSubview:_titleBarMaterial];
+    [self addSubview:_titleBarUnderline];
+    
+    _blurBehind = [NSVisualEffectView new];
+    [_blurBehind setBlendingMode:NSVisualEffectBlendingModeBehindWindow];
+    [_blurBehind setMaterial:NSVisualEffectMaterialLight];
+    [_blurBehind setWantsLayer:true];
+    _blurBehind.hidden = true;
+    
+    [self addSubview:_blurBehind];
+    [self addSubview:_content];
+    
+    [self setWantsLayer:true];
+    return self;
+}
+
+-(void) ShowBlur:(bool)show
+{
+    _blurBehind.hidden = !show;
+}
+
+-(void) ShowTitleBar: (bool) show
+{
+    _titleBarMaterial.hidden = !show;
+    _titleBarUnderline.hidden = !show;
+}
+
+-(void) SetTitleBarHeightHint: (double) height
+{
+    _titleBarHeightHint = height;
+    
+    [self setFrameSize:self.frame.size];
+}
+
 -(void)setFrameSize:(NSSize)newSize
 {
-    [super setFrameSize:newSize];
-    if([[self subviews] count] == 0)
+    if(_settingSize)
+    {
         return;
-    [[self subviews][0] setFrameSize: newSize];
+    }
+    
+    _settingSize = true;
+    [super setFrameSize:newSize];
+    
+    [_blurBehind setFrameSize:newSize];
+    [_content setFrameSize:newSize];
+    
+    auto window = objc_cast<AvnWindow>([self window]);
+    
+    // TODO get actual titlebar size
+    
+    double height = _titleBarHeightHint == -1 ? [window getExtendedTitleBarHeight] : _titleBarHeightHint;
+    
+    NSRect tbar;
+    tbar.origin.x = 0;
+    tbar.origin.y = newSize.height - height;
+    tbar.size.width = newSize.width;
+    tbar.size.height = height;
+    
+    [_titleBarMaterial setFrame:tbar];
+    tbar.size.height = height < 1 ? 0 : 1;
+    [_titleBarUnderline setFrame:tbar];
+    _settingSize = false;
+}
+
+-(void) SetContent: (NSView* _Nonnull) content
+{
+    if(content != nullptr)
+    {
+        [content removeFromSuperview];
+        [self addSubview:content];
+        _content = content;
+    }
 }
 @end
 
@@ -1060,9 +1297,9 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
     _parent->BaseEvents->Resized(AvnSize{newSize.width, newSize.height});
 }
 
-
 - (void)updateLayer
 {
+    AvnInsidePotentialDeadlock deadlock;
     if (_parent == nullptr)
     {
         return;
@@ -1107,7 +1344,11 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
     _lastPixelSize.Width = (int)fsize.width;
     _lastPixelSize.Height = (int)fsize.height;
     [self updateRenderTarget];
-    _parent->BaseEvents->ScalingChanged([_parent->Window backingScaleFactor]);
+    
+    if(_parent != nullptr)
+    {
+        _parent->BaseEvents->ScalingChanged([_parent->Window backingScaleFactor]);
+    }
     
     [super viewDidChangeBackingProperties];
 }
@@ -1138,7 +1379,6 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
         return;
     }
     
-    [self becomeFirstResponder];
     auto localPoint = [self convertPoint:[event locationInWindow] toView:self];
     auto avnPoint = [self toAvnPoint:localPoint];
     auto point = [self translateLocalPoint:avnPoint];
@@ -1165,11 +1405,31 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
     auto timestamp = [event timestamp] * 1000;
     auto modifiers = [self getModifiers:[event modifierFlags]];
     
-    [self becomeFirstResponder];
-    _parent->BaseEvents->RawMouseEvent(type, timestamp, modifiers, point, delta);
+    if(type != AvnRawMouseEventType::Move ||
+       (
+           [self window] != nil &&
+           (
+                [[self window] firstResponder] == nil
+                || ![[[self window] firstResponder] isKindOfClass: [NSView class]]
+           )
+       )
+    )
+        [self becomeFirstResponder];
+    
+    if(_parent != nullptr)
+    {
+        _parent->BaseEvents->RawMouseEvent(type, timestamp, modifiers, point, delta);
+    }
+    
     [super mouseMoved:event];
 }
 
+- (BOOL) resignFirstResponder
+{
+    _parent->BaseEvents->LostFocus();
+    return YES;
+}
+
 - (void)mouseMoved:(NSEvent *)event
 {
     [self mouseEvent:event withType:Move];
@@ -1290,7 +1550,10 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
     auto timestamp = [event timestamp] * 1000;
     auto modifiers = [self getModifiers:[event modifierFlags]];
      
-    _lastKeyHandled = _parent->BaseEvents->RawKeyEvent(type, timestamp, modifiers, key);
+    if(_parent != nullptr)
+    {
+        _lastKeyHandled = _parent->BaseEvents->RawKeyEvent(type, timestamp, modifiers, key);
+    }
 }
 
 - (BOOL)performKeyEquivalent:(NSEvent *)event
@@ -1381,7 +1644,10 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
 {
     if(!_lastKeyHandled)
     {
-        _lastKeyHandled = _parent->BaseEvents->RawTextInputEvent(0, [string UTF8String]);
+        if(_parent != nullptr)
+        {
+            _lastKeyHandled = _parent->BaseEvents->RawTextInputEvent(0, [string UTF8String]);
+        }
     }
 }
 
@@ -1467,15 +1733,43 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
     bool _canBecomeKeyAndMain;
     bool _closed;
     bool _isEnabled;
+    bool _isExtended;
     AvnMenu* _menu;
     double _lastScaling;
 }
 
+-(void) setIsExtended:(bool)value;
+{
+    _isExtended = value;
+}
+
 -(double) getScaling
 {
     return _lastScaling;
 }
 
+-(double) getExtendedTitleBarHeight
+{
+    if(_isExtended)
+    {
+        for (id subview in self.contentView.superview.subviews)
+        {
+            if ([subview isKindOfClass:NSClassFromString(@"NSTitlebarContainerView")])
+            {
+                NSView *titlebarView = [subview subviews][0];
+
+                return (double)titlebarView.frame.size.height;
+            }
+        }
+
+        return -1;
+    }
+    else
+    {
+        return 0;
+    }
+}
+
 +(void)closeAll
 {
     NSArray<NSWindow*>* windows = [NSArray arrayWithArray:[NSApp windows]];
@@ -1594,6 +1888,7 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
     [self setOpaque:NO];
     [self setBackgroundColor: [NSColor clearColor]];
     [self invalidateShadow];
+    _isExtended = false;
     return self;
 }
 
@@ -1677,7 +1972,11 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
     {
         [self showWindowMenuWithAppMenu];
         
-        _parent->BaseEvents->Activated();
+        if(_parent != nullptr)
+        {
+            _parent->BaseEvents->Activated();
+        }
+        
         [super becomeKeyWindow];
     }
 }
@@ -1794,8 +2093,12 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
 - (void)windowDidMove:(NSNotification *)notification
 {
     AvnPoint position;
-    _parent->GetPosition(&position);
-    _parent->BaseEvents->PositionChanged(position);
+    
+    if(_parent != nullptr)
+    {
+        _parent->GetPosition(&position);
+        _parent->BaseEvents->PositionChanged(position);
+    }
 }
 @end
 
@@ -1813,7 +2116,6 @@ private:
         WindowEvents = events;
         [Window setLevel:NSPopUpMenuWindowLevel];
     }
-    
 protected:
     virtual NSWindowStyleMask GetStyle() override
     {
@@ -1831,6 +2133,11 @@ protected:
             return S_OK;
         }
     }
+public:
+    virtual bool ShouldTakeFocusOnShow() override
+    {
+        return false;
+    }
 };
 
 extern IAvnPopup* CreateAvnPopup(IAvnWindowEvents*events, IAvnGlContext* gl)

+ 4 - 2
nukebuild/Build.cs

@@ -101,7 +101,7 @@ partial class Build : NukeBuild
             .SetProjectFile(projectFile)
             // This is required for VS2019 image on Azure Pipelines
             .When(Parameters.IsRunningOnWindows &&
-                  Parameters.IsRunningOnAzure, c => c
+                  Parameters.IsRunningOnAzure, _ => _
                 .AddProperty("JavaSdkDirectory", GetVariable<string>("JAVA_HOME_8_X64")))
             .AddProperty("PackageVersion", Parameters.Version)
             .AddProperty("iOSRoslynPathHackRequired", true)
@@ -176,7 +176,7 @@ partial class Build : NukeBuild
                 .SetFramework(fw)
                 .EnableNoBuild()
                 .EnableNoRestore()
-                .When(Parameters.PublishTestResults, c => c
+                .When(Parameters.PublishTestResults, _ => _
                     .SetLogger("trx")
                     .SetResultsDirectory(Parameters.TestResultsRoot)));
         }
@@ -268,6 +268,8 @@ partial class Build : NukeBuild
         .DependsOn(CreateIntermediateNugetPackages)
         .Executes(() =>
         {
+            BuildTasksPatcher.PatchBuildTasksInPackage(Parameters.NugetIntermediateRoot / "Avalonia.Build.Tasks." +
+                                                       Parameters.Version + ".nupkg");
             var config = Numerge.MergeConfiguration.LoadFile(RootDirectory / "nukebuild" / "numerge.config");
             EnsureCleanDirectory(Parameters.NugetRoot);
             if(!Numerge.NugetPackageMerger.Merge(Parameters.NugetIntermediateRoot, Parameters.NugetRoot, config,

+ 76 - 0
nukebuild/BuildTasksPatcher.cs

@@ -0,0 +1,76 @@
+using System;
+using System.IO;
+using System.IO.Compression;
+using System.Linq;
+using ILRepacking;
+using Mono.Cecil;
+
+public class BuildTasksPatcher
+{
+    public static void PatchBuildTasksInPackage(string packagePath)
+    {
+        using (var archive = new ZipArchive(File.Open(packagePath, FileMode.Open, FileAccess.ReadWrite),
+            ZipArchiveMode.Update))
+        {
+
+            foreach (var entry in archive.Entries.ToList())
+            {
+                if (entry.Name == "Avalonia.Build.Tasks.dll")
+                {
+                    var temp = Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".dll");
+                    var output = temp + ".output";
+                    var patched = new MemoryStream();
+                    try
+                    {
+                        entry.ExtractToFile(temp, true);
+                        var repack = new ILRepacking.ILRepack(new RepackOptions()
+                        {
+                            Internalize = true,
+                            InputAssemblies = new[]
+                            {
+                                temp, typeof(Mono.Cecil.AssemblyDefinition).Assembly.GetModules()[0]
+                                    .FullyQualifiedName
+                            },
+                            SearchDirectories = new string[0],
+                            OutputFile = output
+                        });
+                        repack.Repack();
+
+
+                        // 'hurr-durr assembly with the same name is already loaded' prevention
+                        using (var asm = AssemblyDefinition.ReadAssembly(output,
+                            new ReaderParameters { ReadWrite = true, InMemory = true, }))
+                        {
+                            asm.Name = new AssemblyNameDefinition(
+                                "Avalonia.Build.Tasks."
+                                + Guid.NewGuid().ToString().Replace("-", ""),
+                                new Version(0, 0, 0));
+                            asm.Write(patched);
+                            patched.Position = 0;
+                        }
+                    }
+                    finally
+                    {
+                        try
+                        {
+                            if (File.Exists(temp))
+                                File.Delete(temp);
+                            if (File.Exists(output))
+                                File.Delete(output);
+                        }
+                        catch
+                        {
+                            //ignore
+                        }
+                    }
+
+                    var fn = entry.FullName;
+                    entry.Delete();
+                    var newEntry = archive.CreateEntry(fn, CompressionLevel.Optimal);
+                    using (var s = newEntry.Open())
+                        patched.CopyTo(s);
+                }
+            }
+        }
+    }
+}

+ 1 - 1
nukebuild/Numerge

@@ -1 +1 @@
-Subproject commit 4464343aef5c8ab7a42fcb20a483a6058199f8b8
+Subproject commit aef10ae67dc55c95f49b52a505a0be33bfa297a5

+ 3 - 0
nukebuild/_build.csproj

@@ -14,6 +14,9 @@
     <PackageReference Include="xunit.runner.console" Version="2.3.1" />
     <PackageReference Include="JetBrains.dotMemoryUnit" Version="3.0.20171219.105559" />
     <PackageReference Include="vswhere" Version="2.6.7" Condition=" '$(OS)' == 'Windows_NT' " />
+    <PackageReference Include="ILRepack.NETStandard" Version="2.0.4" />
+    <!-- Keep in sync with Avalonia.Build.Tasks -->
+    <PackageReference Include="Avalonia.Unofficial.Cecil" Version="20190417.2.0" />
   </ItemGroup>
 
   <ItemGroup>

+ 4 - 0
packages/Avalonia/Avalonia.csproj

@@ -41,6 +41,10 @@
       <Pack>true</Pack>
       <PackagePath>build\</PackagePath>
     </Content>
+    <Content Include="AvaloniaItemSchema.xaml">
+      <Pack>true</Pack>
+      <PackagePath>build\</PackagePath>
+    </Content>
   </ItemGroup>
   <Import Project="..\..\build\SharedVersion.props" />
   <Import Project="..\..\build\NetFX.props" />

+ 9 - 1
packages/Avalonia/AvaloniaBuildTasks.props

@@ -1,3 +1,11 @@
 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
+  <ItemGroup>
+    <AvailableItemName Include="AvaloniaXaml" />
+    <AvailableItemName Include="AvaloniaResource" />
+    <PropertyPageSchema Include="$(MSBuildThisFileDirectory)AvaloniaItemSchema.xaml" />
+  </ItemGroup>
+  <ItemGroup Condition="'$(EnableDefaultItems)'=='True'">
+    <AvaloniaXaml Include="**\*.axaml" SubType="Designer" />
+    <AvaloniaXaml Include="**\*.paml" SubType="Designer" />
+  </ItemGroup>
 </Project>

+ 20 - 2
packages/Avalonia/AvaloniaBuildTasks.targets

@@ -4,6 +4,20 @@
     <_AvaloniaUseExternalMSBuild Condition="'$(_AvaloniaForceInternalMSBuild)' == 'true'">false</_AvaloniaUseExternalMSBuild>
     <AvaloniaXamlReportImportance Condition="'$(AvaloniaXamlReportImportance)' == ''">low</AvaloniaXamlReportImportance>
   </PropertyGroup>
+
+  <!-- Unfortunately we have to update default items in .targets since custom nuget props are improted before Microsoft.NET.Sdk.DefaultItems.props -->
+  <ItemGroup Condition="'$(EnableDefaultItems)'=='True'">
+    <Compile Update="**\*.paml.cs">
+      <DependentUpon>%(Filename)</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Update="**\*.axaml.cs">
+      <DependentUpon>%(Filename)</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <None Remove="**\*.axaml" />
+    <None Remove="**\*.paml" />
+  </ItemGroup>
   
   <UsingTask TaskName="GenerateAvaloniaResourcesTask"
              AssemblyFile="$(AvaloniaBuildTasksLocation)"
@@ -31,9 +45,12 @@
   
   <Target Name="GenerateAvaloniaResources" 
           BeforeTargets="CoreCompile;CoreResGen"
-          Inputs="@(AvaloniaResource);$(MSBuildAllProjects)"
+          Inputs="@(AvaloniaResource);@(AvaloniaXaml);$(MSBuildAllProjects)"
           Outputs="$(AvaloniaResourcesTemporaryFilePath)"
-          DependsOnTargets="$(BuildAvaloniaResourcesDependsOn)">
+	  DependsOnTargets="$(BuildAvaloniaResourcesDependsOn)">
+    <ItemGroup>
+        <AvaloniaResource Include="@(AvaloniaXaml)"/>
+    </ItemGroup>
     <GenerateAvaloniaResourcesTask
       Condition="'$(_AvaloniaUseExternalMSBuild)' != 'true'"
       Output="$(AvaloniaResourcesTemporaryFilePath)"
@@ -79,5 +96,6 @@
   
   <ItemGroup>
     <UpToDateCheckInput Include="@(AvaloniaResource)" />
+    <UpToDateCheckInput Include="@(AvaloniaXaml)" />
   </ItemGroup>
 </Project>

+ 18 - 0
packages/Avalonia/AvaloniaItemSchema.xaml

@@ -0,0 +1,18 @@
+<ProjectSchemaDefinitions xmlns="http://schemas.microsoft.com/build/2009/properties">
+    <ContentType
+        Name="AvaloniaXaml"
+        DisplayName="Avalonia XAML"
+        ItemType="AvaloniaXaml">
+      <NameValuePair Name="DependentFileExtensions" Value=".cs" />
+      <NameValuePair Name="DefaultMetadata_SubType" Value="Designer" />
+    </ContentType>
+
+    <ItemType Name="AvaloniaXaml" DisplayName="Avalonia XAML" />
+    <FileExtension Name=".axaml" ContentType="AvaloniaXaml" />
+    <FileExtension Name=".paml" ContentType="AvaloniaXaml" />
+    <ContentType
+        Name="AvaloniaResource"
+        DisplayName="Avalonia Resource"
+        ItemType="AvaloniaResource"
+    />
+</ProjectSchemaDefinitions>

+ 22 - 15
readme.md

@@ -1,24 +1,20 @@
-<img src='https://avatars2.githubusercontent.com/u/14075148?s=200&v=4' width='100' />
+[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/AvaloniaUI/Avalonia?utm_campaign=pr-badge&utm_content=badge&utm_medium=badge&utm_source=badge) [![Build Status](https://dev.azure.com/AvaloniaUI/AvaloniaUI/_apis/build/status/AvaloniaUI.Avalonia)](https://dev.azure.com/AvaloniaUI/AvaloniaUI/_build/latest?definitionId=4) [![Backers on Open Collective](https://opencollective.com/Avalonia/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/Avalonia/sponsors/badge.svg)](#sponsors) ![License](https://img.shields.io/github/license/avaloniaui/avalonia.svg)
+<br />
+[![NuGet](https://img.shields.io/nuget/v/Avalonia.svg)](https://www.nuget.org/packages/Avalonia) [![downloads](https://img.shields.io/nuget/dt/avalonia)](https://www.nuget.org/packages/Avalonia) [![MyGet](https://img.shields.io/myget/avalonia-ci/vpre/Avalonia.svg?label=myget)](https://www.myget.org/gallery/avalonia-ci) ![Size](https://img.shields.io/github/repo-size/avaloniaui/avalonia.svg) 
 
-# Avalonia
+<img alt="Avalonia" src="https://user-images.githubusercontent.com/6759207/84897744-cab6d800-b0ae-11ea-8214-e5174d71f5c8.png" width="400"/>
 
-| Gitter Chat | Build Status (Win, Linux, OSX) | Open Collective | NuGet | MyGet |
-|---|---|---|---|---|
-|  [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/AvaloniaUI/Avalonia?utm_campaign=pr-badge&utm_content=badge&utm_medium=badge&utm_source=badge) | [![Build Status](https://dev.azure.com/AvaloniaUI/AvaloniaUI/_apis/build/status/AvaloniaUI.Avalonia)](https://dev.azure.com/AvaloniaUI/AvaloniaUI/_build/latest?definitionId=4) | [![Backers on Open Collective](https://opencollective.com/Avalonia/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/Avalonia/sponsors/badge.svg)](#sponsors) | [![NuGet](https://img.shields.io/nuget/v/Avalonia.svg)](https://www.nuget.org/packages/Avalonia) | [![MyGet](https://img.shields.io/myget/avalonia-ci/vpre/Avalonia.svg?label=myget)](https://www.myget.org/gallery/avalonia-ci) |
+## 📖 About AvaloniaUI 
 
-## About
+Avalonia is a cross-platform XAML-based UI framework providing a flexible styling system and supporting a wide range of Operating Systems such as Windows via .NET Framework and .NET Core, Linux via Xorg, macOS. Avalonia is ready for **General-Purpose Desktop App Development**. However, there may be some bugs and breaking changes as we continue along into this project's development. 
 
-**Avalonia** is a cross-platform XAML-based UI framework providing a flexible styling system and supporting a wide range of Operating Systems such as Windows (.NET Framework, .NET Core), Linux (via Xorg), macOS.
+<img src="https://user-images.githubusercontent.com/6759207/84751662-7c79da00-afc5-11ea-8780-dda28db70b76.png" width="700" />
 
-**Avalonia** is ready for **General-Purpose Desktop App Development**. However, there may be some bugs and breaking changes as we continue along into this project's development.
+> **Note:** The UI theme you see in the picture above is still work-in-progress and will be available in the upcoming Avalonia 0.10.0 release. However, you can connect to our nightly build feed and install latest pre-release versions of Avalonia NuGet packages, if you are willing to help out with the development and testing. See [Using nightly build feed](https://github.com/AvaloniaUI/Avalonia/wiki/Using-nightly-build-feed) for more info.
 
-To see the status of some of our features, please see our [Roadmap here](https://github.com/AvaloniaUI/Avalonia/issues/2239).
+To see the status of some of our features, please see our [Roadmap](https://github.com/AvaloniaUI/Avalonia/issues/2239). You can also see what [breaking changes](https://github.com/AvaloniaUI/Avalonia/issues/3538) we have planned and what our [past breaking changes](https://github.com/AvaloniaUI/Avalonia/wiki/Breaking-Changes) have been. [Awesome Avalonia](https://github.com/AvaloniaCommunity/awesome-avalonia) is community-curated list of awesome Avalonia UI tools, libraries, projects and resources. Go and see what people are building with Avalonia!
 
-You can also see what [breaking changes](https://github.com/AvaloniaUI/Avalonia/issues/3538) we have planned and what our [past breaking changes](https://github.com/AvaloniaUI/Avalonia/wiki/Breaking-Changes) have been.
-
-[Awesome Avalonia](https://github.com/AvaloniaCommunity/awesome-avalonia) is community-curated list of awesome Avalonia UI tools, libraries, projects and resources. Go and see what people are building with Avalonia!
-
-## Getting Started
+## 🚀 Getting Started
 
 The Avalonia [Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio) contains project and control templates that will help you get started, or you can use the .NET Core CLI. For a starer guide see our [documentation](http://avaloniaui.net/docs/quickstart/create-new-project).
 
@@ -30,6 +26,17 @@ Install-Package Avalonia
 Install-Package Avalonia.Desktop
 ```
 
+## Showcase
+
+Examples of UIs built with Avalonia
+![image](https://user-images.githubusercontent.com/4672627/84707589-5b69a880-af35-11ea-87a6-7ad57a31d314.png)
+
+![image](https://user-images.githubusercontent.com/4672627/85069644-d8419000-b18a-11ea-8732-be9055bb61fd.PNG)
+
+![image](https://user-images.githubusercontent.com/4672627/85069659-dc6dad80-b18a-11ea-8375-39ef95315b5c.PNG)
+
+![image](https://user-images.githubusercontent.com/4672627/84708947-c3b98980-af37-11ea-8c9d-503334615bbf.png)
+
 ## JetBrains Rider
 
 If you need to develop Avalonia app with JetBrains Rider, go and *vote* on [this issue](https://youtrack.jetbrains.com/issue/RIDER-39247) in their tracker. JetBrains won't do things without their users telling them that they want the feature, so only **YOU** can make it happen.
@@ -61,7 +68,7 @@ Avalonia is licenced under the [MIT licence](licence.md).
 
 ## Contributors
 
-This project exists thanks to all the people who contribute. [[Contribute](http://avaloniaui.net/contributing/contributing)].
+This project exists thanks to all the people who contribute. [[Contribute](http://avaloniaui.net/contributing)].
 <a href="https://github.com/AvaloniaUI/Avalonia/graphs/contributors"><img src="https://opencollective.com/Avalonia/contributors.svg?width=890&button=false" /></a>
 
 ### Backers

+ 0 - 2
samples/BindingDemo/App.xaml.cs

@@ -1,10 +1,8 @@
 using System;
 using Avalonia;
 using Avalonia.Controls;
-using Avalonia.Logging.Serilog;
 using Avalonia.Markup.Xaml;
 using Avalonia.ReactiveUI;
-using Serilog;
 
 namespace BindingDemo
 {

+ 0 - 1
samples/BindingDemo/BindingDemo.csproj

@@ -10,7 +10,6 @@
   </ItemGroup>
   <Import Project="..\..\build\SampleApp.props" />
   <Import Project="..\..\build\EmbedXaml.props" />
-  <Import Project="..\..\build\Serilog.props" />
   <Import Project="..\..\build\Rx.props" />
   <Import Project="..\..\build\ReactiveUI.props" />
   <Import Condition="'$(TargetFramework)'=='net461'" Project="..\..\build\NetFX.props" />

+ 3 - 2
samples/BindingDemo/MainWindow.xaml

@@ -5,7 +5,8 @@
         xmlns:local="clr-namespace:BindingDemo"
         Title="AvaloniaUI Bindings Test"
         Width="800"
-        Height="600">
+        Height="600"
+        x:DataType="vm:MainWindowViewModel">
   <Window.Styles>
     <Style Selector="TextBlock.h1">
       <Setter Property="FontSize" Value="18"/>
@@ -60,7 +61,7 @@
             <TextBlock FontSize="16" Text="Scheduler"/>
             <TextBox Watermark="Background Thread" Text="{Binding CurrentTime, Mode=OneWay}"/>
             <TextBlock FontSize="16" Text="Stream Operator"/>
-            <TextBox Watermark="StreamOperator" Text="{Binding CurrentTimeObservable^, Mode=OneWay}"/>
+            <TextBox Watermark="StreamOperator" Text="{CompiledBinding CurrentTimeObservable^, Mode=OneWay}"/>
           </StackPanel>
         </StackPanel>
       </StackPanel>

+ 2 - 2
samples/BindingDemo/ViewModels/MainWindowViewModel.cs

@@ -53,7 +53,7 @@ namespace BindingDemo.ViewModels
             });
 
             CurrentTimeObservable = Observable.Timer(TimeSpan.Zero, TimeSpan.FromSeconds(1))
-                .Select(x => DateTimeOffset.Now.ToString());
+                .Select(x => DateTimeOffset.Now);
         }
 
         public ObservableCollection<TestItem> Items { get; }
@@ -90,7 +90,7 @@ namespace BindingDemo.ViewModels
             private set { this.RaiseAndSetIfChanged(ref _currentTime, value); }
         }
 
-        public IObservable<string> CurrentTimeObservable { get; }
+        public IObservable<DateTimeOffset> CurrentTimeObservable { get; }
         public ReactiveCommand<object, Unit> StringValueCommand { get; }
 
         public DataAnnotationsErrorViewModel DataAnnotationsValidation { get; } = new DataAnnotationsErrorViewModel();

+ 0 - 1
samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj

@@ -10,6 +10,5 @@
   </ItemGroup>
 
   <Import Project="..\..\build\SampleApp.props" />
-  <Import Project="..\..\build\Serilog.props" />
   <Import Project="..\..\build\NetFX.props" />
 </Project>

+ 0 - 2
samples/ControlCatalog.Desktop/Program.cs

@@ -2,10 +2,8 @@ using System;
 using System.Linq;
 using Avalonia;
 using Avalonia.Controls;
-using Avalonia.Logging.Serilog;
 using Avalonia.Platform;
 using Avalonia.ReactiveUI;
-using Serilog;
 
 namespace ControlCatalog
 {

+ 2 - 1
samples/ControlCatalog.NetCore/ControlCatalog.NetCore.csproj

@@ -7,12 +7,13 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <ProjectReference Include="..\..\src\Avalonia.Headless.Vnc\Avalonia.Headless.Vnc.csproj" />
     <ProjectReference Include="..\..\src\Avalonia.Dialogs\Avalonia.Dialogs.csproj" />
     <ProjectReference Include="..\..\src\Linux\Avalonia.LinuxFramebuffer\Avalonia.LinuxFramebuffer.csproj" />
     <ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj" />
     <ProjectReference Include="..\..\src\Avalonia.Desktop\Avalonia.Desktop.csproj" />
     <ProjectReference Include="..\..\src\Avalonia.X11\Avalonia.X11.csproj" />
-    <PackageReference Include="Avalonia.Angle.Windows.Natives" Version="2.1.0.2019013001"/>
+    <PackageReference Include="Avalonia.Angle.Windows.Natives" Version="2.1.0.2019013001" />
   </ItemGroup>
 
 

+ 55 - 3
samples/ControlCatalog.NetCore/Program.cs

@@ -1,13 +1,18 @@
 using System;
-using System.Collections.Generic;
 using System.Diagnostics;
 using System.Globalization;
 using System.Linq;
 using System.Threading;
+using System.Threading.Tasks;
 using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Headless;
+using Avalonia.LogicalTree;
+using Avalonia.Skia;
 using Avalonia.ReactiveUI;
+using Avalonia.Threading;
 using Avalonia.Dialogs;
-using Avalonia.OpenGL;
 
 namespace ControlCatalog.NetCore
 {
@@ -42,6 +47,52 @@ namespace ControlCatalog.NetCore
                 SilenceConsole();
                 return builder.StartLinuxFbDev(args, scaling: GetScaling());
             }
+            else if (args.Contains("--vnc"))
+            {
+                return builder.StartWithHeadlessVncPlatform(null, 5901, args, ShutdownMode.OnMainWindowClose);
+            }
+            else if (args.Contains("--full-headless"))
+            {
+                return builder
+                    .UseHeadless(true)
+                    .AfterSetup(_ =>
+                    {
+                        DispatcherTimer.RunOnce(async () =>
+                        {
+                            var window = ((IClassicDesktopStyleApplicationLifetime)Application.Current.ApplicationLifetime)
+                                .MainWindow;
+                            var tc = window.GetLogicalDescendants().OfType<TabControl>().First();
+                            foreach (var page in tc.Items.Cast<TabItem>().ToList())
+                            {
+                                // Skip DatePicker because of some layout bug in grid
+                                if (page.Header.ToString() == "DatePicker")
+                                    continue;
+                                Console.WriteLine("Selecting " + page.Header);
+                                tc.SelectedItem = page;
+                                await Task.Delay(500);
+                            }
+                            Console.WriteLine("Selecting the first page");
+                            tc.SelectedItem = tc.Items.OfType<object>().First();
+                            await Task.Delay(500);
+                            Console.WriteLine("Clicked through all pages, triggering GC");
+                            for (var c = 0; c < 3; c++)
+                            {
+                                GC.Collect(2, GCCollectionMode.Forced);
+                                await Task.Delay(500);
+                            }
+
+                            void FormatMem(string metric, long bytes)
+                            {
+                                Console.WriteLine(metric + ": " + bytes / 1024 / 1024 + "MB");
+                            }
+
+                            FormatMem("GC allocated bytes", GC.GetTotalMemory(true));
+                            FormatMem("WorkingSet64", Process.GetCurrentProcess().WorkingSet64);
+
+                        }, TimeSpan.FromSeconds(1));
+                    })
+                    .StartWithClassicDesktopLifetime(args);
+            }
             else if (args.Contains("--drm"))
             {
                 SilenceConsole();
@@ -69,7 +120,8 @@ namespace ControlCatalog.NetCore
                 })
                 .UseSkia()
                 .UseReactiveUI()
-                .UseManagedSystemDialogs();
+                .UseManagedSystemDialogs()
+                .LogToDebug();
 
         static void SilenceConsole()
         {

+ 1 - 3
samples/ControlCatalog/App.xaml

@@ -1,9 +1,7 @@
 <Application xmlns="https://github.com/avaloniaui"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              x:Class="ControlCatalog.App">
-  <Application.Styles>
-    <StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml"/>
-    <StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseLight.xaml"/>
+  <Application.Styles>        
     <StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Default.xaml"/>
     <Style Selector="TextBlock.h1">
       <Setter Property="FontSize" Value="{DynamicResource FontSizeLarge}"/>

+ 45 - 0
samples/ControlCatalog/App.xaml.cs

@@ -1,14 +1,59 @@
+using System;
 using Avalonia;
 using Avalonia.Controls.ApplicationLifetimes;
 using Avalonia.Markup.Xaml;
+using Avalonia.Markup.Xaml.Styling;
+using Avalonia.Styling;
 
 namespace ControlCatalog
 {
     public class App : Application
     {
+        public static Styles FluentDark = new Styles
+        {
+            new StyleInclude(new Uri("avares://ControlCatalog/Styles"))
+            {
+                Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/FluentDark.xaml")
+            },
+        };
+
+        public static Styles FluentLight = new Styles
+        {
+            new StyleInclude(new Uri("avares://ControlCatalog/Styles"))
+            {
+                Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/FluentLight.xaml")
+            },
+        };
+
+        public static Styles DefaultLight = new Styles
+        {
+            new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
+            {
+                Source = new Uri("resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default")
+            },
+            new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
+            {
+                Source = new Uri("resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default")
+            },
+        };
+
+        public static Styles DefaultDark = new Styles
+        {
+            new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
+            {
+                Source = new Uri("resm:Avalonia.Themes.Default.Accents.BaseDark.xaml?assembly=Avalonia.Themes.Default")
+            },
+            new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
+            {
+                Source = new Uri("resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default")
+            },
+        };
+
         public override void Initialize()
         {
             AvaloniaXamlLoader.Load(this);
+
+            Styles.Insert(0, FluentDark);
         }
 
         public override void OnFrameworkInitializationCompleted()

+ 0 - 1
samples/ControlCatalog/ControlCatalog.csproj

@@ -28,6 +28,5 @@
     <ProjectReference Include="..\..\src\Avalonia.Controls.DataGrid\Avalonia.Controls.DataGrid.csproj" />
   </ItemGroup>
   
-  <Import Project="..\..\build\Serilog.props" />
   <Import Project="..\..\build\BuildTargets.targets" />
 </Project>

+ 16 - 5
samples/ControlCatalog/MainView.xaml

@@ -2,7 +2,7 @@
         xmlns:pages="clr-namespace:ControlCatalog.Pages"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         x:Class="ControlCatalog.MainView"
-        Background="Transparent"
+        Background="Black"
         Foreground="{DynamicResource ThemeForegroundBrush}"
         FontSize="{DynamicResource FontSizeNormal}">
   <Grid>
@@ -14,6 +14,7 @@
         </Style>
     </Grid.Styles>  
     <TabControl Classes="sidebar" Name="Sidebar">
+      <TabItem Header="Acrylic"><pages:AcrylicPage/></TabItem>
       <TabItem Header="AutoCompleteBox"><pages:AutoCompleteBoxPage/></TabItem>
       <TabItem Header="Border"><pages:BorderPage/></TabItem>
       <TabItem Header="Button"><pages:ButtonPage/></TabItem>
@@ -29,7 +30,11 @@
                ScrollViewer.HorizontalScrollBarVisibility="Disabled">
           <pages:DataGridPage/>
       </TabItem>
-      <TabItem Header="DatePicker"><pages:DatePickerPage/></TabItem>
+      <TabItem Header="Date/Time Picker">
+        <pages:DateTimePickerPage/>
+      </TabItem>
+      <TabItem Header="CalendarDatePicker">
+        <pages:CalendarDatePickerPage/></TabItem>
       <TabItem Header="Drag+Drop"><pages:DragAndDropPage/></TabItem>
       <TabItem Header="Expander"><pages:ExpanderPage/></TabItem>
       <TabItem Header="Image"
@@ -51,14 +56,18 @@
       <TabItem Header="Pointers (Touch)"><pages:PointersPage/></TabItem>
       <TabItem Header="ProgressBar"><pages:ProgressBarPage/></TabItem>
       <TabItem Header="RadioButton"><pages:RadioButtonPage/></TabItem>
+      <TabItem Header="ScrollViewer"><pages:ScrollViewerPage/></TabItem>
       <TabItem Header="Slider"><pages:SliderPage/></TabItem>
+      <TabItem Header="SplitView"><pages:SplitViewPage/></TabItem>
       <TabItem Header="TabControl"><pages:TabControlPage/></TabItem>
       <TabItem Header="TabStrip"><pages:TabStripPage/></TabItem>
       <TabItem Header="TextBox"><pages:TextBoxPage/></TabItem>
       <TabItem Header="TextBlock"><pages:TextBlockPage/></TabItem>
+      <TabItem Header="ToggleSwitch"><pages:ToggleSwitchPage/></TabItem>
       <TabItem Header="ToolTip"><pages:ToolTipPage/></TabItem>
       <TabItem Header="TreeView"><pages:TreeViewPage/></TabItem>
       <TabItem Header="Viewbox"><pages:ViewboxPage/></TabItem>
+      <TabItem Header="Window Customizations"><pages:WindowCustomizationsPage/></TabItem>
       <TabControl.Tag>
         <StackPanel Width="115" Spacing="4" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="8">
           <ComboBox x:Name="Decorations" SelectedIndex="0">
@@ -67,10 +76,12 @@
             <ComboBoxItem>Full Decorations</ComboBoxItem>
           </ComboBox>
           <ComboBox x:Name="Themes" SelectedIndex="0">
-            <ComboBoxItem>Light</ComboBoxItem>
-            <ComboBoxItem>Dark</ComboBoxItem>
+            <ComboBoxItem>Fluent - Dark</ComboBoxItem>
+            <ComboBoxItem>Fluent - Light</ComboBoxItem>
+            <ComboBoxItem>Simple - Light</ComboBoxItem>
+            <ComboBoxItem>Simple - Dark</ComboBoxItem>
           </ComboBox>
-          <ComboBox x:Name="TransparencyLevels" SelectedIndex="0">
+          <ComboBox x:Name="TransparencyLevels" SelectedIndex="{Binding TransparencyLevel}">
             <ComboBoxItem>None</ComboBoxItem>
             <ComboBoxItem>Transparent</ComboBoxItem>
             <ComboBoxItem>Blur</ComboBoxItem>

+ 9 - 21
samples/ControlCatalog/MainView.xaml.cs

@@ -32,30 +32,25 @@ namespace ControlCatalog
 
             }
 
-            var light = new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
-            {
-                Source = new Uri("resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default")
-            };
-            var dark = new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
-            {
-                Source = new Uri("resm:Avalonia.Themes.Default.Accents.BaseDark.xaml?assembly=Avalonia.Themes.Default")
-            };
-
-            
             var themes = this.Find<ComboBox>("Themes");
             themes.SelectionChanged += (sender, e) =>
             {
                 switch (themes.SelectedIndex)
                 {
                     case 0:
-                        Styles[0] = light;
+                        Application.Current.Styles[0] = App.FluentDark;
                         break;
                     case 1:
-                        Styles[0] = dark;
+                        Application.Current.Styles[0] = App.FluentLight;
+                        break;
+                    case 2:
+                        Application.Current.Styles[0] = App.DefaultLight;
+                        break;
+                    case 3:
+                        Application.Current.Styles[0] = App.DefaultDark;
                         break;
                 }
-            };
-            Styles.Add(light);
+            };            
 
             var decorations = this.Find<ComboBox>("Decorations");
             decorations.SelectionChanged += (sender, e) =>
@@ -63,13 +58,6 @@ namespace ControlCatalog
                 if (VisualRoot is Window window)
                     window.SystemDecorations = (SystemDecorations)decorations.SelectedIndex;
             };
-
-            var transparencyLevels = this.Find<ComboBox>("TransparencyLevels");
-            transparencyLevels.SelectionChanged += (sender, e) =>
-            {
-                if (VisualRoot is Window window)
-                    window.TransparencyLevelHint = (WindowTransparencyLevel)transparencyLevels.SelectedIndex;
-            };
         }
 
         protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)

+ 28 - 13
samples/ControlCatalog/MainWindow.xaml

@@ -7,7 +7,12 @@
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:vm="clr-namespace:ControlCatalog.ViewModels"
         xmlns:v="clr-namespace:ControlCatalog.Views"
-        x:Class="ControlCatalog.MainWindow" WindowState="{Binding WindowState, Mode=TwoWay}" Background="Transparent">
+        ExtendClientAreaToDecorationsHint="{Binding ExtendClientAreaEnabled}"
+        ExtendClientAreaChromeHints="{Binding ChromeHints}"
+        ExtendClientAreaTitleBarHeightHint="{Binding TitleBarHeight}"
+        TransparencyLevelHint="{Binding TransparencyLevel}"        
+        x:Name="MainWindow"
+        x:Class="ControlCatalog.MainWindow" WindowState="{Binding WindowState, Mode=TwoWay}">
   <NativeMenu.Menu>
     <NativeMenu>
       <NativeMenuItem Header="File">
@@ -56,20 +61,30 @@
     </NativeMenu>
   </NativeMenu.Menu>
 
- <Window.DataTemplates>
+  <Window.DataTemplates>
     <DataTemplate DataType="vm:NotificationViewModel">
       <v:CustomNotificationView />
     </DataTemplate>
   </Window.DataTemplates>
-  <DockPanel LastChildFill="True">
-    <Menu Name="MainMenu" DockPanel.Dock="Top">
-      <MenuItem Header="File">
-        <MenuItem Header="Exit" Command="{Binding ExitCommand}" />
-      </MenuItem>
-      <MenuItem Header="Help">
-        <MenuItem Header="About" Command="{Binding AboutCommand}" />
-      </MenuItem>
-    </Menu>
-    <local:MainView />
-  </DockPanel>
+  <Panel>
+    <Panel Margin="{Binding #MainWindow.OffScreenMargin}">
+      <DockPanel LastChildFill="True" Margin="{Binding #MainWindow.WindowDecorationMargin}">
+        <Menu Name="MainMenu" DockPanel.Dock="Top">
+          <MenuItem Header="File">
+            <MenuItem Header="Exit" Command="{Binding ExitCommand}" />
+          </MenuItem>
+          <MenuItem Header="Help">
+            <MenuItem Header="About" Command="{Binding AboutCommand}" />
+          </MenuItem>
+        </Menu>
+        <local:MainView />
+      </DockPanel>
+    </Panel>
+    <Border IsVisible="{Binding ExtendClientAreaEnabled}" BorderThickness="1 1 1 0" CornerRadius="4 4 0 0" BorderBrush="#55000000" Height="22" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="250 8 0 0">
+      <Border.Background>
+        <SolidColorBrush Color="White" Opacity="0.7" />
+      </Border.Background>
+      <TextBlock Margin="5 5 5 0" Text="Content In Title Bar" />
+    </Border>
+  </Panel>
 </Window>

+ 3 - 3
samples/ControlCatalog/Models/Person.cs

@@ -21,12 +21,12 @@ namespace ControlCatalog.Models
             get => _firstName;
             set
             {
+                _firstName = value;
                 if (string.IsNullOrWhiteSpace(value))
                     SetError(nameof(FirstName), "First Name Required");
                 else
                     SetError(nameof(FirstName), null);
 
-                _firstName = value;
                 OnPropertyChanged(nameof(FirstName));
             }
 
@@ -37,12 +37,12 @@ namespace ControlCatalog.Models
             get => _lastName;
             set
             {
+                _lastName = value;
                 if (string.IsNullOrWhiteSpace(value))
                     SetError(nameof(LastName), "Last Name Required");
                 else
                     SetError(nameof(LastName), null);
 
-                _lastName = value;
                 OnPropertyChanged(nameof(LastName));
             }
         }
@@ -95,4 +95,4 @@ namespace ControlCatalog.Models
                 return null;
         }
     }
-}
+}

+ 139 - 0
samples/ControlCatalog/Pages/AcrylicPage.xaml

@@ -0,0 +1,139 @@
+<UserControl xmlns="https://github.com/avaloniaui"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+             x:Class="ControlCatalog.Pages.AcrylicPage">
+  <Border Padding="20" HorizontalAlignment="Center">
+    <StackPanel Spacing="20">
+
+      <ExperimentalAcrylicBorder Width="660" CornerRadius="5">
+        <ExperimentalAcrylicBorder.Material>
+          <ExperimentalAcrylicMaterial
+            TintColor="White"
+            BackgroundSource="Digger" />
+        </ExperimentalAcrylicBorder.Material>
+        <StackPanel Spacing="5" Margin="40 10">
+          <StackPanel Orientation="Horizontal">
+            <TextBlock Text="TintOpacity" Foreground="Black" />
+            <Slider Name="TintOpacitySlider" Minimum="0" Maximum="1" Value="0.9" Width="400" />
+            <TextBlock Text="{Binding #TintOpacitySlider.Value}" Foreground="Black" />
+          </StackPanel>
+          <StackPanel Orientation="Horizontal">
+            <TextBlock Text="MaterialOpacity" Foreground="Black" />
+            <Slider Name="MaterialOpacitySlider" Minimum="0" Maximum="1" Value="0.8" Width="400" />
+            <TextBlock Text="{Binding #MaterialOpacitySlider.Value}" Foreground="Black" />
+          </StackPanel>
+        </StackPanel>
+      </ExperimentalAcrylicBorder>
+
+
+      <StackPanel Orientation="Horizontal" Spacing="20">
+        <ExperimentalAcrylicBorder Height="200" Width="200" CornerRadius="5">
+          <ExperimentalAcrylicBorder.Material>
+            <ExperimentalAcrylicMaterial
+              TintColor="#FF0000"
+              TintOpacity="{Binding #TintOpacitySlider.Value}"
+              MaterialOpacity="{Binding #MaterialOpacitySlider.Value}"
+              BackgroundSource="Digger" />
+          </ExperimentalAcrylicBorder.Material>
+        </ExperimentalAcrylicBorder>
+
+        <ExperimentalAcrylicBorder Height="200" Width="200" CornerRadius="5">
+          <ExperimentalAcrylicBorder.Material>
+            <ExperimentalAcrylicMaterial
+              TintColor="#00FF00"
+              TintOpacity="{Binding #TintOpacitySlider.Value}"
+              MaterialOpacity="{Binding #MaterialOpacitySlider.Value}"
+              BackgroundSource="Digger" />
+          </ExperimentalAcrylicBorder.Material>
+        </ExperimentalAcrylicBorder>
+
+        <ExperimentalAcrylicBorder Height="200" Width="200" CornerRadius="5">
+          <ExperimentalAcrylicBorder.Material>
+            <ExperimentalAcrylicMaterial
+              TintColor="#000000"
+              TintOpacity="{Binding #TintOpacitySlider.Value}"
+              MaterialOpacity="{Binding #MaterialOpacitySlider.Value}"
+              BackgroundSource="Digger" />
+          </ExperimentalAcrylicBorder.Material>
+        </ExperimentalAcrylicBorder>
+      </StackPanel>
+
+
+      <StackPanel Orientation="Horizontal" Spacing="20">
+        <ExperimentalAcrylicBorder Height="200" Width="200" CornerRadius="5">
+          <ExperimentalAcrylicBorder.Material>
+            <ExperimentalAcrylicMaterial
+              TintColor="#0000FF"
+              TintOpacity="{Binding #TintOpacitySlider.Value}"
+              MaterialOpacity="{Binding #MaterialOpacitySlider.Value}"
+              BackgroundSource="Digger" />
+          </ExperimentalAcrylicBorder.Material>
+        </ExperimentalAcrylicBorder>
+
+        <ExperimentalAcrylicBorder Height="200" Width="200" CornerRadius="5">
+          <ExperimentalAcrylicBorder.Material>
+            <ExperimentalAcrylicMaterial
+              TintColor="#FFFF00"
+              TintOpacity="{Binding #TintOpacitySlider.Value}"
+              MaterialOpacity="{Binding #MaterialOpacitySlider.Value}"
+              BackgroundSource="Digger" />
+          </ExperimentalAcrylicBorder.Material>
+        </ExperimentalAcrylicBorder>
+
+        <ExperimentalAcrylicBorder Height="200" Width="200" CornerRadius="5">
+          <ExperimentalAcrylicBorder.Material>
+            <ExperimentalAcrylicMaterial
+              TintColor="#000000"
+              TintOpacity="{Binding #TintOpacitySlider.Value}"
+              MaterialOpacity="{Binding #MaterialOpacitySlider.Value}"
+              BackgroundSource="Digger" />
+          </ExperimentalAcrylicBorder.Material>
+        </ExperimentalAcrylicBorder>
+      </StackPanel>
+
+      <StackPanel Orientation="Horizontal" Spacing="20">
+        <ExperimentalAcrylicBorder Height="200" Width="200" CornerRadius="5">
+          <ExperimentalAcrylicBorder.Material>
+            <ExperimentalAcrylicMaterial
+              TintColor="White"
+              TintOpacity="{Binding #TintOpacitySlider.Value}"
+              MaterialOpacity="{Binding #MaterialOpacitySlider.Value}"
+              BackgroundSource="Digger" />
+          </ExperimentalAcrylicBorder.Material>
+        </ExperimentalAcrylicBorder>
+
+        <ExperimentalAcrylicBorder Height="200" Width="200" CornerRadius="5">
+          <ExperimentalAcrylicBorder.Material>
+            <ExperimentalAcrylicMaterial
+              TintColor="#3c3c3c"
+              TintOpacity="{Binding #TintOpacitySlider.Value}"
+              MaterialOpacity="{Binding #MaterialOpacitySlider.Value}"
+              BackgroundSource="Digger" />
+          </ExperimentalAcrylicBorder.Material>
+        </ExperimentalAcrylicBorder>
+
+        <ExperimentalAcrylicBorder Height="200" Width="200" CornerRadius="5">
+          <ExperimentalAcrylicBorder.Material>
+            <ExperimentalAcrylicMaterial
+              TintColor="White"
+              TintOpacity="{Binding #TintOpacitySlider.Value}"
+              MaterialOpacity="{Binding #MaterialOpacitySlider.Value}"
+              BackgroundSource="Digger" />
+          </ExperimentalAcrylicBorder.Material>
+        </ExperimentalAcrylicBorder>
+      </StackPanel>
+
+      <ExperimentalAcrylicBorder Height="200" Width="660" CornerRadius="5">
+        <ExperimentalAcrylicBorder.Material>
+          <ExperimentalAcrylicMaterial
+            TintColor="Red"
+            TintOpacity="{Binding #TintOpacitySlider.Value}"
+            MaterialOpacity="{Binding #MaterialOpacitySlider.Value}"
+            BackgroundSource="Digger" />
+        </ExperimentalAcrylicBorder.Material>
+      </ExperimentalAcrylicBorder>
+    </StackPanel>
+  </Border>
+</UserControl>

+ 19 - 0
samples/ControlCatalog/Pages/AcrylicPage.xaml.cs

@@ -0,0 +1,19 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace ControlCatalog.Pages
+{
+    public class AcrylicPage : UserControl
+    {
+        public AcrylicPage()
+        {
+            this.InitializeComponent();
+        }
+
+        private void InitializeComponent()
+        {
+            AvaloniaXamlLoader.Load(this);
+        }
+    }
+}

+ 12 - 5
samples/ControlCatalog/Pages/BorderPage.xaml

@@ -9,26 +9,33 @@
                 Margin="0,16,0,0"
                 HorizontalAlignment="Center"
                 Spacing="16">
-      <Border BorderBrush="{DynamicResource ThemeAccentBrush}" BorderThickness="2" Padding="16">
+      <Border BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="2" Padding="16">
         <TextBlock>Border</TextBlock>
       </Border>
-      <Border Background="{DynamicResource ThemeAccentBrush2}" 
-              BorderBrush="{DynamicResource ThemeAccentBrush}" 
+      <Border Background="{DynamicResource SystemAccentColorDark1}" 
+              BorderBrush="{DynamicResource SystemAccentColor}" 
               BorderThickness="4" 
               Padding="16">
         <TextBlock>Border and Background</TextBlock>
       </Border>
-      <Border BorderBrush="{DynamicResource ThemeAccentBrush}"
+      <Border BorderBrush="{DynamicResource SystemAccentColor}"
               BorderThickness="4" 
               CornerRadius="8"
               Padding="16">
         <TextBlock>Rounded Corners</TextBlock>
       </Border>
-      <Border Background="{DynamicResource ThemeAccentBrush2}"
+      <Border Background="{DynamicResource SystemAccentColor}"
               CornerRadius="8"
               Padding="16">
         <TextBlock>Rounded Corners</TextBlock>
       </Border>
+      <Border Width="100" Height="100"
+              BorderThickness="0"
+              Background="White"
+              CornerRadius="100" ClipToBounds="True">
+        <Image Source="/Assets/maple-leaf-888807_640.jpg" Stretch="UniformToFill" />
+      </Border>
+      <TextBlock Text="Border with Clipping" HorizontalAlignment="Center" />
     </StackPanel>    
   </StackPanel>
 </UserControl>

+ 12 - 7
samples/ControlCatalog/Pages/ButtonPage.xaml

@@ -9,10 +9,10 @@
                 Margin="0,16,0,0"
                 HorizontalAlignment="Center"
                 Spacing="16">
-      <StackPanel Orientation="Vertical" Spacing="8" Width="150">
-        <Button>Button</Button>
+      <StackPanel Orientation="Vertical" Spacing="8" Width="200">
+        <Button>Standard XAML Button</Button>
         <Button Foreground="White">Foreground</Button>
-        <Button Background="{DynamicResource ThemeAccentBrush}">Background</Button>
+        <Button Background="{DynamicResource SystemAccentColor}">Background</Button>
         <Button IsEnabled="False">Disabled</Button>
         <Button Content="Re-themed">
           <Button.Styles>
@@ -24,13 +24,18 @@
             </Style>
           </Button.Styles>          
         </Button>
-      </StackPanel>
+        <RepeatButton Name="RepeatButton">
+          <TextBlock Name="RepeatButtonTextBlock" Text="Repeat Button: 0" />
+        </RepeatButton>
+        <ToggleButton Content="Toggle Button"/>
+    </StackPanel>
 
       <StackPanel Orientation="Vertical" Spacing="8" Width="150">
         <Button BorderThickness="0">No Border</Button>
-        <Button BorderBrush="{DynamicResource ThemeAccentBrush}">Border Color</Button>
-        <Button BorderBrush="{DynamicResource ThemeAccentBrush}" BorderThickness="4">Thick Border</Button>
-        <Button BorderBrush="{DynamicResource ThemeAccentBrush}" BorderThickness="4" IsEnabled="False">Disabled</Button>
+        <Button BorderBrush="{DynamicResource SystemAccentColor}">Border Color</Button>
+        <Button BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="4">Thick Border</Button>
+        <Button BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="4" IsEnabled="False">Disabled</Button>
+        <Button BorderBrush="{DynamicResource SystemAccentColor}" KeyboardNavigation.IsTabStop="False">IsTabStop=False</Button>
       </StackPanel>
     </StackPanel>    
   </StackPanel>

+ 20 - 0
samples/ControlCatalog/Pages/ButtonPage.xaml.cs

@@ -5,5 +5,25 @@ namespace ControlCatalog.Pages
 {
     public class ButtonPage : UserControl
     {
+        private int repeatButtonClickCount = 0;
+
+        public ButtonPage()
+        {
+            InitializeComponent();
+
+            this.FindControl<RepeatButton>("RepeatButton").Click += OnRepeatButtonClick;
+        }
+
+        private void InitializeComponent()
+        {
+            AvaloniaXamlLoader.Load(this);
+        }
+
+        public void OnRepeatButtonClick(object sender, object args)
+        {
+            repeatButtonClickCount++;
+            var textBlock = this.FindControl<TextBlock>("RepeatButtonTextBlock");
+            textBlock.Text = $"Repeat Button: {repeatButtonClickCount}";
+        }
     }
 }

+ 9 - 9
samples/ControlCatalog/Pages/DatePickerPage.xaml → samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml

@@ -1,8 +1,8 @@
 <UserControl xmlns="https://github.com/avaloniaui"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             x:Class="ControlCatalog.Pages.DatePickerPage">
+             x:Class="ControlCatalog.Pages.CalendarDatePickerPage">
   <StackPanel Orientation="Vertical" Spacing="4">
-    <TextBlock Classes="h1">DatePicker</TextBlock>
+    <TextBlock Classes="h1">CalendarDatePicker</TextBlock>
     <TextBlock Classes="h2">A control for selecting dates with a calendar drop-down</TextBlock>
         
     <StackPanel Orientation="Horizontal"
@@ -12,34 +12,34 @@
       <StackPanel Orientation="Vertical"
                   Width="200">
         <TextBlock Text="SelectedDateFormat: Short"/>
-        <DatePicker Name="DatePicker1"
+        <CalendarDatePicker Name="DatePicker1"
                     SelectedDateFormat="Short"
                     Margin="0,0,0,8"/>
 
         <TextBlock Text="SelectedDateFormat: Long"/>
-        <DatePicker Name="DatePicker2"
+        <CalendarDatePicker Name="DatePicker2"
                     SelectedDateFormat="Long"
                     Margin="0,0,0,8"/>
 
         <TextBlock Text="SelectedDateFormat: Custom"/>
-        <DatePicker Name="DatePicker3"
+        <CalendarDatePicker Name="DatePicker3"
                     SelectedDateFormat="Custom"
                     CustomDateFormatString="ddd, MMM d"
                     Margin="0,0,0,8"/>
 
         <TextBlock Text="Blackout Dates"/>
-        <DatePicker Name="DatePicker4"
+        <CalendarDatePicker Name="DatePicker4"
                     Margin="0,0,0,8"/>
 
-        <DatePicker Margin="0,0,0,8"
+        <CalendarDatePicker Margin="0,0,0,8"
                     Watermark="Watermark"/>
-        <DatePicker Margin="0,0,0,8"
+        <CalendarDatePicker Margin="0,0,0,8"
                     Name="DatePicker5"
                     Watermark="Floating Watermark"
                     UseFloatingWatermark="True"/>
                 
         <TextBlock Text="Disabled"/>
-        <DatePicker IsEnabled="False"/>
+        <CalendarDatePicker IsEnabled="False"/>
       </StackPanel>
 
     </StackPanel> 

+ 7 - 7
samples/ControlCatalog/Pages/DatePickerPage.xaml.cs → samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml.cs

@@ -4,17 +4,17 @@ using System;
 
 namespace ControlCatalog.Pages
 {
-    public class DatePickerPage : UserControl
+    public class CalendarDatePickerPage : UserControl
     {
-        public DatePickerPage()
+        public CalendarDatePickerPage()
         {
             InitializeComponent();
             
-            var dp1 = this.FindControl<DatePicker>("DatePicker1");
-            var dp2 = this.FindControl<DatePicker>("DatePicker2");
-            var dp3 = this.FindControl<DatePicker>("DatePicker3");
-            var dp4 = this.FindControl<DatePicker>("DatePicker4");
-            var dp5 = this.FindControl<DatePicker>("DatePicker5");
+            var dp1 = this.FindControl<CalendarDatePicker>("DatePicker1");
+            var dp2 = this.FindControl<CalendarDatePicker>("DatePicker2");
+            var dp3 = this.FindControl<CalendarDatePicker>("DatePicker3");
+            var dp4 = this.FindControl<CalendarDatePicker>("DatePicker4");
+            var dp5 = this.FindControl<CalendarDatePicker>("DatePicker5");
 
             dp1.SelectedDate = DateTime.Today;
             dp2.SelectedDate = DateTime.Today.AddDays(10);

+ 2 - 2
samples/ControlCatalog/Pages/ComboBoxPage.xaml

@@ -6,7 +6,7 @@
     <TextBlock Classes="h2">A drop-down list.</TextBlock>
 
     <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 16 0 0" Spacing="8">
-      <ComboBox SelectedIndex="0">
+      <ComboBox PlaceholderText="Pick an Item">
         <ComboBoxItem>Inline Items</ComboBoxItem>
         <ComboBoxItem>Inline Item 2</ComboBoxItem>
         <ComboBoxItem>Inline Item 3</ComboBoxItem>
@@ -16,7 +16,7 @@
       <ComboBox SelectedIndex="0">
         <ComboBoxItem>
           <Panel>
-            <Rectangle Fill="{DynamicResource ThemeAccentBrush}"/>
+            <Rectangle Fill="{DynamicResource SystemAccentColor}"/>
             <TextBlock Margin="8">Control Items</TextBlock>
           </Panel>
         </ComboBoxItem>

+ 2 - 2
samples/ControlCatalog/Pages/ContextMenuPage.xaml

@@ -9,7 +9,7 @@
               Margin="0,16,0,0"
               HorizontalAlignment="Center"
               Spacing="16">
-            <Border Background="{DynamicResource ThemeAccentBrush}"
+            <Border Background="{DynamicResource SystemAccentColor}"
                     Margin="16"
                     Padding="48,48,48,48">
                 <Border.ContextMenu>
@@ -34,7 +34,7 @@
                 </Border.ContextMenu>
                 <TextBlock Text="Defined in XAML"/>
             </Border>
-            <Border Background="{DynamicResource ThemeAccentBrush}"
+            <Border Background="{DynamicResource SystemAccentColor}"
                     Margin="16"
                     Padding="48,48,48,48">
                 <Border.ContextMenu>

+ 123 - 0
samples/ControlCatalog/Pages/DateTimePickerPage.xaml

@@ -0,0 +1,123 @@
+<UserControl xmlns="https://github.com/avaloniaui"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+             x:Class="ControlCatalog.Pages.DateTimePickerPage">
+  <StackPanel Orientation="Vertical" Spacing="4" HorizontalAlignment="Stretch">
+    <TextBlock Classes="h1">DatePicker and TimePicker</TextBlock>
+    <TextBlock Name="DatePickerDesc" Classes="h2" TextWrapping="Wrap"/>
+    <TextBlock Name="TimePickerDesc" Classes="h2" TextWrapping="Wrap"/>
+
+    <StackPanel Orientation="Vertical"
+                Margin="16"
+                HorizontalAlignment="Stretch"
+                Spacing="16">
+      <TextBlock FontSize="18">A simple DatePicker with a header</TextBlock>
+      <StackPanel Orientation="Vertical">
+        <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
+                BorderThickness="1" Padding="15">
+          <DatePicker Header="Pick a date" />
+        </Border>
+        <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
+          <TextBlock Padding="15">
+            <TextBlock.Text>
+              <x:String>
+                &lt;DatePicker Header="Pick a date" /&gt;
+              </x:String>
+            </TextBlock.Text>
+          </TextBlock>
+        </Panel>
+      </StackPanel>
+      
+      <TextBlock FontSize="18">A DatePicker with day formatted and year hidden.</TextBlock>
+      <StackPanel Orientation="Vertical">
+        <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
+                BorderThickness="1" Padding="15">
+          <DatePicker x:Name="Control2" DayFormat="d (ddd)"
+                             YearVisible="False" />
+        </Border>
+        <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
+          <TextBlock Padding="15">
+            <TextBlock.Text>
+              <x:String>
+                &lt;DatePicker DayFormat="d (ddd)" YearVisible="False" /&gt;
+              </x:String>
+            </TextBlock.Text>
+          </TextBlock>
+        </Panel>
+      </StackPanel>
+
+      <Border Background="{DynamicResource SystemControlHighlightBaseLowBrush}" BorderThickness="1" Margin="15" />
+
+      <TextBlock FontSize="18">A simple TimePicker.</TextBlock>
+      <StackPanel Orientation="Vertical">
+        <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
+                BorderThickness="1" Padding="15">
+          <TimePicker />
+        </Border>
+        <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
+          <TextBlock Padding="15">
+            <TextBlock.Text>
+              <x:String>
+                &lt;TimePicker /&gt;
+              </x:String>
+            </TextBlock.Text>
+          </TextBlock>
+        </Panel>
+      </StackPanel>
+
+      <TextBlock FontSize="18">A TimePicker with a header and minute increments specified.</TextBlock>
+      <StackPanel Orientation="Vertical">
+        <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
+                BorderThickness="1" Padding="15">
+          <TimePicker Header="Arrival time" MinuteIncrement="15" />
+        </Border>
+        <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
+          <TextBlock Padding="15">
+            <TextBlock.Text>
+              <x:String>
+                &lt;TimePicker Header="Arrival time" MinuteIncrement="15" /&gt;
+              </x:String>
+            </TextBlock.Text>
+          </TextBlock>
+        </Panel>
+      </StackPanel>
+
+      <TextBlock FontSize="18">A TimePicker using a 12-hour clock.</TextBlock>
+      <StackPanel Orientation="Vertical">
+        <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
+                BorderThickness="1" Padding="15">
+          <TimePicker ClockIdentifier="12HourClock" Header="12 hour clock" />
+        </Border>
+        <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
+          <TextBlock Padding="15">
+            <TextBlock.Text>
+              <x:String>
+                &lt;TimePicker ClockIdentifier="12HourClock" Header="12 hour clock" /&gt;
+              </x:String>
+            </TextBlock.Text>
+          </TextBlock>
+        </Panel>
+      </StackPanel>
+
+      <TextBlock FontSize="18">A TimePicker using a 24-hour clock.</TextBlock>
+      <StackPanel Orientation="Vertical">
+        <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
+                BorderThickness="1" Padding="15">
+          <TimePicker ClockIdentifier="24HourClock" Header="24 hour clock" />
+        </Border>
+        <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
+          <TextBlock Padding="15">
+            <TextBlock.Text>
+              <x:String>
+                &lt;TimePicker ClockIdentifier="24HourClock" Header="24 hour clock" /&gt;
+              </x:String>
+            </TextBlock.Text>
+          </TextBlock>
+        </Panel>
+      </StackPanel>
+      
+    </StackPanel>
+  </StackPanel>
+</UserControl>

+ 30 - 0
samples/ControlCatalog/Pages/DateTimePickerPage.xaml.cs

@@ -0,0 +1,30 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace ControlCatalog.Pages
+{
+    public class DateTimePickerPage : UserControl
+    {
+        public DateTimePickerPage()
+        {
+            this.InitializeComponent();
+            this.FindControl<TextBlock>("DatePickerDesc").Text = "Use a DatePicker to let users set a date in your app, " +
+                "for example to schedule an appointment. The DatePicker displays three controls for month, day, and year. " +
+                "These controls are easy to use with touch or mouse, and they can be styled and configured in several different ways. " +
+                "Order of month, day, and year is dynamically set based on user date settings";
+
+            this.FindControl<TextBlock>("TimePickerDesc").Text = "Use a TimePicker to let users set a time in your app, for example " +
+                "to set a reminder. The TimePicker displays three controls for hour, minute, and AM / PM(if necessary).These controls " +
+                "are easy to use with touch or mouse, and they can be styled and configured in several different ways. " +
+                "12 - hour or 24 - hour clock and visiblility of AM / PM is dynamically set based on user time settings, or can be overridden.";
+
+
+        }
+
+        private void InitializeComponent()
+        {
+            AvaloniaXamlLoader.Load(this);
+        }
+    }
+}

+ 2 - 0
samples/ControlCatalog/Pages/DialogsPage.xaml

@@ -11,5 +11,7 @@
       <Button Name="DecoratedWindowDialog">Decorated window (dialog)</Button>
       <Button Name="Dialog">Dialog</Button>
       <Button Name="DialogNoTaskbar">Dialog (No taskbar icon)</Button>
+      <Button Name="OwnedWindow">Owned window</Button>
+      <Button Name="OwnedWindowNoTaskbar">Owned window (No taskbar icon)</Button>
   </StackPanel>
 </UserControl>

+ 15 - 0
samples/ControlCatalog/Pages/DialogsPage.xaml.cs

@@ -93,6 +93,21 @@ namespace ControlCatalog.Pages
                 window.ShowInTaskbar = false;
                 window.ShowDialog(GetWindow());
             };
+            this.FindControl<Button>("OwnedWindow").Click += delegate
+            {
+                var window = CreateSampleWindow();
+
+                window.Show(GetWindow());
+            };
+
+            this.FindControl<Button>("OwnedWindowNoTaskbar").Click += delegate
+            {
+                var window = CreateSampleWindow();
+
+                window.ShowInTaskbar = false;
+
+                window.Show(GetWindow());
+            };
         }
 
         private Window CreateSampleWindow()

+ 3 - 3
samples/ControlCatalog/Pages/DragAndDropPage.xaml

@@ -10,15 +10,15 @@
                 HorizontalAlignment="Center"
                 Spacing="16">
             <StackPanel>
-                <Border BorderBrush="{DynamicResource ThemeAccentBrush}" BorderThickness="2" Padding="16" Name="DragMeText">
+                <Border BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="2" Padding="16" Name="DragMeText">
                   <TextBlock Name="DragStateText">Drag Me</TextBlock>
                 </Border>
-                <Border BorderBrush="{DynamicResource ThemeAccentBrush}" BorderThickness="2" Padding="16" Name="DragMeCustom">
+                <Border BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="2" Padding="16" Name="DragMeCustom">
                   <TextBlock Name="DragStateCustom">Drag Me (custom)</TextBlock>
                 </Border>
             </StackPanel>
 
-            <Border Background="{DynamicResource ThemeAccentBrush2}" Padding="16" 
+            <Border Background="{DynamicResource SystemAccentColorDark1}" Padding="16" 
                     DragDrop.AllowDrop="True">
                 <TextBlock Name="DropState">Drop some text or files here</TextBlock>
             </Border>

+ 4 - 2
samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml

@@ -18,6 +18,8 @@
       <Button Command="{Binding AddItem}">Add Item</Button>
       <Button Command="{Binding RandomizeHeights}">Randomize Heights</Button>
       <Button Command="{Binding ResetItems}">Reset items</Button>
+      <Button x:Name="scrollToLast">Scroll to Last</Button>
+      <Button x:Name="scrollToRandom">Scroll to Random</Button>
     </StackPanel>
     <Border BorderThickness="1" BorderBrush="{DynamicResource ThemeBorderMidBrush}" Margin="0 0 0 16">
       <ScrollViewer Name="scroller"
@@ -30,10 +32,10 @@
             </Style>
           </ItemsRepeater.Styles>
           <ItemsRepeater.ItemTemplate>
-            <DataTemplate>              
+            <DataTemplate>
               <Border Background="Purple" BorderThickness="2" BorderBrush="Green" MinHeight="100" MinWidth="100">
                 <TextBlock Focusable="True" Height="{Binding Height}" Text="{Binding Text}"  Foreground="White" />
-              </Border>              
+              </Border>
             </DataTemplate>
           </ItemsRepeater.ItemTemplate>
         </ItemsRepeater>

+ 31 - 3
samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs

@@ -5,23 +5,32 @@ using Avalonia.Controls.Primitives;
 using Avalonia.Input;
 using Avalonia.Layout;
 using Avalonia.Markup.Xaml;
+using Avalonia.VisualTree;
 using ControlCatalog.ViewModels;
 
 namespace ControlCatalog.Pages
 {
     public class ItemsRepeaterPage : UserControl
     {
+        private readonly ItemsRepeaterPageViewModel _viewModel;
         private ItemsRepeater _repeater;
         private ScrollViewer _scroller;
+        private Button _scrollToLast;
+        private Button _scrollToRandom;
+        private Random _random = new Random(0);
 
         public ItemsRepeaterPage()
         {
             this.InitializeComponent();
             _repeater = this.FindControl<ItemsRepeater>("repeater");
             _scroller = this.FindControl<ScrollViewer>("scroller");
+            _scrollToLast = this.FindControl<Button>("scrollToLast");
+            _scrollToRandom = this.FindControl<Button>("scrollToRandom");
             _repeater.PointerPressed += RepeaterClick;
             _repeater.KeyDown += RepeaterOnKeyDown;
-            DataContext = new ItemsRepeaterPageViewModel();
+            _scrollToLast.Click += scrollToLast_Click;
+            _scrollToRandom.Click += scrollToRandom_Click;
+            DataContext = _viewModel = new ItemsRepeaterPageViewModel();
         }
 
         private void InitializeComponent()
@@ -93,18 +102,37 @@ namespace ControlCatalog.Pages
             }
         }
 
+        private void ScrollTo(int index)
+        {
+            System.Diagnostics.Debug.WriteLine("Scroll to " + index);
+            var layoutManager = ((Window)this.GetVisualRoot()).LayoutManager;
+            var element = _repeater.GetOrCreateElement(index);
+            layoutManager.ExecuteLayoutPass();
+            element.BringIntoView();
+        }
+
         private void RepeaterClick(object sender, PointerPressedEventArgs e)
         {
             var item = (e.Source as TextBlock)?.DataContext as ItemsRepeaterPageViewModel.Item;
-            ((ItemsRepeaterPageViewModel)DataContext).SelectedItem = item;
+            _viewModel.SelectedItem = item;
         }
 
         private void RepeaterOnKeyDown(object sender, KeyEventArgs e)
         {
             if (e.Key == Key.F5)
             {
-                ((ItemsRepeaterPageViewModel)DataContext).ResetItems();
+                _viewModel.ResetItems();
             }
         }
+
+        private void scrollToLast_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
+        {
+            ScrollTo(_viewModel.Items.Count - 1);
+        }
+
+        private void scrollToRandom_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
+        {
+            ScrollTo(_random.Next(_viewModel.Items.Count - 1));
+        }
     }
 }

+ 4 - 4
samples/ControlCatalog/Pages/LayoutTransformControlPage.xaml

@@ -11,10 +11,10 @@
           RowDefinitions="24,Auto,24"
           HorizontalAlignment="Center"
           VerticalAlignment="Center">
-      <Border Background="{DynamicResource ThemeAccentBrush}" Grid.Column="1" Grid.Row="0"/>
-      <Border Background="{DynamicResource ThemeAccentBrush}" Grid.Column="0" Grid.Row="1"/>
-      <Border Background="{DynamicResource ThemeAccentBrush}" Grid.Column="2" Grid.Row="1"/>
-      <Border Background="{DynamicResource ThemeAccentBrush}" Grid.Column="1" Grid.Row="2"/>
+      <Border Background="{DynamicResource SystemAccentColor}" Grid.Column="1" Grid.Row="0"/>
+      <Border Background="{DynamicResource SystemAccentColor}" Grid.Column="0" Grid.Row="1"/>
+      <Border Background="{DynamicResource SystemAccentColor}" Grid.Column="2" Grid.Row="1"/>
+      <Border Background="{DynamicResource SystemAccentColor}" Grid.Column="1" Grid.Row="2"/>
 
       <LayoutTransformControl Name="layoutTransform" Grid.Column="1" Grid.Row="1">
         <LayoutTransformControl.LayoutTransform>

+ 6 - 6
samples/ControlCatalog/Pages/NumericUpDownPage.xaml

@@ -50,22 +50,22 @@
         <TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Margin="2">Text:</TextBlock>
         <TextBox Grid.Row="4" Grid.Column="1" Text="{Binding #upDown.Text}" VerticalAlignment="Center" Margin="2" />
       </Grid>
-      <Grid Grid.Row="0" Grid.Column="2" Margin="10,2,2,2" RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto, 120">
+      <Grid Grid.Row="0" Grid.Column="2" Margin="10,2,2,2" RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto, Auto">
         <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Minimum:</TextBlock>
         <NumericUpDown Grid.Row="0" Grid.Column="1" Value="{Binding #upDown.Minimum}"
-                       CultureInfo="{Binding #upDown.CultureInfo}" VerticalAlignment="Center" Margin="2" Width="70" HorizontalAlignment="Center"/>
+                       CultureInfo="{Binding #upDown.CultureInfo}" VerticalAlignment="Center" Margin="2" HorizontalAlignment="Center"/>
 
         <TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Maximum:</TextBlock>
         <NumericUpDown Grid.Row="1" Grid.Column="1" Value="{Binding #upDown.Maximum}"
-                       CultureInfo="{Binding #upDown.CultureInfo}" VerticalAlignment="Center" Margin="2" Width="70" HorizontalAlignment="Center"/>
+                       CultureInfo="{Binding #upDown.CultureInfo}" VerticalAlignment="Center" Margin="2" HorizontalAlignment="Center"/>
 
         <TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Increment:</TextBlock>
         <NumericUpDown Grid.Row="2" Grid.Column="1" Value="{Binding #upDown.Increment}" VerticalAlignment="Center"
-                       Margin="2" Width="70" HorizontalAlignment="Center"/>
+                       Margin="2" HorizontalAlignment="Center"/>
 
         <TextBlock Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Value:</TextBlock>
         <NumericUpDown Grid.Row="3" Grid.Column="1" Value="{Binding #upDown.Value}" VerticalAlignment="Center"
-                       Margin="2" Width="70" HorizontalAlignment="Center"/>
+                       Margin="2" HorizontalAlignment="Center"/>
 
       </Grid>
     </Grid>
@@ -73,7 +73,7 @@
     <StackPanel Margin="2,10,2,2" Orientation="Horizontal" Spacing="10">
       <TextBlock FontSize="14" FontWeight="Bold" VerticalAlignment="Center">Usage of NumericUpDown:</TextBlock>
       <NumericUpDown Name="upDown" Minimum="0" Maximum="10" Increment="0.5"
-                     CultureInfo="en-US" VerticalAlignment="Center" Width="100"
+                     CultureInfo="en-US" VerticalAlignment="Center"
                      Watermark="Enter text" FormatString="{Binding SelectedFormat.Value}"/>
     </StackPanel>
 

+ 8 - 18
samples/ControlCatalog/Pages/ProgressBarPage.xaml

@@ -1,29 +1,19 @@
-<UserControl xmlns="https://github.com/avaloniaui"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             x:Class="ControlCatalog.Pages.ProgressBarPage">
+<UserControl xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="ControlCatalog.Pages.ProgressBarPage">
   <StackPanel Orientation="Vertical" Spacing="4">
     <TextBlock Classes="h1">ProgressBar</TextBlock>
     <TextBlock Classes="h2">A progress bar control</TextBlock>
-
     <StackPanel>
-      <CheckBox
-          x:Name="showProgress"
-          Margin="10,16,0,0"
-          Content="Show Progress Text" />
-      <StackPanel Orientation="Horizontal"
-                  Margin="0,16,0,0"
-                  HorizontalAlignment="Center"
-                  Spacing="16">
+      <CheckBox x:Name="showProgress" Margin="10,16,0,0" Content="Show Progress Text" />
+      <CheckBox x:Name="isIndeterminate" Margin="10,16,0,0" Content="Toggle Indeterminate" />
+      <StackPanel Orientation="Horizontal" Margin="0,16,0,0" HorizontalAlignment="Center" Spacing="16">
         <StackPanel Spacing="16">
-          <ProgressBar ShowProgressText="{Binding #showProgress.IsChecked}" Value="{Binding #hprogress.Value}" />
-          <ProgressBar IsIndeterminate="True"/>
+          <ProgressBar IsIndeterminate="{Binding #isIndeterminate.IsChecked}" ShowProgressText="{Binding #showProgress.IsChecked}" Value="{Binding #hprogress.Value}" />
         </StackPanel>
-        <ProgressBar ShowProgressText="{Binding #showProgress.IsChecked}" Value="{Binding #vprogress.Value}" Orientation="Vertical" />
-        <ProgressBar Orientation="Vertical" IsIndeterminate="True" />
+        <ProgressBar IsIndeterminate="{Binding #isIndeterminate.IsChecked}" ShowProgressText="{Binding #showProgress.IsChecked}" Value="{Binding #vprogress.Value}" Orientation="Vertical" />
       </StackPanel>
       <StackPanel Margin="16">
-        <Slider Name="hprogress" Maximum="100" Value="40"/>
-        <Slider Name="vprogress" Maximum="100" Value="60"/>
+        <Slider Name="hprogress" Maximum="100" Value="40" />
+        <Slider Name="vprogress" Maximum="100" Value="60" />
       </StackPanel>
     </StackPanel>
   </StackPanel>

+ 35 - 0
samples/ControlCatalog/Pages/ScrollViewerPage.xaml

@@ -0,0 +1,35 @@
+<UserControl xmlns="https://github.com/avaloniaui"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             x:Class="ControlCatalog.Pages.ScrollViewerPage">
+  <StackPanel Orientation="Vertical" Spacing="4">
+    <TextBlock Classes="h1">ScrollViewer</TextBlock>
+    <TextBlock Classes="h2">Allows for horizontal and vertical content scrolling.</TextBlock>
+
+    <Grid ColumnDefinitions="Auto, *">
+      <StackPanel Orientation="Vertical" Spacing="4">
+        <ToggleSwitch IsChecked="{Binding AllowAutoHide}" Content="Allow auto hide" />
+
+        <StackPanel Orientation="Vertical" Spacing="4">
+          <TextBlock Text="Horizontal Scroll" />
+          <ComboBox Items="{Binding AvailableVisibility}" SelectedItem="{Binding HorizontalScrollVisibility}" />
+        </StackPanel>
+
+        <StackPanel Orientation="Vertical" Spacing="4">
+          <TextBlock Text="Vertical Scroll" />
+          <ComboBox Items="{Binding AvailableVisibility}" SelectedItem="{Binding VerticalScrollVisibility}" />
+        </StackPanel>
+      </StackPanel>
+
+      <ScrollViewer x:Name="ScrollViewer"
+                    Grid.Column="1"
+                    Width="400" Height="400"
+                    AllowAutoHide="{Binding AllowAutoHide}"
+                    HorizontalScrollBarVisibility="{Binding HorizontalScrollVisibility}"
+                    VerticalScrollBarVisibility="{Binding VerticalScrollVisibility}">
+        <Image Width="800" Height="800" Stretch="UniformToFill"
+               Source="/Assets/delicate-arch-896885_640.jpg" />
+      </ScrollViewer>
+    </Grid>
+
+  </StackPanel>
+</UserControl>

+ 65 - 0
samples/ControlCatalog/Pages/ScrollViewerPage.xaml.cs

@@ -0,0 +1,65 @@
+using System.Collections.Generic;
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+using Avalonia.Markup.Xaml;
+using ReactiveUI;
+
+namespace ControlCatalog.Pages
+{
+    public class ScrollViewerPageViewModel : ReactiveObject
+    {
+        private bool _allowAutoHide;
+        private ScrollBarVisibility _horizontalScrollVisibility;
+        private ScrollBarVisibility _verticalScrollVisibility;
+
+        public ScrollViewerPageViewModel()
+        {
+            AvailableVisibility = new List<ScrollBarVisibility>
+            {
+                ScrollBarVisibility.Auto,
+                ScrollBarVisibility.Visible,
+                ScrollBarVisibility.Hidden,
+                ScrollBarVisibility.Disabled,
+            };
+
+            HorizontalScrollVisibility = ScrollBarVisibility.Auto;
+            VerticalScrollVisibility = ScrollBarVisibility.Auto;
+            AllowAutoHide = true;
+        }
+
+        public bool AllowAutoHide
+        {
+            get => _allowAutoHide;
+            set => this.RaiseAndSetIfChanged(ref _allowAutoHide, value);
+        }
+
+        public ScrollBarVisibility HorizontalScrollVisibility
+        {
+            get => _horizontalScrollVisibility;
+            set => this.RaiseAndSetIfChanged(ref _horizontalScrollVisibility, value);
+        }
+
+        public ScrollBarVisibility VerticalScrollVisibility
+        {
+            get => _verticalScrollVisibility;
+            set => this.RaiseAndSetIfChanged(ref _verticalScrollVisibility, value);
+        }
+
+        public List<ScrollBarVisibility> AvailableVisibility { get; }
+    }
+
+    public class ScrollViewerPage : UserControl
+    {
+        public ScrollViewerPage()
+        {
+            InitializeComponent();
+
+            DataContext = new ScrollViewerPageViewModel();
+        }
+
+        private void InitializeComponent()
+        {
+            AvaloniaXamlLoader.Load(this);
+        }
+    }
+}

+ 17 - 4
samples/ControlCatalog/Pages/SliderPage.xaml

@@ -6,15 +6,28 @@
     <TextBlock Classes="h2">A control that lets the user select from a range of values by moving a Thumb control along a Track.</TextBlock>
 
     <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 16 0 0" Spacing="16">
-      <Slider Value="0"
-              Minimum="0"
-              Maximum="100"
-              Width="300"/>
+      <StackPanel Orientation="Vertical"
+                  HorizontalAlignment="Center">
+        <Slider Value="0"
+                Minimum="0"
+                Maximum="100"
+                TickFrequency="10"
+                Width="300" />
+        <Slider Name="CustomTickedSlider"
+                Value="0"
+                Minimum="0"
+                Maximum="100"
+                TickPlacement="BottomRight"
+                IsSnapToTickEnabled="True"
+                Ticks="0,20,25,40,75,100"
+                Width="300" />
+      </StackPanel>
       <Slider Value="0"
               Minimum="0"
               Maximum="100"
               Orientation="Vertical"
               IsSnapToTickEnabled="True"
+              TickPlacement="Outside"
               TickFrequency="10"
               Height="300"/>
     </StackPanel>

+ 97 - 0
samples/ControlCatalog/Pages/SplitViewPage.xaml

@@ -0,0 +1,97 @@
+<UserControl xmlns="https://github.com/avaloniaui"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+             x:Class="ControlCatalog.Pages.SplitViewPage">
+
+  <Border>
+
+    <Grid ColumnDefinitions="*,225">
+
+      <StackPanel Grid.Column="1" Orientation="Vertical" Spacing="4" Margin="5">
+        <ToggleButton Name="PaneOpenButton"
+                      Content="IsPaneOpen"
+                      IsChecked="{Binding IsPaneOpen, ElementName=SplitView}" />
+
+        <ToggleButton Name="UseLightDismissOverlayModeButton"
+                      Content="UseLightDismissOverlayMode"
+                      IsChecked="{Binding UseLightDismissOverlayMode, ElementName=SplitView}" />
+
+        <ToggleSwitch OffContent="Left" OnContent="Right" Content="Placement" IsChecked="{Binding !IsLeft}" />
+
+        <TextBlock Text="DisplayMode" />
+        <ComboBox Name="DisplayModeSelector" Width="170" Margin="10" SelectedIndex="{Binding DisplayMode}">
+          <ComboBoxItem>Inline</ComboBoxItem>
+          <ComboBoxItem>CompactInline</ComboBoxItem>
+          <ComboBoxItem>Overlay</ComboBoxItem>
+          <ComboBoxItem>CompactOverlay</ComboBoxItem>
+        </ComboBox>
+
+        <TextBlock Text="PaneBackground" />
+        <ComboBox Name="PaneBackgroundSelector" SelectedIndex="0" Width="170" Margin="10">
+          <ComboBoxItem Tag="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}">SystemControlBackgroundChromeMediumLowBrush</ComboBoxItem>
+          <ComboBoxItem Tag="Red">Red</ComboBoxItem>
+          <ComboBoxItem Tag="Blue">Blue</ComboBoxItem>
+          <ComboBoxItem Tag="Green">Green</ComboBoxItem>
+        </ComboBox>
+
+        <TextBlock Text="{Binding Value, ElementName=OpenPaneLengthSlider, StringFormat='{}OpenPaneLength: {0}'}" />
+        <Slider Name="OpenPaneLengthSlider" Value="256" Minimum="128" Maximum="500"
+                Width="150" />
+
+        <TextBlock Text="{Binding Value, ElementName=CompactPaneLengthSlider, StringFormat='{}CompactPaneLength: {0}'}" />
+        <Slider Name="CompactPaneLengthSlider" Value="48" Minimum="24" Maximum="128"
+                Width="150" />
+
+      </StackPanel>
+
+      <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
+            BorderThickness="1">
+        <!--{Binding SelectedItem.Tag, ElementName=PaneBackgroundSelector}-->
+        <SplitView Name="SplitView"
+                      PanePlacement="{Binding PanePlacement}"
+                      PaneBackground="{Binding SelectedItem.Tag, ElementName=PaneBackgroundSelector}"
+                      OpenPaneLength="{Binding Value, ElementName=OpenPaneLengthSlider}"
+                      CompactPaneLength="{Binding Value, ElementName=CompactPaneLengthSlider}"
+                      DisplayMode="{Binding CurrentDisplayMode}">
+          <SplitView.Pane>
+            <Grid>
+              <Grid.RowDefinitions>
+                <RowDefinition Height="Auto" />
+                <RowDefinition Height="*" />
+                <RowDefinition Height="Auto" />
+              </Grid.RowDefinitions>
+              <TextBlock Text="PANE CONTENT" FontWeight="Bold" Name="PaneHeader" Margin="5,12,0,0" />
+              <ListBoxItem Grid.Row="1" VerticalAlignment="Top" Margin="0 10">
+                <StackPanel Orientation="Horizontal">
+                  <!--Path glyph from materialdesignicons.com-->
+                  <Border Width="48">
+                    <Viewbox Width="24" Height="24" HorizontalAlignment="Left">
+                      <Canvas Width="24" Height="24">
+                        <Path Fill="{DynamicResource SystemControlForegroundBaseHighBrush}" Data="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z" />
+                      </Canvas>
+                    </Viewbox>
+                  </Border>
+                  <TextBlock Text="People" VerticalAlignment="Center" />
+                </StackPanel>
+              </ListBoxItem>
+              <TextBlock Grid.Row="2" Text="Item at bottom" Margin="60,12" />
+            </Grid>
+          </SplitView.Pane>
+
+          <Grid>
+            <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" HorizontalAlignment="Center" VerticalAlignment="Center"  Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" />
+            <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" TextAlignment="Left"  Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" />
+            <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" HorizontalAlignment="Right" TextAlignment="Left"  Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" />
+            <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" VerticalAlignment="Bottom" TextAlignment="Left"  Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" />
+            <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" VerticalAlignment="Bottom" HorizontalAlignment="Right" TextAlignment="Left"  Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" />
+          </Grid>
+
+        </SplitView>
+      </Border>
+      
+    </Grid>
+  </Border>
+
+</UserControl>

+ 21 - 0
samples/ControlCatalog/Pages/SplitViewPage.xaml.cs

@@ -0,0 +1,21 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+using ControlCatalog.ViewModels;
+
+namespace ControlCatalog.Pages
+{
+    public class SplitViewPage : UserControl
+    {
+        public SplitViewPage()
+        {
+            this.InitializeComponent();
+            DataContext = new SplitViewPageViewModel();
+        }
+
+        private void InitializeComponent()
+        {
+            AvaloniaXamlLoader.Load(this);
+        }
+    }
+}

+ 30 - 39
samples/ControlCatalog/Pages/TextBlockPage.xaml

@@ -64,51 +64,42 @@
               <TextDecorationCollection>
                 <TextDecoration
                   Location="Overline"
-                  PenThicknessUnit="Pixel">
-                  <TextDecoration.Pen>
-                    <Pen Thickness="2">
-                      <Pen.Brush>
-                        <LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
-                          <LinearGradientBrush.GradientStops>
-                            <GradientStop Offset="0" Color="Red"/>
-                            <GradientStop Offset="1" Color="Green"/>
-                          </LinearGradientBrush.GradientStops>
-                        </LinearGradientBrush>
-                      </Pen.Brush>
-                    </Pen>
-                  </TextDecoration.Pen>
+                  StrokeThicknessUnit="Pixel"
+                  StrokeThickness="2">
+                  <TextDecoration.Stroke>
+                    <LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
+                      <LinearGradientBrush.GradientStops>
+                        <GradientStop Offset="0" Color="Red"/>
+                        <GradientStop Offset="1" Color="Green"/>
+                      </LinearGradientBrush.GradientStops>
+                    </LinearGradientBrush>
+                  </TextDecoration.Stroke>
                 </TextDecoration>
                 <TextDecoration
                   Location="Strikethrough"
-                  PenThicknessUnit="Pixel">
-                  <TextDecoration.Pen>
-                    <Pen Thickness="1">
-                      <Pen.Brush>
-                        <LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
-                          <LinearGradientBrush.GradientStops>
-                            <GradientStop Offset="0" Color="Green"/>
-                            <GradientStop Offset="1" Color="Blue"/>
-                          </LinearGradientBrush.GradientStops>
-                        </LinearGradientBrush>
-                      </Pen.Brush>
-                    </Pen>
-                  </TextDecoration.Pen>
+                  StrokeThicknessUnit="Pixel"
+                  StrokeThickness="1">
+                  <TextDecoration.Stroke>
+                    <LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
+                      <LinearGradientBrush.GradientStops>
+                        <GradientStop Offset="0" Color="Green"/>
+                        <GradientStop Offset="1" Color="Blue"/>
+                      </LinearGradientBrush.GradientStops>
+                    </LinearGradientBrush>
+                  </TextDecoration.Stroke>
                 </TextDecoration>
                 <TextDecoration
                   Location="Underline"
-                  PenThicknessUnit="Pixel">
-                  <TextDecoration.Pen>
-                    <Pen Thickness="2">
-                      <Pen.Brush>
-                        <LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
-                          <LinearGradientBrush.GradientStops>
-                            <GradientStop Offset="0" Color="Blue"/>
-                            <GradientStop Offset="1" Color="Red"/>
-                          </LinearGradientBrush.GradientStops>
-                        </LinearGradientBrush>
-                      </Pen.Brush>
-                    </Pen>
-                  </TextDecoration.Pen>
+                  StrokeThicknessUnit="Pixel"
+                  StrokeThickness="2">
+                  <TextDecoration.Stroke>
+                    <LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
+                      <LinearGradientBrush.GradientStops>
+                        <GradientStop Offset="0" Color="Blue"/>
+                        <GradientStop Offset="1" Color="Red"/>
+                      </LinearGradientBrush.GradientStops>
+                    </LinearGradientBrush>
+                  </TextDecoration.Stroke>
                 </TextDecoration>
               </TextDecorationCollection>
             </TextBlock.TextDecorations>

+ 79 - 0
samples/ControlCatalog/Pages/ToggleSwitchPage.xaml

@@ -0,0 +1,79 @@
+<UserControl xmlns="https://github.com/avaloniaui"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             x:Class="ControlCatalog.Pages.ToggleSwitchPage" Margin="5">
+  <StackPanel Width="500" HorizontalAlignment="Center">
+    <TextBlock Text="Simple ToggleSwitch" Classes="header"/>
+    <Border Classes="Thin">
+      <StackPanel>
+        <ToggleSwitch Margin="10"/>
+        <TextBox Text="&lt;ToggleSwitch/&gt;" Classes="CodeBox"/>
+      </StackPanel>
+    </Border>
+
+    <TextBlock Text="headered ToggleSwitch" Classes="header"/>
+
+    <Border Classes="Thin">
+      <StackPanel>
+        <ToggleSwitch Content="headered" IsChecked="true" Margin="10"/>
+        <TextBox Classes="CodeBox"
+          Text="&lt;ToggleSwitch&gt;headered&lt;/ToggleSwitch&gt;"/>
+      </StackPanel>
+    </Border>
+
+    <TextBlock Text="Custom content ToggleSwitch" Classes="header"/>
+
+    <Border Classes="Thin">
+      <StackPanel>
+        <ToggleSwitch Content="Custom"
+          OnContent="On"
+          OffContent="Off"
+          Margin="10"/>
+
+        <TextBox Text="&lt;ToggleSwitch Content=&quot;Custom&quot; 
+ContentOn=&quot;On&quot; 
+ContentOff=&quot;Off&quot; /&gt;"
+          Classes="CodeBox"/>
+      </StackPanel>
+    </Border>
+
+    <TextBlock Text="Image content ToggleSwitch" Classes="header"/>
+
+    <Border Classes="Thin">
+      <StackPanel>
+        <ToggleSwitch Content="Just Click!" Margin="10">
+          <ToggleSwitch.OnContent>
+            <Image Source="/Assets/hirsch-899118_640.jpg" Height="32"/>
+          </ToggleSwitch.OnContent>
+
+          <ToggleSwitch.OffContent>
+            <Image Source="/Assets/delicate-arch-896885_640.jpg" Height="32"/>
+          </ToggleSwitch.OffContent>
+
+        </ToggleSwitch>
+      </StackPanel>
+    </Border>
+  </StackPanel>
+
+  <UserControl.Styles >
+    <Style Selector="TextBox.CodeBox" >
+      <Setter Property="Padding" Value="10"/>
+      <Setter Property="IsReadOnly" Value="True"/>
+      <Setter Property="BorderBrush" Value="Transparent"/>
+      <Setter Property="FontSize" Value="14"/>
+      <Setter Property="IsEnabled" Value="true"/>
+    </Style>
+
+    <Style Selector="TextBlock.header">
+      <Setter Property="FontSize" Value="18"/>
+      <Setter Property="Margin" Value="0 20 0 20"/>
+    </Style>
+
+    <Style Selector="Border.Thin">
+      <Setter Property="BorderBrush" Value="Gray"/>
+      <Setter Property="BorderThickness" Value="0.5"/>
+      <Setter Property="CornerRadius" Value="2"/>
+    </Style>
+
+  </UserControl.Styles>
+</UserControl>
+

+ 19 - 0
samples/ControlCatalog/Pages/ToggleSwitchPage.xaml.cs

@@ -0,0 +1,19 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace ControlCatalog.Pages
+{
+    public class ToggleSwitchPage : UserControl
+    {
+        public ToggleSwitchPage()
+        {
+            this.InitializeComponent();
+        }
+
+        private void InitializeComponent()
+        {
+            AvaloniaXamlLoader.Load(this);
+        }
+    }
+}

+ 3 - 3
samples/ControlCatalog/Pages/ToolTipPage.xaml

@@ -12,13 +12,13 @@
               HorizontalAlignment="Center">
             <Border Grid.Column="0"
                     Grid.Row="1"
-                    Background="{DynamicResource ThemeAccentBrush}"
+                    Background="{DynamicResource SystemAccentColor}"
                     Margin="5"
                     Padding="50"
                     ToolTip.Tip="This is a ToolTip">
                 <TextBlock>Hover Here</TextBlock>
             </Border>
-            <CheckBox Grid.Column="1"
+            <ToggleSwitch Grid.Column="1"
                       Margin="5"
                       Grid.Row="0"
                       IsChecked="{Binding ElementName=Border, Path=(ToolTip.IsOpen)}"
@@ -26,7 +26,7 @@
             <Border Name="Border"
                     Grid.Column="1"
                     Grid.Row="1"
-                    Background="{DynamicResource ThemeAccentBrush}"
+                    Background="{DynamicResource SystemAccentColor}"
                     Margin="5"
                     Padding="50"
                     ToolTip.Placement="Bottom">

+ 1 - 0
samples/ControlCatalog/Pages/TreeViewPage.xaml

@@ -20,6 +20,7 @@
 
         <Button Command="{Binding AddItemCommand}">Add</Button>
         <Button Command="{Binding RemoveItemCommand}">Remove</Button>
+        <Button Command="{Binding SelectRandomItemCommand}">Select Random</Button>
 
         <ComboBox SelectedIndex="{Binding SelectionMode, Mode=TwoWay}">
           <ComboBoxItem>Single</ComboBoxItem>

+ 19 - 0
samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml

@@ -0,0 +1,19 @@
+<UserControl xmlns="https://github.com/avaloniaui"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+             x:Class="ControlCatalog.Pages.WindowCustomizationsPage">
+  <StackPanel Spacing="10"  Margin="25">
+    <CheckBox Content="Extend Client Area to Decorations" IsChecked="{Binding ExtendClientAreaEnabled}" />
+    <CheckBox Content="Title Bar" IsChecked="{Binding SystemTitleBarEnabled}" />    
+    <CheckBox Content="Prefer System Chrome" IsChecked="{Binding PreferSystemChromeEnabled}" />
+    <Slider Minimum="-1" Maximum="200" Value="{Binding TitleBarHeight}" />
+    <ComboBox x:Name="TransparencyLevels" SelectedIndex="{Binding TransparencyLevel}">
+      <ComboBoxItem>None</ComboBoxItem>
+      <ComboBoxItem>Transparent</ComboBoxItem>
+      <ComboBoxItem>Blur</ComboBoxItem>
+      <ComboBoxItem>AcrylicBlur</ComboBoxItem>
+    </ComboBox>
+  </StackPanel>
+</UserControl>

+ 19 - 0
samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml.cs

@@ -0,0 +1,19 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace ControlCatalog.Pages
+{
+    public class WindowCustomizationsPage : UserControl
+    {
+        public WindowCustomizationsPage()
+        {
+            this.InitializeComponent();
+        }
+
+        private void InitializeComponent()
+        {
+            AvaloniaXamlLoader.Load(this);
+        }
+    }
+}

+ 6 - 3
samples/ControlCatalog/SideBar.xaml

@@ -12,7 +12,7 @@
     <Style Selector="TabControl.sidebar">
         <Setter Property="TabStripPlacement" Value="Left"/>
         <Setter Property="Padding" Value="8 0 0 0"/>
-        <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush}"/>
+        <Setter Property="Background" Value="{DynamicResource SystemAccentColor}"/>
         <Setter Property="Template">
             <ControlTemplate>
                 <Border 
@@ -67,16 +67,19 @@
         <Setter Property="(ScrollViewer.HorizontalScrollBarVisibility)" Value="Auto"/>
         <Setter Property="(ScrollViewer.VerticalScrollBarVisibility)" Value="Auto"/>
     </Style>
+    <Style Selector="TabControl.sidebar > TabItem:selected /template/ Border#PART_SelectedPipe">
+        <Setter Property="IsVisible" Value="False" />
+    </Style>
     <Style Selector="TabControl.sidebar > TabItem:pointerover">
         <Setter Property="Opacity" Value="1"/>
     </Style>
     <Style Selector="TabControl.sidebar > TabItem:pointerover">
-        <Setter Property="Background" Value="Transparent"/>
+        <Setter Property="Background" Value="{DynamicResource SystemAccentColorLight2}"/>
     </Style>
     <Style Selector="TabControl.sidebar > TabItem:selected">
         <Setter Property="Opacity" Value="1"/>
     </Style>
     <Style Selector="TabControl.sidebar > TabItem:selected">
-        <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush2}"/>
+        <Setter Property="Background" Value="{DynamicResource SystemAccentColorLight1}"/>
     </Style>
 </Styles>

+ 11 - 2
samples/ControlCatalog/ViewModels/ItemsRepeaterPageViewModel.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.ObjectModel;
 using System.Linq;
+using Avalonia.Media;
 using ReactiveUI;
 
 namespace ControlCatalog.ViewModels
@@ -27,7 +28,7 @@ namespace ControlCatalog.ViewModels
         public void AddItem()
         {
             var index = SelectedItem != null ? Items.IndexOf(SelectedItem) : -1;
-            Items.Insert(index + 1, new Item { Text = $"New Item {_newItemIndex++}" });
+            Items.Insert(index + 1, new Item(index + 1) { Text = $"New Item {_newItemIndex++}" });
         }
 
         public void RandomizeHeights()
@@ -52,7 +53,7 @@ namespace ControlCatalog.ViewModels
             _newGenerationIndex++;
 
             return new ObservableCollection<Item>(
-                Enumerable.Range(1, 100000).Select(i => new Item
+                Enumerable.Range(1, 100000).Select(i => new Item(i)
                 {
                     Text = $"Item {i.ToString()} {suffix}"
                 }));
@@ -61,6 +62,12 @@ namespace ControlCatalog.ViewModels
         public class Item : ReactiveObject
         {
             private double _height = double.NaN;
+            private int _index;
+
+            public Item(int index)
+            {
+                _index = index;
+            }
 
             public string Text { get; set; }
             
@@ -69,6 +76,8 @@ namespace ControlCatalog.ViewModels
                 get => _height;
                 set => this.RaiseAndSetIfChanged(ref _height, value);
             }
+
+            public IBrush Background => ((_index % 2) == 0) ? Brushes.Yellow : Brushes.Wheat;
         }
     }
 }

+ 65 - 0
samples/ControlCatalog/ViewModels/MainWindowViewModel.cs

@@ -3,6 +3,8 @@ using Avalonia.Controls;
 using Avalonia.Controls.ApplicationLifetimes;
 using Avalonia.Controls.Notifications;
 using Avalonia.Dialogs;
+using Avalonia.Platform;
+using System;
 using ReactiveUI;
 
 namespace ControlCatalog.ViewModels
@@ -14,6 +16,12 @@ namespace ControlCatalog.ViewModels
         private bool _isMenuItemChecked = true;
         private WindowState _windowState;
         private WindowState[] _windowStates;
+        private int _transparencyLevel;
+        private ExtendClientAreaChromeHints _chromeHints;
+        private bool _extendClientAreaEnabled;
+        private bool _systemTitleBarEnabled;        
+        private bool _preferSystemChromeEnabled;
+        private double _titleBarHeight;
 
         public MainWindowViewModel(IManagedNotificationManager notificationManager)
         {
@@ -62,6 +70,63 @@ namespace ControlCatalog.ViewModels
                 WindowState.Maximized,
                 WindowState.FullScreen,
             };
+
+            this.WhenAnyValue(x => x.SystemTitleBarEnabled, x=>x.PreferSystemChromeEnabled)
+                .Subscribe(x =>
+                {
+                    var hints = ExtendClientAreaChromeHints.NoChrome | ExtendClientAreaChromeHints.OSXThickTitleBar;
+
+                    if(x.Item1)
+                    {
+                        hints |= ExtendClientAreaChromeHints.SystemChrome;
+                    }
+
+                    if(x.Item2)
+                    {
+                        hints |= ExtendClientAreaChromeHints.PreferSystemChrome;
+                    }
+
+                    ChromeHints = hints;
+                });
+
+            SystemTitleBarEnabled = true;            
+            TitleBarHeight = -1;
+        }        
+
+        public int TransparencyLevel
+        {
+            get { return _transparencyLevel; }
+            set { this.RaiseAndSetIfChanged(ref _transparencyLevel, value); }
+        }        
+
+        public ExtendClientAreaChromeHints ChromeHints
+        {
+            get { return _chromeHints; }
+            set { this.RaiseAndSetIfChanged(ref _chromeHints, value); }
+        }        
+
+        public bool ExtendClientAreaEnabled
+        {
+            get { return _extendClientAreaEnabled; }
+            set { this.RaiseAndSetIfChanged(ref _extendClientAreaEnabled, value); }
+        }        
+
+        public bool SystemTitleBarEnabled
+        {
+            get { return _systemTitleBarEnabled; }
+            set { this.RaiseAndSetIfChanged(ref _systemTitleBarEnabled, value); }
+        }        
+
+        public bool PreferSystemChromeEnabled
+        {
+            get { return _preferSystemChromeEnabled; }
+            set { this.RaiseAndSetIfChanged(ref _preferSystemChromeEnabled, value); }
+        }        
+
+        public double TitleBarHeight
+        {
+            get { return _titleBarHeight; }
+            set { this.RaiseAndSetIfChanged(ref _titleBarHeight, value); }
         }
 
         public WindowState WindowState

+ 46 - 0
samples/ControlCatalog/ViewModels/SplitViewPageViewModel.cs

@@ -0,0 +1,46 @@
+using System;
+using Avalonia.Controls;
+using ReactiveUI;
+
+namespace ControlCatalog.ViewModels
+{
+    public class SplitViewPageViewModel : ReactiveObject
+    {
+        private bool _isLeft = true;
+        private int _displayMode = 3; //CompactOverlay
+
+        public bool IsLeft
+        {
+            get => _isLeft;
+            set
+            {
+                this.RaiseAndSetIfChanged(ref _isLeft, value);
+                this.RaisePropertyChanged(nameof(PanePlacement));
+            }
+        }
+        
+        public int DisplayMode
+        {
+            get => _displayMode;
+            set
+            {
+                this.RaiseAndSetIfChanged(ref _displayMode, value);
+                this.RaisePropertyChanged(nameof(CurrentDisplayMode));
+            }
+        }
+
+        public SplitViewPanePlacement PanePlacement => _isLeft ? SplitViewPanePlacement.Left : SplitViewPanePlacement.Right;
+        
+        public SplitViewDisplayMode CurrentDisplayMode
+        {
+            get
+            {
+                if (Enum.IsDefined(typeof(SplitViewDisplayMode), _displayMode))
+                {
+                    return (SplitViewDisplayMode)_displayMode;
+                }
+                return SplitViewDisplayMode.CompactOverlay;
+            }
+        }
+    }
+}

+ 11 - 0
samples/ControlCatalog/ViewModels/TreeViewPageViewModel.cs

@@ -23,12 +23,14 @@ namespace ControlCatalog.ViewModels
 
             AddItemCommand = ReactiveCommand.Create(AddItem);
             RemoveItemCommand = ReactiveCommand.Create(RemoveItem);
+            SelectRandomItemCommand = ReactiveCommand.Create(SelectRandomItem);
         }
 
         public ObservableCollection<Node> Items { get; }
         public SelectionModel Selection { get; }
         public ReactiveCommand<Unit, Unit> AddItemCommand { get; }
         public ReactiveCommand<Unit, Unit> RemoveItemCommand { get; }
+        public ReactiveCommand<Unit, Unit> SelectRandomItemCommand { get; }
 
         public SelectionMode SelectionMode
         {
@@ -74,6 +76,15 @@ namespace ControlCatalog.ViewModels
             }
         }
 
+        private void SelectRandomItem()
+        {
+            var random = new Random();
+            var depth = random.Next(4);
+            var indexes = Enumerable.Range(0, 4).Select(x => random.Next(10));
+            var path = new IndexPath(indexes);
+            Selection.SelectedIndex = path;
+        }
+
         private void SelectionChanged(object sender, SelectionModelSelectionChangedEventArgs e)
         {
             var selected = string.Join(",", e.SelectedIndices);

+ 0 - 2
samples/RenderDemo/App.xaml.cs

@@ -1,5 +1,4 @@
 using Avalonia;
-using Avalonia.Logging.Serilog;
 using Avalonia.Markup.Xaml;
 using Avalonia.ReactiveUI;
 
@@ -22,6 +21,5 @@ namespace RenderDemo
                 .UsePlatformDetect()
                 .UseReactiveUI()
                 .LogToDebug();
-
     }
 }

+ 3 - 0
samples/RenderDemo/MainWindow.xaml

@@ -29,6 +29,9 @@
       <TabItem Header="Animations">
         <pages:AnimationsPage/>
       </TabItem>
+      <TabItem Header="Transitions">
+        <pages:TransitionsPage/>
+      </TabItem>
       <TabItem Header="Clipping">
         <pages:ClippingPage/>
       </TabItem>

+ 2 - 2
samples/RenderDemo/Pages/ClippingPage.xaml

@@ -43,7 +43,7 @@
                   C 72.078834 28.113269 74.047517 25.960974 74.931641 23.777344 
                   C 78.93827 14.586564 73.049722 2.8815081 63.248047 0.67382812
                   C 61.721916 0.22817968 60.165597 0.038541919 58.625 0.07421875 z ">
-      <Border Name="clipChild" Background="{DynamicResource ThemeAccentBrush}" Margin="4">
+      <Border Name="clipChild" Background="Red" Margin="4">
         <!-- Setting opacity puts the TextBox on a new layer -->
         <TextBox Text="Avalonia" Opacity="0.9" VerticalAlignment="Center"/>
         <Border.RenderTransform>
@@ -53,4 +53,4 @@
     </Border>
     <CheckBox Name="useMask" IsChecked="True" Grid.Row="1">Apply Geometry Clip</CheckBox>
   </Grid>
-</UserControl>
+</UserControl>

+ 115 - 0
samples/RenderDemo/Pages/TransitionsPage.xaml

@@ -0,0 +1,115 @@
+<UserControl 
+  xmlns="https://github.com/avaloniaui" 
+  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
+  x:Class="RenderDemo.Pages.TransitionsPage">
+  <UserControl.Styles>
+    <Styles>
+      <Styles.Resources>
+        <Template x:Key="Acorn">
+          <Path Fill="White" Stretch="Uniform"
+                Data="F1 M 16.6309,18.6563C 17.1309,
+                8.15625 29.8809,14.1563 29.8809,
+                14.1563C 30.8809,11.1563 34.1308,
+                11.4063 34.1308,11.4063C 33.5,12 
+                34.6309,13.1563 34.6309,13.1563C 
+                32.1309,13.1562 31.1309,14.9062 
+                31.1309,14.9062C 41.1309,23.9062
+                32.6309,27.9063 32.6309,27.9062C 
+                24.6309,24.9063 21.1309,22.1562 
+                16.6309,18.6563 Z M 16.6309,19.9063C
+                21.6309,24.1563 25.1309,26.1562 
+                31.6309,28.6562C 31.6309,28.6562
+                26.3809,39.1562 18.3809,36.1563C
+                18.3809,36.1563 18,38 16.3809,36.9063C 
+                15,36 16.3809,34.9063 16.3809,34.9063C
+                16.3809,34.9063 10.1309,30.9062 16.6309,19.9063 Z"/>
+        </Template>
+        <Template x:Key="Heart">
+          <Path Fill="Red" Stretch="Uniform" Data="
+          M 272.70141,238.71731 
+          C 206.46141,238.71731 152.70146,292.4773 152.70146,358.71731 
+          C 152.70146,493.47282 288.63461,528.80461 381.26391,662.02535 
+          C 468.83815,529.62199 609.82641,489.17075 609.82641,358.71731 
+          C 609.82641,292.47731 556.06651,238.7173 489.82641,238.71731 
+          C 441.77851,238.71731 400.42481,267.08774 381.26391,307.90481 
+          C 362.10311,267.08773 320.74941,238.7173 272.70141,238.71731 z "/>
+        </Template>
+      </Styles.Resources>
+
+      <Style Selector="Border.Test">
+        <Setter Property="Margin" Value="15"/>
+        <Setter Property="Width" Value="100"/>
+        <Setter Property="Height" Value="100"/>
+        <Setter Property="Child" Value="{StaticResource Acorn}"/>
+        <Setter Property="Transitions">
+          <Transitions>
+            <TransformOperationsTransition Property="RenderTransform"  Duration="0:0:1" />
+          </Transitions>
+        </Setter>
+        <Setter Property="RenderTransform" Value="none" />
+      </Style>
+
+      <Style Selector="Border.Rect1:pointerover">
+        <Setter Property="RenderTransform" Value="rotate(120deg) scale(1.5)" />
+      </Style>
+
+      <Style Selector="Border.Rect2:pointerover">
+        <Setter Property="RenderTransform" Value="scale(0.8)" />
+      </Style>
+
+      <Style Selector="Border.Rect3">
+        <Setter Property="Child" Value="{StaticResource Heart}"/>
+      </Style>
+
+      <Style Selector="Border.Rect3:pointerover">
+        <Setter Property="RenderTransform" Value="rotate(1turn)" />
+      </Style>
+
+      <Style Selector="Border.Rect4:pointerover">
+        <Setter Property="RenderTransform" Value="translateY(-100px)" />
+      </Style>
+
+      <Style Selector="Border.Rect5:pointerover">
+        <Setter Property="RenderTransform" Value="skewX(-20deg)" />
+      </Style>
+
+      <Style Selector="Border.Rect5:pointerover">
+        <Setter Property="RenderTransform" Value="skewX(-20deg)" />
+      </Style>
+
+      <Style Selector="Border.Rect6">
+        <Setter Property="Transitions">
+          <Transitions>
+            <TransformOperationsTransition Property="RenderTransform"  Duration="0:0:0.5" Delay="0:0:1"/>
+          </Transitions>
+        </Setter>
+        <Setter Property="RenderTransform" Value="scale(0.8)" />
+      </Style>
+
+      <Style Selector="Border.Rect6:pointerover">
+        <Setter Property="RenderTransform" Value="none" />
+      </Style>
+
+    </Styles>
+  </UserControl.Styles>
+
+  <Grid>
+    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" ClipToBounds="False">
+      <StackPanel.Clock>
+        <Clock />
+      </StackPanel.Clock>
+      <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+        <TextBlock VerticalAlignment="Center">Hover to activate Transform Keyframe Animations.</TextBlock>
+        <Button Content="{Binding PlayStateText}" Command="{Binding TogglePlayState}" Click="ToggleClock" />
+      </StackPanel>
+      <WrapPanel ClipToBounds="False">
+        <Border Classes="Test Rect1" Background="DarkRed"/>
+        <Border Classes="Test Rect2" Background="Magenta"/>
+        <Border Classes="Test Rect3"/>
+        <Border Classes="Test Rect4" Background="Navy"/>
+        <Border Classes="Test Rect5" Background="SeaGreen"/>
+        <Border Classes="Test Rect6" Background="Orange"/>
+      </WrapPanel>
+    </StackPanel>
+  </Grid>
+</UserControl>

+ 37 - 0
samples/RenderDemo/Pages/TransitionsPage.xaml.cs

@@ -0,0 +1,37 @@
+using Avalonia.Animation;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+using Avalonia.Markup.Xaml;
+using RenderDemo.ViewModels;
+
+namespace RenderDemo.Pages
+{
+    public class TransitionsPage : UserControl
+    {
+        public TransitionsPage()
+        {
+            InitializeComponent();
+            this.DataContext = new AnimationsPageViewModel();
+        }
+
+        private void InitializeComponent()
+        {
+            AvaloniaXamlLoader.Load(this);
+        }
+
+        private void ToggleClock(object sender, RoutedEventArgs args)
+        {
+            var button = sender as Button;
+            var clock = button.Clock;
+
+            if (clock.PlayState == PlayState.Run)
+            {
+                clock.PlayState = PlayState.Pause;
+            }
+            else if (clock.PlayState == PlayState.Pause)
+            {
+                clock.PlayState = PlayState.Run;
+            }
+        }
+    }
+}

+ 0 - 1
samples/RenderDemo/RenderDemo.csproj

@@ -13,7 +13,6 @@
   </ItemGroup>
   <Import Project="..\..\build\SampleApp.props" />
   <Import Project="..\..\build\EmbedXaml.props" />
-  <Import Project="..\..\build\Serilog.props" />
   <Import Project="..\..\build\Rx.props" />
   <Import Project="..\..\build\ReactiveUI.props" />
   <Import Condition="'$(TargetFramework)'=='net461'" Project="..\..\build\NetFX.props" />

+ 2 - 2
samples/RenderDemo/SideBar.xaml

@@ -3,7 +3,7 @@
     <Style Selector="TabControl.sidebar">
         <Setter Property="TabStripPlacement" Value="Left"/>
         <Setter Property="Padding" Value="8 0 0 0"/>
-        <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush}"/>
+        <Setter Property="Background" Value="{DynamicResource SystemAccentColor}"/>
         <Setter Property="Template">
             <ControlTemplate>
                 <Border 
@@ -60,6 +60,6 @@
         <Setter Property="Opacity" Value="1"/>
     </Style>
     <Style Selector="TabControl.sidebar > TabItem:selected /template/ ContentPresenter#PART_ContentPresenter">
-        <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush2}"/>
+        <Setter Property="Background" Value="{DynamicResource SystemAccentColorLight1}"/>
     </Style>
 </Styles>

+ 0 - 2
samples/VirtualizationDemo/Program.cs

@@ -1,9 +1,7 @@
 using System;
 using Avalonia;
 using Avalonia.Controls;
-using Avalonia.Logging.Serilog;
 using Avalonia.ReactiveUI;
-using Serilog;
 
 namespace VirtualizationDemo
 {

+ 0 - 1
samples/VirtualizationDemo/VirtualizationDemo.csproj

@@ -10,7 +10,6 @@
   </ItemGroup>
   <Import Project="..\..\build\SampleApp.props" />
   <Import Project="..\..\build\EmbedXaml.props" />
-  <Import Project="..\..\build\Serilog.props" />
   <Import Project="..\..\build\Rx.props" />
   <Import Project="..\..\build\ReactiveUI.props" />
   <Import Condition="'$(TargetFramework)'=='net461'" Project="..\..\build\NetFX.props" />

+ 0 - 1
samples/interop/Direct3DInteropSample/Direct3DInteropSample.csproj

@@ -26,7 +26,6 @@
         <ProjectReference Include="..\..\..\src\Windows\Avalonia.Direct2D1\Avalonia.Direct2D1.csproj" />
         <ProjectReference Include="..\..\..\src\Windows\Avalonia.Win32\Avalonia.Win32.csproj" />
     </ItemGroup>
-    <Import Project="..\..\..\build\Serilog.props" />
     <Import Project="..\..\..\build\Rx.props" />
     <Import Project="..\..\..\build\ReferenceCoreLibraries.props" />
 </Project>

+ 8 - 0
samples/interop/NativeEmbedSample/App.xaml

@@ -0,0 +1,8 @@
+<Application xmlns="https://github.com/avaloniaui"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             x:Class="NativeEmbedSample.App">
+  <Application.Styles>
+    <StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml"/>
+    <StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseLight.xaml"/>
+  </Application.Styles>
+</Application>

+ 22 - 0
samples/interop/NativeEmbedSample/App.xaml.cs

@@ -0,0 +1,22 @@
+using Avalonia;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Markup.Xaml;
+
+namespace NativeEmbedSample
+{
+    public class App : Application
+    {
+        public override void Initialize()
+        {
+            AvaloniaXamlLoader.Load(this);
+        }
+
+        public override void OnFrameworkInitializationCompleted()
+        {
+            if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime)
+                desktopLifetime.MainWindow = new MainWindow();
+
+            base.OnFrameworkInitializationCompleted();
+        }
+    }
+}

+ 121 - 0
samples/interop/NativeEmbedSample/EmbedSample.cs

@@ -0,0 +1,121 @@
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Text;
+using Avalonia.Controls;
+using Avalonia.Platform;
+using Avalonia.Threading;
+using MonoMac.AppKit;
+using MonoMac.Foundation;
+using MonoMac.WebKit;
+using Encoding = SharpDX.Text.Encoding;
+
+namespace NativeEmbedSample
+{
+    public class EmbedSample : NativeControlHost
+    {
+        public bool IsSecond { get; set; }
+        private Process _mplayer;
+
+        IPlatformHandle CreateLinux(IPlatformHandle parent)
+        {
+            if (IsSecond)
+            {
+                var chooser = GtkHelper.CreateGtkFileChooser(parent.Handle);
+                if (chooser != null)
+                    return chooser;
+            }
+
+            var control = base.CreateNativeControlCore(parent);
+            var nodes = Path.GetFullPath(Path.Combine(typeof(EmbedSample).Assembly.GetModules()[0].FullyQualifiedName,
+                "..",
+                "nodes.mp4"));
+            _mplayer = Process.Start(new ProcessStartInfo("mplayer",
+                $"-vo x11 -zoom -loop 0 -wid {control.Handle.ToInt64()} \"{nodes}\"")
+            {
+                UseShellExecute = false,
+
+            });
+            return control;
+        }
+
+        void DestroyLinux(IPlatformHandle handle)
+        {
+            _mplayer?.Kill();
+            _mplayer = null;
+            base.DestroyNativeControlCore(handle);
+        }
+
+        private const string RichText =
+            @"{\rtf1\ansi\ansicpg1251\deff0\nouicompat\deflang1049{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
+{\colortbl ;\red255\green0\blue0;\red0\green77\blue187;\red0\green176\blue80;\red155\green0\blue211;\red247\green150\blue70;\red75\green172\blue198;}
+{\*\generator Riched20 6.3.9600}\viewkind4\uc1 
+\pard\sa200\sl276\slmult1\f0\fs22\lang9 <PREFIX>I \i am\i0  a \cf1\b Rich Text \cf0\b0\fs24 control\cf2\fs28 !\cf3\fs32 !\cf4\fs36 !\cf1\fs40 !\cf5\fs44 !\cf6\fs48 !\cf0\fs44\par
+}";
+
+        IPlatformHandle CreateWin32(IPlatformHandle parent)
+        {
+            WinApi.LoadLibrary("Msftedit.dll");
+            var handle = WinApi.CreateWindowEx(0, "RICHEDIT50W",
+                @"Rich Edit",
+                0x800000 | 0x10000000 | 0x40000000 | 0x800000 | 0x10000 | 0x0004, 0, 0, 1, 1, parent.Handle,
+                IntPtr.Zero, WinApi.GetModuleHandle(null), IntPtr.Zero);
+            var st = new WinApi.SETTEXTEX { Codepage = 65001, Flags = 0x00000008 };
+            var text = RichText.Replace("<PREFIX>", IsSecond ? "\\qr " : "");
+            var bytes = Encoding.UTF8.GetBytes(text);
+            WinApi.SendMessage(handle, 0x0400 + 97, ref st, bytes);
+            return new PlatformHandle(handle, "HWND");
+
+        }
+
+        void DestroyWin32(IPlatformHandle handle)
+        {
+            WinApi.DestroyWindow(handle.Handle);
+        }
+
+        IPlatformHandle CreateOSX(IPlatformHandle parent)
+        {
+            // Note: We are using MonoMac for example purposes
+            // It shouldn't be used in production apps
+            MacHelper.EnsureInitialized();
+
+            var webView = new WebView();
+            Dispatcher.UIThread.Post(() =>
+            {
+                webView.MainFrame.LoadRequest(new NSUrlRequest(new NSUrl(
+                    IsSecond ? "https://bing.com": "https://google.com/")));
+            });
+            return new MacOSViewHandle(webView);
+
+        }
+
+        void DestroyOSX(IPlatformHandle handle)
+        {
+            ((MacOSViewHandle)handle).Dispose();
+        }
+        
+        protected override IPlatformHandle CreateNativeControlCore(IPlatformHandle parent)
+        {
+            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+                return CreateLinux(parent);
+            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+                return CreateWin32(parent);
+            if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+                return CreateOSX(parent);
+            return base.CreateNativeControlCore(parent);
+        }
+
+        protected override void DestroyNativeControlCore(IPlatformHandle control)
+        {
+            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+                DestroyLinux(control);
+            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+                DestroyWin32(control);
+            else if(RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+                DestroyOSX(control);
+            else
+                base.DestroyNativeControlCore(control);
+        }
+    }
+}

+ 58 - 0
samples/interop/NativeEmbedSample/GtkHelper.cs

@@ -0,0 +1,58 @@
+using System;
+using System.Threading.Tasks;
+using Avalonia.Controls.Platform;
+using Avalonia.Platform;
+using Avalonia.Platform.Interop;
+using Avalonia.X11.NativeDialogs;
+using static Avalonia.X11.NativeDialogs.Gtk;
+using static Avalonia.X11.NativeDialogs.Glib;
+namespace NativeEmbedSample
+{
+    public class GtkHelper
+    {
+        private static  Task<bool> s_gtkTask;
+        class FileChooser : INativeControlHostDestroyableControlHandle
+        {
+            private readonly IntPtr _widget;
+
+            public FileChooser(IntPtr widget, IntPtr xid)
+            {
+                _widget = widget;
+                Handle = xid;
+            }
+
+            public IntPtr Handle { get; }
+            public string HandleDescriptor => "XID";
+            public void Destroy()
+            {
+                RunOnGlibThread(() =>
+                {
+                    gtk_widget_destroy(_widget);
+                    return 0;
+                }).Wait();
+            }
+        }
+
+        
+        
+        public static IPlatformHandle CreateGtkFileChooser(IntPtr parentXid)
+        {
+            if (s_gtkTask == null)
+                s_gtkTask = StartGtk();
+            if (!s_gtkTask.Result)
+                return null;
+            return RunOnGlibThread(() =>
+            {
+                using (var title = new Utf8Buffer("Embedded"))
+                {
+                    var widget = gtk_file_chooser_dialog_new(title, IntPtr.Zero, GtkFileChooserAction.SelectFolder,
+                        IntPtr.Zero);
+                    gtk_widget_realize(widget);
+                    var xid = gdk_x11_window_get_xid(gtk_widget_get_window(widget));
+                    gtk_window_present(widget);
+                    return new FileChooser(widget,  xid);
+                }
+            }).Result;
+        }
+    }
+}

+ 39 - 0
samples/interop/NativeEmbedSample/MacHelper.cs

@@ -0,0 +1,39 @@
+using System;
+using Avalonia.Platform;
+using MonoMac.AppKit;
+
+namespace NativeEmbedSample
+{
+    public class MacHelper
+    {
+        private static bool _isInitialized;
+
+        public static void EnsureInitialized()
+        {
+            if (_isInitialized)
+                return;
+            _isInitialized = true;
+            NSApplication.Init();
+        }
+    }
+
+    class MacOSViewHandle : IPlatformHandle, IDisposable
+    {
+        private NSView _view;
+
+        public MacOSViewHandle(NSView view)
+        {
+            _view = view;
+        }
+
+        public IntPtr Handle => _view?.Handle ?? IntPtr.Zero;
+        public string HandleDescriptor => "NSView";
+
+        public void Dispose()
+        {
+            _view.Dispose();
+            _view = null;
+        }
+    }
+
+}

+ 52 - 0
samples/interop/NativeEmbedSample/MainWindow.xaml

@@ -0,0 +1,52 @@
+<Window xmlns="https://github.com/avaloniaui" MinWidth="500" MinHeight="300"
+        Width="1024" Height="800"
+        Title="Native embedding sample"
+        xmlns:local="clr-namespace:NativeEmbedSample"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        x:Class="NativeEmbedSample.MainWindow">
+  <DockPanel>
+    <Menu DockPanel.Dock="Top">
+      <MenuItem Header="Test">
+        <MenuItem Header="SubMenu">
+          <MenuItem Header="Item 1"/>
+          <MenuItem Header="Item 2"/>
+          <MenuItem Header="Item 3"/>  
+        </MenuItem>
+        <MenuItem Header="Item 1"/>
+        <MenuItem Header="Item 2"/>
+        <MenuItem Header="Item 3"/>  
+      </MenuItem>
+    </Menu>
+    <DockPanel DockPanel.Dock="Top">
+      <Button DockPanel.Dock="Right" Click="ShowPopupDelay">Show popup (delay)</Button>
+      <Button DockPanel.Dock="Right" Click="ShowPopup">Show popup</Button>
+      <Border DockPanel.Dock="Right" Background="#c0c0c0">
+        <ToolTip.Tip>
+          <ToolTip>
+              <TextBlock>Text</TextBlock>
+          </ToolTip>
+        </ToolTip.Tip>
+        <TextBlock>Tooltip</TextBlock>
+      </Border>
+      <TextBox Text="Lorem ipsum dolor sit amet"/>
+      
+    </DockPanel>
+    <Grid ColumnDefinitions="*,5,*">
+      <DockPanel>
+        <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
+          <CheckBox x:Name="firstVisible" IsChecked="True"/>
+          <TextBlock>Visible</TextBlock>
+        </StackPanel>
+        <local:EmbedSample IsVisible="{Binding #firstVisible.IsChecked}"/>
+      </DockPanel>
+      <GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Stretch" />
+      <DockPanel Grid.Column="2">
+        <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
+          <CheckBox x:Name="secondVisible" IsChecked="True"/>
+          <TextBlock>Visible</TextBlock>
+        </StackPanel>
+        <local:EmbedSample IsSecond="True" IsVisible="{Binding #secondVisible.IsChecked}"/>
+      </DockPanel>
+    </Grid>
+  </DockPanel>
+</Window>

+ 36 - 0
samples/interop/NativeEmbedSample/MainWindow.xaml.cs

@@ -0,0 +1,36 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+using Avalonia.Markup.Xaml;
+
+namespace NativeEmbedSample
+{
+    public class MainWindow : Window
+    {
+        public MainWindow()
+        {
+            AvaloniaXamlLoader.Load(this);
+            this.AttachDevTools();
+        }
+
+        public async void ShowPopupDelay(object sender, RoutedEventArgs args)
+        {
+            await Task.Delay(3000);
+            ShowPopup(sender, args);
+        }
+
+        public void ShowPopup(object sender, RoutedEventArgs args)
+        {
+
+            new ContextMenu()
+            {
+                Items = new List<MenuItem>
+                {
+                    new MenuItem() { Header = "Test" }, new MenuItem() { Header = "Test" }
+                }
+            }.Open((Control)sender);
+        }
+    }
+}

+ 31 - 0
samples/interop/NativeEmbedSample/NativeEmbedSample.csproj

@@ -0,0 +1,31 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>netcoreapp2.0</TargetFramework>
+    <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="MonoMac.NetStandard" Version="0.0.4" />
+    <ProjectReference Include="..\..\..\src\Avalonia.Desktop\Avalonia.Desktop.csproj" />
+    <ProjectReference Include="..\..\..\src\Windows\Avalonia.Direct2D1\Avalonia.Direct2D1.csproj" />
+    <ProjectReference Include="..\..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" />
+    <ProjectReference Include="..\..\..\src\Avalonia.X11\Avalonia.X11.csproj" />
+    <PackageReference Include="Avalonia.Angle.Windows.Natives" Version="2.1.0.2019013001" />
+
+    <AvaloniaResource Include="**\*.xaml">
+      <SubType>Designer</SubType>
+    </AvaloniaResource>
+    <None Remove="nodes.mp4" />
+    <Content Include="nodes.mp4">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Compile Include="..\..\..\src\Avalonia.X11\NativeDialogs\Gtk.cs" />
+  </ItemGroup>
+
+  <Import Project="..\..\..\build\SampleApp.props" />
+  <Import Project="..\..\..\build\BuildTargets.targets" />
+  <Import Project="..\..\..\build\ReferenceCoreLibraries.props" />
+</Project>

+ 17 - 0
samples/interop/NativeEmbedSample/Program.cs

@@ -0,0 +1,17 @@
+using Avalonia;
+
+namespace NativeEmbedSample
+{
+    class Program
+    {
+        static int Main(string[] args) => BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
+
+        public static AppBuilder BuildAvaloniaApp()
+            => AppBuilder.Configure<App>()
+                .With(new AvaloniaNativePlatformOptions()
+                {
+                })
+                .UsePlatformDetect();
+
+    }
+}

+ 74 - 0
samples/interop/NativeEmbedSample/WinApi.cs

@@ -0,0 +1,74 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace NativeEmbedSample
+{
+    public unsafe class WinApi
+    {
+        public enum CommonControls : uint
+        {
+            ICC_LISTVIEW_CLASSES   = 0x00000001, // listview, header
+            ICC_TREEVIEW_CLASSES   = 0x00000002, // treeview, tooltips
+            ICC_BAR_CLASSES    = 0x00000004, // toolbar, statusbar, trackbar, tooltips
+            ICC_TAB_CLASSES    = 0x00000008, // tab, tooltips
+            ICC_UPDOWN_CLASS       = 0x00000010, // updown
+            ICC_PROGRESS_CLASS     = 0x00000020, // progress
+            ICC_HOTKEY_CLASS       = 0x00000040, // hotkey
+            ICC_ANIMATE_CLASS      = 0x00000080, // animate
+            ICC_WIN95_CLASSES      = 0x000000FF,
+            ICC_DATE_CLASSES       = 0x00000100, // month picker, date picker, time picker, updown
+            ICC_USEREX_CLASSES     = 0x00000200, // comboex
+            ICC_COOL_CLASSES       = 0x00000400, // rebar (coolbar) control
+            ICC_INTERNET_CLASSES   = 0x00000800,
+            ICC_PAGESCROLLER_CLASS = 0x00001000,  // page scroller
+            ICC_NATIVEFNTCTL_CLASS = 0x00002000,  // native font control
+            ICC_STANDARD_CLASSES   = 0x00004000,
+            ICC_LINK_CLASS     = 0x00008000
+        }
+
+        [StructLayout(LayoutKind.Sequential)]
+        public struct INITCOMMONCONTROLSEX
+        {
+            public int dwSize;
+            public uint dwICC;
+        }
+
+        [DllImport("Comctl32.dll")]
+        public static extern void InitCommonControlsEx(ref INITCOMMONCONTROLSEX init);
+
+        [DllImport("user32.dll", SetLastError = true)]
+        public static extern bool DestroyWindow(IntPtr hwnd);
+
+        [DllImport("kernel32.dll")]
+        public static extern IntPtr LoadLibrary(string lib);
+
+
+        [DllImport("kernel32.dll")]
+        public static extern IntPtr GetModuleHandle(string lpModuleName);
+
+        [DllImport("user32.dll", SetLastError = true)]
+        public static extern IntPtr CreateWindowEx(
+            int dwExStyle,
+            string lpClassName,
+            string lpWindowName,
+            uint dwStyle,
+            int x,
+            int y,
+            int nWidth,
+            int nHeight,
+            IntPtr hWndParent,
+            IntPtr hMenu,
+            IntPtr hInstance,
+            IntPtr lpParam);
+
+        [StructLayout(LayoutKind.Sequential)]
+        public struct SETTEXTEX
+        {
+            public uint Flags;
+            public uint Codepage;
+        }
+
+        [DllImport("user32.dll", CharSet = CharSet.Unicode, EntryPoint = "SendMessageW")]
+        public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, ref SETTEXTEX wParam, byte[] lParam);
+    }
+}

部分文件因文件數量過多而無法顯示