Browse Source

Merge branch 'master' into fixes/dont-cover-taskbar-with-system-decorations-hidden

pull/805/head^2
danwalmsley 10 years ago
committed by GitHub
parent
commit
022cbf64b8
  1. 136
      Avalonia.sln
  2. 26
      samples/TestApplication/App.config
  3. 44
      samples/TestApplication/Program.cs
  4. 39
      samples/TestApplication/Properties/AssemblyInfo.cs
  5. 177
      samples/TestApplication/TestApplication.csproj
  6. 26
      samples/TestApplication/TestApplication.v2.ncrunchproject
  7. 10
      samples/TestApplication/packages.config
  8. 83
      samples/TestApplicationShared/App.cs
  9. 121
      samples/TestApplicationShared/GalleryStyle.cs
  10. 8
      samples/TestApplicationShared/Item.cs
  11. 902
      samples/TestApplicationShared/MainWindow.cs
  12. 16
      samples/TestApplicationShared/Node.cs
  13. 29
      samples/TestApplicationShared/TestApplicationShared.projitems
  14. 13
      samples/TestApplicationShared/TestApplicationShared.shproj
  15. 26
      samples/TestApplicationShared/TestApplicationShared.v2.ncrunchproject
  16. BIN
      samples/TestApplicationShared/github_icon.png
  17. 128
      samples/TestApplicationShared/html.htm
  18. BIN
      samples/TestApplicationShared/pattern.jpg
  19. 22
      samples/XamlTestApplication/App.config
  20. 11
      samples/XamlTestApplication/App.cs
  21. 38
      samples/XamlTestApplication/Program.cs
  22. 39
      samples/XamlTestApplication/Properties/AssemblyInfo.cs
  23. 187
      samples/XamlTestApplication/XamlTestApplication.csproj
  24. 26
      samples/XamlTestApplication/XamlTestApplication.v2.ncrunchproject
  25. 12
      samples/XamlTestApplication/packages.config
  26. 30
      samples/XamlTestApplicationPcl/Properties/AssemblyInfo.cs
  27. 113
      samples/XamlTestApplicationPcl/TestScrollable.cs
  28. 103
      samples/XamlTestApplicationPcl/ViewModels/EditorViewModel.cs
  29. 127
      samples/XamlTestApplicationPcl/ViewModels/MainWindowViewModel.cs
  30. 17
      samples/XamlTestApplicationPcl/ViewModels/TestItem.cs
  31. 23
      samples/XamlTestApplicationPcl/ViewModels/TestNode.cs
  32. 32
      samples/XamlTestApplicationPcl/Views/MainWindow.cs
  33. 400
      samples/XamlTestApplicationPcl/Views/MainWindow.xaml
  34. 14
      samples/XamlTestApplicationPcl/XamlTestApp.cs
  35. 8
      samples/XamlTestApplicationPcl/XamlTestApp.xaml
  36. 150
      samples/XamlTestApplicationPcl/XamlTestApplicationPcl.csproj
  37. 26
      samples/XamlTestApplicationPcl/XamlTestApplicationPcl.v2.ncrunchproject
  38. BIN
      samples/XamlTestApplicationPcl/github_icon.png
  39. 6
      samples/XamlTestApplicationPcl/packages.config
  40. BIN
      samples/XamlTestApplicationPcl/pattern.jpg
  41. 20
      src/Android/Avalonia.Android/AndroidPlatform.cs
  42. 1
      src/Android/Avalonia.Android/Avalonia.Android.csproj
  43. 59
      src/Android/Avalonia.Android/PlatformIconLoader.cs
  44. 3
      src/Avalonia.Controls/Platform/IWindowIconImpl.cs
  45. 2
      src/Avalonia.Controls/WindowIcon.cs
  46. 6
      src/Gtk/Avalonia.Gtk/IconImpl.cs
  47. 16
      src/Windows/Avalonia.Win32/IconImpl.cs
  48. 36
      src/iOS/Avalonia.iOS/PlatformIconLoader.cs
  49. 1
      src/iOS/Avalonia.iOSTestApplication/Avalonia.iOSTestApplication.csproj

136
Avalonia.sln

@ -63,22 +63,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.Markup.Xaml", "src
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{9B9E3891-2366-4253-A952-D08BCEB71098}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication", "samples\TestApplication\TestApplication.csproj", "{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}"
ProjectSection(ProjectDependencies) = postProject
{3E908F67-5543-4879-A1DC-08EACE79B3CD} = {3E908F67-5543-4879-A1DC-08EACE79B3CD}
{FB05AC90-89BA-4F2F-A924-F37875FB547C} = {FB05AC90-89BA-4F2F-A924-F37875FB547C}
{811A76CF-1CF6-440F-963B-BBE31BD72A82} = {811A76CF-1CF6-440F-963B-BBE31BD72A82}
{54F237D5-A70A-4752-9656-0C70B1A7B047} = {54F237D5-A70A-4752-9656-0C70B1A7B047}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlTestApplication", "samples\XamlTestApplication\XamlTestApplication.csproj", "{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}"
ProjectSection(ProjectDependencies) = postProject
{3E908F67-5543-4879-A1DC-08EACE79B3CD} = {3E908F67-5543-4879-A1DC-08EACE79B3CD}
{FB05AC90-89BA-4F2F-A924-F37875FB547C} = {FB05AC90-89BA-4F2F-A924-F37875FB547C}
{811A76CF-1CF6-440F-963B-BBE31BD72A82} = {811A76CF-1CF6-440F-963B-BBE31BD72A82}
{54F237D5-A70A-4752-9656-0C70B1A7B047} = {54F237D5-A70A-4752-9656-0C70B1A7B047}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{A689DEF5-D50F-4975-8B72-124C9EB54066}"
ProjectSection(SolutionItems) = preProject
src\Shared\SharedAssemblyInfo.cs = src\Shared\SharedAssemblyInfo.cs
@ -105,8 +89,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BindingTest", "samples\Bind
{B61B66A3-B82D-4875-8001-89D3394FE0C9} = {B61B66A3-B82D-4875-8001-89D3394FE0C9}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlTestApplicationPcl", "samples\XamlTestApplicationPcl\XamlTestApplicationPcl.csproj", "{EA113F1A-D8D7-4142-9948-353270E7EBAE}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "RenderHelpers", "src\Shared\RenderHelpers\RenderHelpers.shproj", "{3C4C0CB4-0C0F-4450-A37B-148C84FF905F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Skia", "Skia", "{3743B0F2-CC41-4F14-A8C8-267F579BF91E}"
@ -123,8 +105,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.Skia.iOS.TestApp",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.Skia.iOS", "src\Skia\Avalonia.Skia.iOS\Avalonia.Skia.iOS.csproj", "{47BE08A7-5985-410B-9FFC-2264B8EA595F}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TestApplicationShared", "samples\TestApplicationShared\TestApplicationShared.shproj", "{78345174-5B52-4A14-B9FD-D5F2428137F0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Android", "Android", "{7CF9789C-F1D3-4D0E-90E5-F1DF67A2753F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.Android", "src\Android\Avalonia.Android\Avalonia.Android.csproj", "{7B92AF71-6287-4693-9DCB-BD5B6E927E23}"
@ -185,9 +165,7 @@ Global
src\Skia\Avalonia.Skia\Avalonia.Skia.projitems*{47be08a7-5985-410b-9ffc-2264b8ea595f}*SharedItemsImports = 4
tests\Avalonia.RenderTests\Avalonia.RenderTests.projitems*{48840edd-24bf-495d-911e-2eb12ae75d3b}*SharedItemsImports = 13
src\Shared\PlatformSupport\PlatformSupport.projitems*{4a1abb09-9047-4bd5-a4ad-a055e52c5ee0}*SharedItemsImports = 4
samples\TestApplicationShared\TestApplicationShared.projitems*{78345174-5b52-4a14-b9fd-d5f2428137f0}*SharedItemsImports = 13
src\Shared\PlatformSupport\PlatformSupport.projitems*{7b92af71-6287-4693-9dcb-bd5b6e927e23}*SharedItemsImports = 4
samples\TestApplicationShared\TestApplicationShared.projitems*{8c923867-8a8f-4f6b-8b80-47d9e8436166}*SharedItemsImports = 4
src\Shared\RenderHelpers\RenderHelpers.projitems*{925dd807-b651-475f-9f7c-cbeb974ce43d}*SharedItemsImports = 4
src\Skia\Avalonia.Skia\Avalonia.Skia.projitems*{925dd807-b651-475f-9f7c-cbeb974ce43d}*SharedItemsImports = 4
src\Shared\RenderHelpers\RenderHelpers.projitems*{bd43f7c0-396b-4aa1-bad9-dfde54d51298}*SharedItemsImports = 4
@ -195,7 +173,6 @@ Global
tests\Avalonia.RenderTests\Avalonia.RenderTests.projitems*{d35a9f3d-8bb0-496e-bf72-444038a7debb}*SharedItemsImports = 4
tests\Avalonia.RenderTests\Avalonia.RenderTests.projitems*{dabfd304-d6a4-4752-8123-c2ccf7ac7831}*SharedItemsImports = 4
tests\Avalonia.RenderTests\Avalonia.RenderTests.projitems*{e106cf37-4066-4615-b684-172a6d30b058}*SharedItemsImports = 4
samples\TestApplicationShared\TestApplicationShared.projitems*{e3a1060b-50d0-44e8-88b6-f44ef2e5bd72}*SharedItemsImports = 4
src\Shared\PlatformSupport\PlatformSupport.projitems*{e4d9629c-f168-4224-3f51-a5e482ffbc42}*SharedItemsImports = 13
src\Shared\RenderHelpers\RenderHelpers.projitems*{fb05ac90-89ba-4f2f-a924-f37875fb547c}*SharedItemsImports = 4
EndGlobalSection
@ -1158,79 +1135,6 @@ Global
{3E53A01A-B331-47F3-B828-4A5717E77A24}.Release|Mono.Build.0 = Release|Any CPU
{3E53A01A-B331-47F3-B828-4A5717E77A24}.Release|x86.ActiveCfg = Release|Any CPU
{3E53A01A-B331-47F3-B828-4A5717E77A24}.Release|x86.Build.0 = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Ad-Hoc|Mono.ActiveCfg = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.AppStore|Any CPU.Build.0 = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.AppStore|iPhone.Build.0 = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.AppStore|Mono.ActiveCfg = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.AppStore|x86.ActiveCfg = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.AppStore|x86.Build.0 = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|iPhone.Build.0 = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|Mono.ActiveCfg = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|x86.ActiveCfg = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|x86.Build.0 = Debug|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Release|Any CPU.Build.0 = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Release|iPhone.ActiveCfg = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Release|iPhone.Build.0 = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Release|Mono.ActiveCfg = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Release|x86.ActiveCfg = Release|Any CPU
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Release|x86.Build.0 = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Ad-Hoc|Mono.ActiveCfg = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.AppStore|Any CPU.Build.0 = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.AppStore|iPhone.Build.0 = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.AppStore|Mono.ActiveCfg = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.AppStore|x86.ActiveCfg = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.AppStore|x86.Build.0 = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|iPhone.Build.0 = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|Mono.ActiveCfg = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|x86.ActiveCfg = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Debug|x86.Build.0 = Debug|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Release|Any CPU.Build.0 = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Release|iPhone.ActiveCfg = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Release|iPhone.Build.0 = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Release|Mono.ActiveCfg = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Release|x86.ActiveCfg = Release|Any CPU
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}.Release|x86.Build.0 = Release|Any CPU
{54F237D5-A70A-4752-9656-0C70B1A7B047}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{54F237D5-A70A-4752-9656-0C70B1A7B047}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{54F237D5-A70A-4752-9656-0C70B1A7B047}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
@ -1497,42 +1401,6 @@ Global
{08B3E6B9-1CD5-443C-9F61-6D49D1C5F162}.Release|Mono.Build.0 = Release|Any CPU
{08B3E6B9-1CD5-443C-9F61-6D49D1C5F162}.Release|x86.ActiveCfg = Release|Any CPU
{08B3E6B9-1CD5-443C-9F61-6D49D1C5F162}.Release|x86.Build.0 = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Ad-Hoc|Mono.ActiveCfg = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.AppStore|Any CPU.Build.0 = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.AppStore|iPhone.Build.0 = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.AppStore|Mono.ActiveCfg = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.AppStore|x86.ActiveCfg = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.AppStore|x86.Build.0 = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Debug|iPhone.Build.0 = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Debug|Mono.ActiveCfg = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Debug|x86.ActiveCfg = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Debug|x86.Build.0 = Debug|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Release|Any CPU.Build.0 = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Release|iPhone.ActiveCfg = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Release|iPhone.Build.0 = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Release|Mono.ActiveCfg = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Release|x86.ActiveCfg = Release|Any CPU
{EA113F1A-D8D7-4142-9948-353270E7EBAE}.Release|x86.Build.0 = Release|Any CPU
{925DD807-B651-475F-9F7C-CBEB974CE43D}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{925DD807-B651-475F-9F7C-CBEB974CE43D}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{925DD807-B651-475F-9F7C-CBEB974CE43D}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
@ -2481,15 +2349,12 @@ Global
{E106CF37-4066-4615-B684-172A6D30B058} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B}
{99135EAB-653D-47E4-A378-C96E1278CA44} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B}
{3E53A01A-B331-47F3-B828-4A5717E77A24} = {8B6A8209-894F-4BA1-B880-965FD453982C}
{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72} = {9B9E3891-2366-4253-A952-D08BCEB71098}
{78CAFE33-DBEB-4132-8A28-81CFE8A4933C} = {9B9E3891-2366-4253-A952-D08BCEB71098}
{54F237D5-A70A-4752-9656-0C70B1A7B047} = {B9894058-278A-46B5-B6ED-AD613FCC03B3}
{FB05AC90-89BA-4F2F-A924-F37875FB547C} = {B9894058-278A-46B5-B6ED-AD613FCC03B3}
{E4D9629C-F168-4224-3F51-A5E482FFBC42} = {A689DEF5-D50F-4975-8B72-124C9EB54066}
{6417E941-21BC-467B-A771-0DE389353CE6} = {8B6A8209-894F-4BA1-B880-965FD453982C}
{8EF392D5-1416-45AA-9956-7CBBC3229E8A} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B}
{08B3E6B9-1CD5-443C-9F61-6D49D1C5F162} = {9B9E3891-2366-4253-A952-D08BCEB71098}
{EA113F1A-D8D7-4142-9948-353270E7EBAE} = {9B9E3891-2366-4253-A952-D08BCEB71098}
{3C4C0CB4-0C0F-4450-A37B-148C84FF905F} = {A689DEF5-D50F-4975-8B72-124C9EB54066}
{2F59F3D0-748D-4652-B01E-E0D954756308} = {3743B0F2-CC41-4F14-A8C8-267F579BF91E}
{925DD807-B651-475F-9F7C-CBEB974CE43D} = {3743B0F2-CC41-4F14-A8C8-267F579BF91E}
@ -2497,7 +2362,6 @@ Global
{F92E55A5-ED73-4CCB-AB4B-0541B6757F31} = {3743B0F2-CC41-4F14-A8C8-267F579BF91E}
{DA49C5F3-BE95-461C-B999-072128CCF59E} = {3743B0F2-CC41-4F14-A8C8-267F579BF91E}
{47BE08A7-5985-410B-9FFC-2264B8EA595F} = {3743B0F2-CC41-4F14-A8C8-267F579BF91E}
{78345174-5B52-4A14-B9FD-D5F2428137F0} = {9B9E3891-2366-4253-A952-D08BCEB71098}
{7B92AF71-6287-4693-9DCB-BD5B6E927E23} = {7CF9789C-F1D3-4D0E-90E5-F1DF67A2753F}
{FF69B927-C545-49AE-8E16-3D14D621AA12} = {7CF9789C-F1D3-4D0E-90E5-F1DF67A2753F}
{4488AD85-1495-4809-9AA4-DDFE0A48527E} = {0CB0B92E-6CFF-4240-80A5-CCAFE75D91E1}

26
samples/TestApplication/App.config

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="SharpDX.Direct2D1" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SharpDX" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SharpDX.DXGI" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Mono.Cairo" publicKeyToken="0738eb9f132ed756" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

44
samples/TestApplication/Program.cs

@ -1,44 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using System.Linq;
using System.IO;
using System.Reactive.Linq;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Collections;
using Avalonia.Controls;
using Avalonia.Controls.Html;
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Shapes;
using Avalonia.Controls.Templates;
using Avalonia.Diagnostics;
using Avalonia.Layout;
using Avalonia.Media;
using Avalonia.Media.Imaging;
#if AVALONIA_GTK
using Avalonia.Gtk;
#endif
using ReactiveUI;
namespace TestApplication
{
internal class Program
{
private static void Main(string[] args)
{
// The version of ReactiveUI currently included is for WPF and so expects a WPF
// dispatcher. This makes sure it's initialized.
System.Windows.Threading.Dispatcher foo = System.Windows.Threading.Dispatcher.CurrentDispatcher;
var app = new App();
AppBuilder.Configure(app)
.UsePlatformDetect()
.SetupWithoutStarting();
app.Run();
}
}
}

39
samples/TestApplication/Properties/AssemblyInfo.cs

@ -1,39 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TestApplication")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestApplication")]
[assembly: AssemblyCopyright("Copyright \u00A9 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f8dad012-f4ec-4b63-b64f-320901338290")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

177
samples/TestApplication/TestApplication.csproj

@ -1,177 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TestApplication</RootNamespace>
<AssemblyName>TestApplication</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Serilog, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\packages\Serilog.1.5.14\lib\net45\Serilog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Serilog.FullNetFx, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\packages\Serilog.1.5.14\lib\net45\Serilog.FullNetFx.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Reactive.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Core.3.0.0\lib\net45\System.Reactive.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Interfaces, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Interfaces.3.0.0\lib\net45\System.Reactive.Interfaces.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Linq, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Linq.3.0.0\lib\net45\System.Reactive.Linq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.PlatformServices, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.PlatformServices.3.0.0\lib\net45\System.Reactive.PlatformServices.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Windows.Threading, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Windows.Threading.3.0.0\lib\net45\System.Reactive.Windows.Threading.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Avalonia.DotNetFrameworkRuntime\Avalonia.DotNetFrameworkRuntime.csproj">
<Project>{4A1ABB09-9047-4BD5-A4AD-A055E52C5EE0}</Project>
<Name>Avalonia.DotNetFrameworkRuntime</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Gtk\Avalonia.Cairo\Avalonia.Cairo.csproj">
<Project>{FB05AC90-89BA-4F2F-A924-F37875FB547C}</Project>
<Name>Avalonia.Cairo</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Gtk\Avalonia.Gtk\Avalonia.Gtk.csproj">
<Project>{54f237d5-a70a-4752-9656-0c70b1a7b047}</Project>
<Name>Avalonia.Gtk</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup.Xaml\Avalonia.Markup.Xaml.csproj">
<Project>{3e53a01a-b331-47f3-b828-4a5717e77a24}</Project>
<Name>Avalonia.Markup.Xaml</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup\Avalonia.Markup.csproj">
<Project>{6417e941-21bc-467b-a771-0de389353ce6}</Project>
<Name>Avalonia.Markup</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Animation\Avalonia.Animation.csproj">
<Project>{D211E587-D8BC-45B9-95A4-F297C8FA5200}</Project>
<Name>Avalonia.Animation</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Base\Avalonia.Base.csproj">
<Project>{B09B78D8-9B26-48B0-9149-D64A2F120F3F}</Project>
<Name>Avalonia.Base</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Controls\Avalonia.Controls.csproj">
<Project>{D2221C82-4A25-4583-9B43-D791E3F6820C}</Project>
<Name>Avalonia.Controls</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.DesignerSupport\Avalonia.DesignerSupport.csproj">
<Project>{799a7bb5-3c2c-48b6-85a7-406a12c420da}</Project>
<Name>Avalonia.DesignerSupport</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj">
<Project>{7062AE20-5DCC-4442-9645-8195BDECE63E}</Project>
<Name>Avalonia.Diagnostics</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.HtmlRenderer\Avalonia.HtmlRenderer.csproj">
<Project>{5FB2B005-0A7F-4DAD-ADD4-3ED01444E63D}</Project>
<Name>Avalonia.HtmlRenderer</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Input\Avalonia.Input.csproj">
<Project>{62024B2D-53EB-4638-B26B-85EEAA54866E}</Project>
<Name>Avalonia.Input</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Interactivity\Avalonia.Interactivity.csproj">
<Project>{6B0ED19D-A08B-461C-A9D9-A9EE40B0C06B}</Project>
<Name>Avalonia.Interactivity</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Layout\Avalonia.Layout.csproj">
<Project>{42472427-4774-4C81-8AFF-9F27B8E31721}</Project>
<Name>Avalonia.Layout</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj">
<Project>{6417B24E-49C2-4985-8DB2-3AB9D898EC91}</Project>
<Name>Avalonia.ReactiveUI</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Visuals\Avalonia.Visuals.csproj">
<Project>{EB582467-6ABB-43A1-B052-E981BA910E3A}</Project>
<Name>Avalonia.Visuals</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Styling\Avalonia.Styling.csproj">
<Project>{F1BAA01A-F176-4C6A-B39D-5B40BB1B148F}</Project>
<Name>Avalonia.Styling</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj">
<Project>{3E10A5FA-E8DA-48B1-AD44-6A5B6CB7750F}</Project>
<Name>Avalonia.Themes.Default</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Windows\Avalonia.Direct2D1\Avalonia.Direct2D1.csproj" Condition="'$(Platform)'!='Mono'">
<Project>{3E908F67-5543-4879-A1DC-08EACE79B3CD}</Project>
<Name>Avalonia.Direct2D1</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Windows\Avalonia.Win32\Avalonia.Win32.csproj" Condition="'$(Platform)'!='Mono'">
<Project>{811A76CF-1CF6-440F-963B-BBE31BD72A82}</Project>
<Name>Avalonia.Win32</Name>
</ProjectReference>
</ItemGroup>
<Import Project="..\TestApplicationShared\TestApplicationShared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\src\Shared\avalonia.platform.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

26
samples/TestApplication/TestApplication.v2.ncrunchproject

@ -1,26 +0,0 @@
<ProjectConfiguration>
<AutoDetectNugetBuildDependencies>true</AutoDetectNugetBuildDependencies>
<BuildPriority>1000</BuildPriority>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<AllowCodeAnalysis>false</AllowCodeAnalysis>
<IgnoreThisComponentCompletely>true</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<DetectStackOverflow>true</DetectStackOverflow>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>60000</DefaultTestTimeout>
<UseBuildConfiguration></UseBuildConfiguration>
<UseBuildPlatform></UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>

10
samples/TestApplication/packages.config

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Serilog" version="1.5.14" targetFramework="net45" />
<package id="System.Reactive" version="3.0.0" targetFramework="net45" />
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net45" />
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="net45" />
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="net45" />
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="net45" />
<package id="System.Reactive.Windows.Threading" version="3.0.0" targetFramework="net45" />
</packages>

83
samples/TestApplicationShared/App.cs

@ -1,83 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Avalonia.Markup.Xaml;
using Avalonia.Styling;
using Avalonia.Themes.Default;
using Avalonia.Diagnostics;
using Avalonia.Platform;
using Avalonia.Shared.PlatformSupport;
using Avalonia.Media;
namespace TestApplication
{
public class App : Application
{
public void Run()
{
Styles.Add(new DefaultTheme());
var loader = new AvaloniaXamlLoader();
var baseLight = (IStyle)loader.Load(
new Uri("resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default"));
Styles.Add(baseLight);
Styles.Add(new SampleTabStyle());
DataTemplates = new DataTemplates
{
new FuncTreeDataTemplate<Node>(
x => new TextBlock {Text = x.Name},
x => x.Children),
};
MainWindow.RootNamespace = "TestApplication";
var wnd = MainWindow.Create();
wnd.AttachDevTools();
Run(wnd);
}
// This provides a simple UI tree for testing input handling, drawing, etc
public static Window CreateSimpleWindow()
{
Window window = new Window
{
Title = "Avalonia Test Application",
Background = Brushes.Red,
Content = new StackPanel
{
Margin = new Thickness(30),
Background = Brushes.Yellow,
Children = new Controls
{
new TextBlock
{
Text = "TEXT BLOCK",
Width = 300,
Height = 40,
Background = Brushes.White,
Foreground = Brushes.Black
},
new Button
{
Content = "BUTTON",
Width = 150,
Height = 40,
Background = Brushes.LightGreen,
Foreground = Brushes.Black
}
}
}
};
return window;
}
}
}

121
samples/TestApplicationShared/GalleryStyle.cs

@ -1,121 +0,0 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Templates;
using Avalonia.Media;
using Avalonia.Styling;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestApplication
{
internal class SampleTabStyle : Styles
{
public SampleTabStyle()
{
this.AddRange(new[]
{
new Style (s => s.Class("container").OfType<TabControl> ())
{
Setters = new[]
{
new Setter (TemplatedControl.TemplateProperty, new FuncControlTemplate<TabControl>(TabControlTemplate))
}
},
new Style(s => s.Class("container").OfType<TabControl>().Child().Child().Child().Child().Child().OfType<TabStripItem>())
{
Setters = new[]
{
new Setter (TemplatedControl.TemplateProperty, new FuncControlTemplate<TabStripItem>(TabStripItemTemplate)),
}
},
new Style(s => s.Name("PART_TabStrip").OfType<TabStrip>().Child().OfType<TabStripItem>())
{
Setters = new[]
{
new Setter(TemplatedControl.FontSizeProperty, 14.0),
new Setter(TemplatedControl.ForegroundProperty, Brushes.White)
}
},
new Style(s => s.Name("PART_TabStrip").OfType<TabStrip>().Child().OfType<TabStripItem>().Class(":selected"))
{
Setters = new[]
{
new Setter(TemplatedControl.ForegroundProperty, Brushes.White),
new Setter(TemplatedControl.BackgroundProperty, new SolidColorBrush(Colors.White, 0.1)),
},
},
});
}
public static Control TabStripItemTemplate(TabStripItem control)
{
return new ContentPresenter
{
DataTemplates = new DataTemplates
{
new FuncDataTemplate<string>(x => new Border
{
[~Border.BackgroundProperty] = control[~TemplatedControl.BackgroundProperty],
Padding = new Thickness(10),
Child = new TextBlock
{
VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center,
Text = x
}
})
},
Name = "PART_ContentPresenter",
[~ContentPresenter.ContentProperty] = control[~ContentControl.ContentProperty],
};
}
public static Control TabControlTemplate(TabControl control)
{
return new Grid
{
ColumnDefinitions = new ColumnDefinitions
{
new ColumnDefinition(GridLength.Auto),
new ColumnDefinition(new GridLength(1, GridUnitType.Star)),
},
Children = new Controls
{
new Border
{
Width = 190,
Background = Brush.Parse("#1976D2"),
Child = new ScrollViewer
{
Content = new TabStrip
{
Name = "PART_TabStrip",
ItemsPanel = new FuncTemplate<IPanel>(() => new StackPanel { Orientation = Orientation.Vertical, Gap = 4 }),
Margin = new Thickness(0, 10, 0, 0),
MemberSelector = TabControl.HeaderSelector,
[!ItemsControl.ItemsProperty] = control[!ItemsControl.ItemsProperty],
[!!SelectingItemsControl.SelectedItemProperty] = control[!!SelectingItemsControl.SelectedItemProperty],
}
}
},
new Carousel
{
Name = "PART_Content",
MemberSelector = TabControl.ContentSelector,
[~Carousel.TransitionProperty] = control[~TabControl.TransitionProperty],
[!Carousel.ItemsProperty] = control[!ItemsControl.ItemsProperty],
[!Carousel.SelectedItemProperty] = control[!SelectingItemsControl.SelectedItemProperty],
[Grid.ColumnProperty] = 1,
}
}
};
}
}
}

8
samples/TestApplicationShared/Item.cs

@ -1,8 +0,0 @@
namespace TestApplication
{
internal class Item
{
public string Name { get; set; }
public string Value { get; set; }
}
}

902
samples/TestApplicationShared/MainWindow.cs

@ -1,902 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reactive.Linq;
using System.Text;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Collections;
using Avalonia.Controls;
using Avalonia.Controls.Html;
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Shapes;
using Avalonia.Controls.Templates;
using Avalonia.Data;
using Avalonia.Diagnostics;
using Avalonia.Layout;
using Avalonia.Media;
using Avalonia.Media.Imaging;
using Avalonia.Platform;
using Avalonia.Threading;
using TestApplication;
namespace TestApplication
{
class MainWindow
{
private static readonly AvaloniaList<Node> s_treeData = new AvaloniaList<Node>
{
new Node
{
Name = "Root 1",
Children = new AvaloniaList<Node>
{
new Node
{
Name = "Child 1",
},
new Node
{
Name = "Child 2",
Children = new AvaloniaList<Node>
{
new Node
{
Name = "Grandchild 1",
},
new Node
{
Name = "Grandmaster Flash",
},
}
},
new Node
{
Name = "Child 3",
},
}
},
new Node
{
Name = "Root 2",
},
};
private static readonly AvaloniaList<Item> s_listBoxData = new AvaloniaList<Item>
{
new Item { Name = "Item 1", Value = "Item 1 Value" },
new Item { Name = "Item 2", Value = "Item 2 Value" },
new Item { Name = "Item 3", Value = "Item 3 Value" },
new Item { Name = "Item 4", Value = "Item 4 Value" },
new Item { Name = "Item 5", Value = "Item 5 Value" },
new Item { Name = "Item 6", Value = "Item 6 Value" },
new Item { Name = "Item 7", Value = "Item 7 Value" },
new Item { Name = "Item 8", Value = "Item 8 Value" },
};
public static Window Create()
{
TabControl container;
Window window = new Window
{
Title = "Avalonia Test Application",
//Width = 900,
//Height = 480,
Content = (container = new TabControl
{
Padding = new Thickness(5),
Items = new[]
{
ButtonsTab(),
TextTab(),
HtmlTab(),
ImagesTab(),
ListsTab(),
LayoutTab(),
AnimationsTab(),
},
Transition = new CrossFade(TimeSpan.FromSeconds(0.25)),
[Grid.RowProperty] = 1,
[Grid.ColumnSpanProperty] = 2,
})
};
container.Classes.Add("container");
window.Show();
return window;
}
private static TabItem ButtonsTab()
{
var result = new TabItem
{
Header = "Button",
Content = new ScrollViewer()
{
CanScrollHorizontally = false,
Content = new StackPanel
{
Margin = new Thickness(10),
Orientation = Orientation.Vertical,
Gap = 4,
Children = new Controls
{
new TextBlock
{
Text = "Button",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A button control",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new Button
{
Width = 150,
Content = "Button"
},
new Button
{
Width = 150,
Content = "Disabled",
IsEnabled = false,
},
new TextBlock
{
Margin = new Thickness(0, 40, 0, 0),
Text = "ToggleButton",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A toggle button control",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new ToggleButton
{
Width = 150,
IsChecked = true,
Content = "On"
},
new ToggleButton
{
Width = 150,
IsChecked = false,
Content = "Off"
},
}
}
},
};
return result;
}
private static TabItem HtmlTab()
{
return new TabItem
{
Header = "Text",
Content = new ScrollViewer()
{
CanScrollHorizontally = false,
Content = new StackPanel()
{
Margin = new Thickness(10),
Orientation = Orientation.Vertical,
Gap = 4,
Children = new Controls
{
new TextBlock
{
Text = "TextBlock",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A control for displaying text.",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new TextBlock
{
Text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.",
FontSize = 11
},
new TextBlock
{
Text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.",
FontSize = 11,
FontWeight = FontWeight.Medium
},
new TextBlock
{
Text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.",
FontSize = 11,
FontWeight = FontWeight.Bold
},
new TextBlock
{
Text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.",
FontSize = 11,
FontStyle = FontStyle.Italic,
},
new TextBlock
{
Margin = new Thickness(0, 40, 0, 0),
Text = "HtmlLabel",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A label capable of displaying HTML content",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new HtmlLabel
{
Background = Brush.Parse("#CCCCCC"),
Padding = new Thickness(5),
Text = @"<p><strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. <a href=""#"">Donec non enim</a> in turpis pulvinar facilisis. Ut felis.</p>
<h2>Header Level 2</h2>
<ol>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
<li>Aliquam tincidunt mauris eu risus.</li>
</ol>
<blockquote><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.</p></blockquote>
<h3>Header Level 3</h3>
<ul>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
<li>Aliquam tincidunt mauris eu risus.</li>
</ul>"
}
}
}
}
};
}
private static TabItem TextTab()
{
return new TabItem
{
Header = "Input",
Content = new ScrollViewer()
{
Content = new StackPanel
{
Margin = new Thickness(10),
Orientation = Orientation.Vertical,
Gap = 4,
Children = new Controls
{
new TextBlock
{
Text = "TextBox",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A text box control",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new TextBox { Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", Width = 200},
new TextBox { Width = 200, Watermark="Watermark"},
new TextBox { Width = 200, Watermark="Floating Watermark", UseFloatingWatermark = true },
new TextBox { AcceptsReturn = true, TextWrapping = TextWrapping.Wrap, Width = 200, Height = 150, Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est." },
new TextBlock
{
Margin = new Thickness(0, 40, 0, 0),
Text = "CheckBox",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A check box control",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new CheckBox { IsChecked = true, Margin = new Thickness(0, 0, 0, 5), Content = "Checked" },
new CheckBox { IsChecked = false, Content = "Unchecked" },
new TextBlock
{
Margin = new Thickness(0, 40, 0, 0),
Text = "RadioButton",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A radio button control",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new RadioButton { IsChecked = true, Content = "Option 1" },
new RadioButton { IsChecked = false, Content = "Option 2" },
new RadioButton { IsChecked = false, Content = "Option 3" },
}
}
}
};
}
public static string RootNamespace;
static Stream GetImage(string path)
{
return AvaloniaLocator.Current.GetService<IAssetLoader>().Open(new Uri("resm:" + RootNamespace + "." + path));
}
private static TabItem ListsTab()
{
return new TabItem
{
Header = "Lists",
Content = new ScrollViewer()
{
CanScrollHorizontally = false,
Content = new StackPanel
{
HorizontalAlignment = HorizontalAlignment.Left,
Orientation = Orientation.Vertical,
VerticalAlignment = VerticalAlignment.Top,
Gap = 4,
Margin = new Thickness(10),
DataTemplates = new DataTemplates
{
new FuncDataTemplate<Item>(x =>
new StackPanel
{
Gap = 4,
Orientation = Orientation.Horizontal,
Children = new Controls
{
new Image { Width = 50, Height = 50, Source = new Bitmap(GetImage("github_icon.png")) },
new TextBlock { Text = x.Name, FontSize = 18 }
}
})
},
Children = new Controls
{
new TextBlock
{
Text = "ListBox",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A list box control.",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new ListBox
{
BorderThickness = 2,
Items = s_listBoxData,
Height = 300,
Width = 300,
},
new TextBlock
{
Margin = new Thickness(0, 40, 0, 0),
Text = "TreeView",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A tree view control.",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new TreeView
{
Name = "treeView",
Items = s_treeData,
Height = 300,
BorderThickness = 2,
Width = 300,
}
}
},
}
};
}
private static TabItem ImagesTab()
{
var imageCarousel = new Carousel
{
Width = 400,
Height = 400,
Transition = new PageSlide(TimeSpan.FromSeconds(0.25)),
Items = new[]
{
new Image { Source = new Bitmap(GetImage("github_icon.png")), Width = 400, Height = 400 },
new Image { Source = new Bitmap(GetImage("pattern.jpg")), Width = 400, Height = 400 },
}
};
var next = new Button
{
VerticalAlignment = VerticalAlignment.Center,
Padding = new Thickness(20),
Content = new Avalonia.Controls.Shapes.Path
{
Data = StreamGeometry.Parse("M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"),
Fill = Brushes.Black
}
};
var prev = new Button
{
VerticalAlignment = VerticalAlignment.Center,
Padding = new Thickness(20),
Content = new Avalonia.Controls.Shapes.Path
{
Data = StreamGeometry.Parse("M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"),
Fill = Brushes.Black
}
};
prev.Click += (s, e) =>
{
if (imageCarousel.SelectedIndex == 0)
imageCarousel.SelectedIndex = 1;
else
imageCarousel.SelectedIndex--;
};
next.Click += (s, e) =>
{
if (imageCarousel.SelectedIndex == 1)
imageCarousel.SelectedIndex = 0;
else
imageCarousel.SelectedIndex++;
};
return new TabItem
{
Header = "Images",
Content = new ScrollViewer
{
Content = new StackPanel
{
HorizontalAlignment = HorizontalAlignment.Left,
Orientation = Orientation.Vertical,
VerticalAlignment = VerticalAlignment.Top,
Gap = 4,
Margin = new Thickness(10),
Children = new Controls
{
new TextBlock
{
Text = "Carousel",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "An items control that displays its items as pages that fill the controls.",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new StackPanel
{
Name = "carouselVisual",
Orientation = Orientation.Horizontal,
Gap = 4,
Children = new Controls
{
prev,
imageCarousel,
next
}
}
}
}
}
};
}
private static TabItem LayoutTab()
{
var polylinePoints = new Point[] { new Point(0, 0), new Point(5, 0), new Point(6, -2), new Point(7, 3), new Point(8, -3),
new Point(9, 1), new Point(10, 0), new Point(15, 0) };
var polygonPoints = new Point[] { new Point(5, 0), new Point(8, 8), new Point(0, 3), new Point(10, 3), new Point(2, 8) };
for (int i = 0; i < polylinePoints.Length; i++)
{
polylinePoints[i] = polylinePoints[i] * 13;
}
for (int i = 0; i < polygonPoints.Length; i++)
{
polygonPoints[i] = polygonPoints[i] * 15;
}
return new TabItem
{
Header = "Layout",
Content = new ScrollViewer
{
Content = new StackPanel
{
HorizontalAlignment = HorizontalAlignment.Left,
Orientation = Orientation.Vertical,
VerticalAlignment = VerticalAlignment.Top,
Gap = 4,
Margin = new Thickness(10),
Children = new Controls
{
new TextBlock
{
Text = "Grid",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "Lays out child controls according to a grid.",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new Grid
{
Width = 600,
ColumnDefinitions = new ColumnDefinitions
{
new ColumnDefinition(1, GridUnitType.Star),
new ColumnDefinition(1, GridUnitType.Star),
},
RowDefinitions = new RowDefinitions
{
new RowDefinition(1, GridUnitType.Auto),
new RowDefinition(1, GridUnitType.Auto)
},
Children = new Controls
{
new Rectangle
{
Fill = Brush.Parse("#FF5722"),
[Grid.ColumnSpanProperty] = 2,
Height = 200,
Margin = new Thickness(2.5)
},
new Rectangle
{
Fill = Brush.Parse("#FF5722"),
[Grid.RowProperty] = 1,
Height = 100,
Margin = new Thickness(2.5)
},
new Rectangle
{
Fill = Brush.Parse("#FF5722"),
[Grid.RowProperty] = 1,
[Grid.ColumnProperty] = 1,
Height = 100,
Margin = new Thickness(2.5)
},
},
},
new TextBlock
{
Margin = new Thickness(0, 40, 0, 0),
Text = "StackPanel",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A panel which lays out its children horizontally or vertically.",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new StackPanel
{
Orientation = Orientation.Vertical,
Gap = 4,
Width = 300,
Children = new Controls
{
new Rectangle
{
Fill = Brush.Parse("#FFC107"),
Height = 50,
},
new Rectangle
{
Fill = Brush.Parse("#FFC107"),
Height = 50,
},
new Rectangle
{
Fill = Brush.Parse("#FFC107"),
Height = 50,
},
}
},
new TextBlock
{
Margin = new Thickness(0, 40, 0, 0),
Text = "Canvas",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A panel which lays out its children by explicit coordinates.",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
new Canvas
{
Background = Brushes.Yellow,
Width = 300,
Height = 400,
Children = new Controls
{
new Rectangle
{
Fill = Brushes.Blue,
Width = 63,
Height = 41,
[Canvas.LeftProperty] = 40,
[Canvas.TopProperty] = 31,
},
new Ellipse
{
Fill = Brushes.Green,
Width = 58,
Height = 58,
[Canvas.LeftProperty] = 130,
[Canvas.TopProperty] = 79,
},
new Line
{
Stroke = Brushes.Red,
StrokeThickness = 2,
StartPoint = new Point(120, 185),
EndPoint = new Point(30, 115)
},
new Avalonia.Controls.Shapes.Path
{
Fill = Brushes.Orange,
Data = StreamGeometry.Parse("M 30,250 c 50,0 50,-50 c 50,0 50,50 h -50 v 50 l -50,-50 Z"),
},
new Polygon
{
Stroke = Brushes.DarkBlue,
Fill = Brushes.Violet,
Points = polygonPoints,
StrokeThickness = 1,
[Canvas.LeftProperty] = 150,
[Canvas.TopProperty] = 180,
},
new Polyline
{
Stroke = Brushes.Brown,
Points = polylinePoints,
StrokeThickness = 5,
StrokeJoin = PenLineJoin.Round,
StrokeStartLineCap = PenLineCap.Triangle,
StrokeEndLineCap = PenLineCap.Triangle,
[Canvas.LeftProperty] = 30,
[Canvas.TopProperty] = 350,
},
}
},
}
}
}
};
}
private static TabItem AnimationsTab()
{
Border border1;
Border border2;
RotateTransform rotate;
Button button1;
var result = new TabItem
{
Header = "Animations",
Content = new StackPanel
{
Orientation = Orientation.Vertical,
Gap = 4,
Margin = new Thickness(10),
Children = new Controls
{
new TextBlock
{
Text = "Animations",
FontWeight = FontWeight.Medium,
FontSize = 20,
Foreground = Brush.Parse("#212121"),
},
new TextBlock
{
Text = "A few animations showcased below",
FontSize = 13,
Foreground = Brush.Parse("#727272"),
Margin = new Thickness(0, 0, 0, 10)
},
(button1 = new Button
{
Content = "Animate",
Width = 120,
[Grid.ColumnProperty] = 1,
[Grid.RowProperty] = 1,
}),
new Canvas
{
ClipToBounds = false,
Children = new Controls
{
(border1 = new Border
{
Width = 100,
Height = 100,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Background = Brushes.Crimson,
RenderTransform = new RotateTransform(),
Child = new Grid
{
Children = new Controls
{
new Ellipse()
{
Width = 100,
Height = 100,
Fill =
new RadialGradientBrush()
{
GradientStops =
{
new GradientStop(Colors.Blue, 0),
new GradientStop(Colors.Green, 1)
},
Radius = 75
}
},
new Avalonia.Controls.Shapes.Path
{
Data =
StreamGeometry.Parse(
"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"),
Fill =
new LinearGradientBrush()
{
GradientStops =
{
new GradientStop(Colors.Green, 0),
new GradientStop(Colors.LightSeaGreen, 1)
}
},
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
RenderTransform = new MatrixTransform(Matrix.CreateScale(2, 2))
}
}
},
[Canvas.LeftProperty] = 100,
[Canvas.TopProperty] = 100,
}),
(border2 = new Border
{
Width = 100,
Height = 100,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Background = Brushes.Coral,
Child = new Image
{
Source = new Bitmap(GetImage("github_icon.png")),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
},
RenderTransform = (rotate = new RotateTransform
{
PropertyTransitions = new PropertyTransitions
{
RotateTransform.AngleProperty.Transition(500),
}
}),
PropertyTransitions = new PropertyTransitions
{
Layoutable.WidthProperty.Transition(300),
Layoutable.HeightProperty.Transition(1000),
},
[Canvas.LeftProperty] = 400,
[Canvas.TopProperty] = 100,
}),
}
}
},
},
};
button1.Click += (s, e) =>
{
if (border2.Width == 100)
{
border2.Width = border2.Height = 400;
rotate.Angle = 180;
}
else
{
border2.Width = border2.Height = 100;
rotate.Angle = 0;
}
};
var start = Animate.Stopwatch.Elapsed;
var degrees = Animate.Timer
.Select(x =>
{
var elapsed = (x - start).TotalSeconds;
var cycles = elapsed / 4;
var progress = cycles % 1;
return 360.0 * progress;
});
border1.RenderTransform.Bind(
RotateTransform.AngleProperty,
degrees,
BindingPriority.Animation);
return result;
}
}
}

16
samples/TestApplicationShared/Node.cs

@ -1,16 +0,0 @@
using Avalonia.Collections;
namespace TestApplication
{
internal class Node
{
public Node()
{
Children = new AvaloniaList<Node>();
}
public string Name { get; set; }
public AvaloniaList<Node> Children { get; set; }
}
}

29
samples/TestApplicationShared/TestApplicationShared.projitems

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>78345174-5b52-4a14-b9fd-d5f2428137f0</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>TestApplication</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)App.cs" />
<Compile Include="$(MSBuildThisFileDirectory)GalleryStyle.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Item.cs" />
<Compile Include="$(MSBuildThisFileDirectory)MainWindow.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Node.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)html.htm" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)github_icon.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)pattern.jpg">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
</Project>

13
samples/TestApplicationShared/TestApplicationShared.shproj

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>78345174-5b52-4a14-b9fd-d5f2428137f0</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="TestApplicationShared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>

26
samples/TestApplicationShared/TestApplicationShared.v2.ncrunchproject

@ -1,26 +0,0 @@
<ProjectConfiguration>
<AutoDetectNugetBuildDependencies>true</AutoDetectNugetBuildDependencies>
<BuildPriority>1000</BuildPriority>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<AllowCodeAnalysis>false</AllowCodeAnalysis>
<IgnoreThisComponentCompletely>true</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>false</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<DetectStackOverflow>true</DetectStackOverflow>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>60000</DefaultTestTimeout>
<UseBuildConfiguration />
<UseBuildPlatform />
<ProxyProcessPath />
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>

BIN
samples/TestApplicationShared/github_icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

128
samples/TestApplicationShared/html.htm

@ -1,128 +0,0 @@
<html>
<head>
<title>Intro</title>
<style>
h1, h2, h3 { color: navy; font-weight:normal; }
h1 { margin-bottom: .47em }
h2 { margin-bottom: .3em }
h3 { margin-bottom: .4em }
ul { margin-top: .5em }
ul li {margin: .25em}
body { font:10pt Tahoma }
pre { border:solid 1px gray; background-color:#eee; padding:1em }
a:link { text-decoration: none; }
a:hover { text-decoration: underline; }
.gray { color:gray; }
.example { background-color:#efefef; corner-radius:5px; padding:0.5em; }
.whitehole { background-color:white; corner-radius:10px; padding:15px; }
.caption { font-size: 1.1em }
.comment { color: green; margin-bottom: 5px; margin-left: 3px; }
.comment2 { color: green; }
</style>
</head>
<body style=" margin: 0; background-color: #333; background-gradient: #707; background-gradient-angle: 60;">
<h1 align="center" style="color: white;">
HTML Renderer Project - Avalonia port
<br />
<span style="font-size: x-small;">Beta support</span>
</h1>
<blockquote class="whitehole">
<p style="margin-top: 0px">
<table border="0" width="100%">
<tr style="vertical-align: top>
<td>
Everything you see on this panel (see samples on the left) is <b>custom-painted</b>
by the <b>HTML Renderer</b>, including tables, images, links and videos.<br />
This project allows you to have the rich format power of HTML on your desktop applications
without <b>WebBrowser</b> control or <b>MSHTML</b>.<br />
The library is <b>100% managed code</b> without any external dependencies, the only
requirement is <b>.NET 2.0 or higher</b>, including support for Client Profile.
</td>
</tr>
</table>
</p>
<h3>
Text selection (copy to clipboard)
</h3>
<div>
The rendered html has full support for <b>text selection</b> including <b>drag-and-drop</b>
and <b>copy</b> to clipboard of rich html and plain text to handle <b>paste</b>
operation to editor that support rich or/and plain text.<br />
Additionally there is a <b>context-menu</b> with select all, copy text, copy image,
save image, open link, copy link url, open video, copy video url.
</div>
<h3>
Cascading Style Sheets (CSS) support
</h3>
<div>
The core layout engine of the renderer was builded according to <b>CSS Level 2 specification</b>,
so you can use Cascading Style Sheets to format your html documents.<br />
Additionally there are a couple extensions: <b>Gradients</b> on backgrounds and
<b>rounded corners</b>.
</div>
<h3>
Benefits
</h3>
<ul>
<li>100% managed code and no external dependencies.</li>
<li>Supports .NET 2.0 or higher including Client Profile.</li>
<li>Handles "real world" malformed HTML, it doesn't have to be XHTML.</li>
<li>Lightweight (~300K).</li>
<li>High performance and low memory footprint.</li>
<li>Extendable and configurable.</li>
</ul>
<h3>
Limitations
</h3>
<ul>
<li>All HTML <b>end tags</b> marked as <a href="http://www.w3.org/TR/1999/REC-html401-19991224/index/elements.html">
optional</a> should be there. No problem with tags marked as forbidden.</li>
</ul>
<hr />
<h3>
On the roadmap</h3>
Of course it's not quite finished yet. Here are some of the important things to
do.
<ul>
<li>Better performance</li>
<li>Support of position CSS property</li>
<li>Support of height and min-height CSS property</li>
<li>Better tables support, especially layouts</li>
<li>Support image align</li>
<li>Handle :hover selector</li>
<li>Selection by shift+arrows</li>
<li>Better HTML tag parsing (optional closing tags)</li>
<li>More styles support</li>
</ul>
<h3>
Vision
</h3>
<ul>
<li>Most complete static HTML Renderer (no java script).</li>
<li>Commercial web browser performance level.</li>
</ul>
<hr />
<h3>
2015 - Nikita Tsukanov (Avalonia Port)
</h3>
<blockquote>
<a href="https://avalonia.github.io/">https://avalonia.github.io/</a>
</blockquote>
<h3>
2012 - Arthur Teplitzki
</h3>
<blockquote>
<a href="http://theartofdev.com/">http://TheArtOfDev.com</a>
</blockquote>
<h3>
2009 - Jose Manuel Menendez Poo
</h3>
<blockquote>
<a href="http://www.menendezpoo.com">www.menendezpoo.com</a>
</blockquote>
</blockquote>
</body>
</html>

BIN
samples/TestApplicationShared/pattern.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

22
samples/XamlTestApplication/App.config

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="SharpDX.Direct2D1" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SharpDX" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SharpDX.DXGI" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

11
samples/XamlTestApplication/App.cs

@ -1,11 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using Avalonia.Logging.Serilog;
using Serilog;
namespace XamlTestApplication
{
// No longer needed!
}

38
samples/XamlTestApplication/Program.cs

@ -1,38 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System.Linq;
using System.Diagnostics;
using System.Windows.Threading;
using Avalonia;
using Serilog;
using Avalonia.Logging.Serilog;
using Avalonia.Controls;
namespace XamlTestApplication
{
internal class Program
{
private static void Main(string[] args)
{
// this sucks. Can we fix this? Do we even need it anymore?
var foo = Dispatcher.CurrentDispatcher;
InitializeLogging();
AppBuilder.Configure<XamlTestApp>()
.UsePlatformDetect()
.Start<Views.MainWindow>();
}
private static void InitializeLogging()
{
#if DEBUG
SerilogLogger.Initialize(new LoggerConfiguration()
.MinimumLevel.Warning()
.WriteTo.Trace(outputTemplate: "{Area}: {Message}")
.CreateLogger());
#endif
}
}
}

39
samples/XamlTestApplication/Properties/AssemblyInfo.cs

@ -1,39 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TestApplication")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestApplication")]
[assembly: AssemblyCopyright("Copyright \u00A9 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f8dad012-f4ec-4b63-b64f-320901338290")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

187
samples/XamlTestApplication/XamlTestApplication.csproj

@ -1,187 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>XamlTestApplication</RootNamespace>
<AssemblyName>XamlTestApplication</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Serilog, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\packages\Serilog.1.5.14\lib\net45\Serilog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Serilog.FullNetFx, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\packages\Serilog.1.5.14\lib\net45\Serilog.FullNetFx.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Splat.1.6.2\lib\Net45\Splat.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Sprache, Version=2.0.0.51, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Sprache.2.0.0.51\lib\portable-net4+netcore45+win8+wp8+sl5+MonoAndroid+Xamarin.iOS10+MonoTouch\Sprache.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Reactive.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Core.3.0.0\lib\net45\System.Reactive.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Interfaces, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Interfaces.3.0.0\lib\net45\System.Reactive.Interfaces.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Linq, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Linq.3.0.0\lib\net45\System.Reactive.Linq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.PlatformServices, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.PlatformServices.3.0.0\lib\net45\System.Reactive.PlatformServices.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Windows.Threading, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Windows.Threading.3.0.0\lib\net45\System.Reactive.Windows.Threading.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="App.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Avalonia.DotNetFrameworkRuntime\Avalonia.DotNetFrameworkRuntime.csproj">
<Project>{4A1ABB09-9047-4BD5-A4AD-A055E52C5EE0}</Project>
<Name>Avalonia.DotNetFrameworkRuntime</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup\Avalonia.Markup.csproj">
<Project>{6417e941-21bc-467b-a771-0de389353ce6}</Project>
<Name>Avalonia.Markup</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Animation\Avalonia.Animation.csproj">
<Project>{D211E587-D8BC-45B9-95A4-F297C8FA5200}</Project>
<Name>Avalonia.Animation</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Base\Avalonia.Base.csproj">
<Project>{B09B78D8-9B26-48B0-9149-D64A2F120F3F}</Project>
<Name>Avalonia.Base</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Controls\Avalonia.Controls.csproj">
<Project>{D2221C82-4A25-4583-9B43-D791E3F6820C}</Project>
<Name>Avalonia.Controls</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.DesignerSupport\Avalonia.DesignerSupport.csproj">
<Project>{799a7bb5-3c2c-48b6-85a7-406a12c420da}</Project>
<Name>Avalonia.DesignerSupport</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj">
<Project>{7062AE20-5DCC-4442-9645-8195BDECE63E}</Project>
<Name>Avalonia.Diagnostics</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.HtmlRenderer\Avalonia.HtmlRenderer.csproj">
<Project>{5fb2b005-0a7f-4dad-add4-3ed01444e63d}</Project>
<Name>Avalonia.HtmlRenderer</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Input\Avalonia.Input.csproj">
<Project>{62024B2D-53EB-4638-B26B-85EEAA54866E}</Project>
<Name>Avalonia.Input</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Interactivity\Avalonia.Interactivity.csproj">
<Project>{6B0ED19D-A08B-461C-A9D9-A9EE40B0C06B}</Project>
<Name>Avalonia.Interactivity</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Layout\Avalonia.Layout.csproj">
<Project>{42472427-4774-4C81-8AFF-9F27B8E31721}</Project>
<Name>Avalonia.Layout</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Logging.Serilog\Avalonia.Logging.Serilog.csproj">
<Project>{b61b66a3-b82d-4875-8001-89d3394fe0c9}</Project>
<Name>Avalonia.Logging.Serilog</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj">
<Project>{6417B24E-49C2-4985-8DB2-3AB9D898EC91}</Project>
<Name>Avalonia.ReactiveUI</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Visuals\Avalonia.Visuals.csproj">
<Project>{EB582467-6ABB-43A1-B052-E981BA910E3A}</Project>
<Name>Avalonia.Visuals</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Styling\Avalonia.Styling.csproj">
<Project>{F1BAA01A-F176-4C6A-B39D-5B40BB1B148F}</Project>
<Name>Avalonia.Styling</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj">
<Project>{3E10A5FA-E8DA-48B1-AD44-6A5B6CB7750F}</Project>
<Name>Avalonia.Themes.Default</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup.Xaml\Avalonia.Markup.Xaml.csproj">
<Project>{3E53A01A-B331-47F3-B828-4A5717E77A24}</Project>
<Name>Avalonia.Markup.Xaml</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Windows\Avalonia.Direct2D1\Avalonia.Direct2D1.csproj" Condition="'$(Platform)'!='Mono'">
<Project>{3E908F67-5543-4879-A1DC-08EACE79B3CD}</Project>
<Name>Avalonia.Direct2D1</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Windows\Avalonia.Win32\Avalonia.Win32.csproj" Condition="'$(Platform)'!='Mono'">
<Project>{811A76CF-1CF6-440F-963B-BBE31BD72A82}</Project>
<Name>Avalonia.Win32</Name>
</ProjectReference>
<ProjectReference Include="..\XamlTestApplicationPcl\XamlTestApplicationPcl.csproj">
<Project>{ea113f1a-d8d7-4142-9948-353270e7ebae}</Project>
<Name>XamlTestApplicationPcl</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\src\Shared\avalonia.platform.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

26
samples/XamlTestApplication/XamlTestApplication.v2.ncrunchproject

@ -1,26 +0,0 @@
<ProjectConfiguration>
<AutoDetectNugetBuildDependencies>true</AutoDetectNugetBuildDependencies>
<BuildPriority>1000</BuildPriority>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<AllowCodeAnalysis>false</AllowCodeAnalysis>
<IgnoreThisComponentCompletely>true</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<DetectStackOverflow>true</DetectStackOverflow>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>60000</DefaultTestTimeout>
<UseBuildConfiguration></UseBuildConfiguration>
<UseBuildPlatform></UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>

12
samples/XamlTestApplication/packages.config

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Serilog" version="1.5.14" targetFramework="net45" />
<package id="Splat" version="1.6.2" targetFramework="net45" />
<package id="Sprache" version="2.0.0.51" targetFramework="net45" />
<package id="System.Reactive" version="3.0.0" targetFramework="net45" />
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net45" />
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="net45" />
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="net45" />
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="net45" />
<package id="System.Reactive.Windows.Threading" version="3.0.0" targetFramework="net45" />
</packages>

30
samples/XamlTestApplicationPcl/Properties/AssemblyInfo.cs

@ -1,30 +0,0 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("XamlTestApplicationPcl")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XamlTestApplicationPcl")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

113
samples/XamlTestApplicationPcl/TestScrollable.cs

@ -1,113 +0,0 @@
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Media;
using Avalonia.VisualTree;
namespace XamlTestApplication
{
public class TestScrollable : Control, ILogicalScrollable
{
private int itemCount = 100;
private Size _extent;
private Vector _offset;
private Size _viewport;
private Size _lineSize;
public bool IsLogicalScrollEnabled => true;
public Action InvalidateScroll { get; set; }
Size IScrollable.Extent
{
get { return _extent; }
}
Vector IScrollable.Offset
{
get { return _offset; }
set
{
_offset = value;
InvalidateVisual();
}
}
Size IScrollable.Viewport
{
get { return _viewport; }
}
public Size ScrollSize
{
get
{
return new Size(double.PositiveInfinity, 1);
}
}
public Size PageScrollSize
{
get
{
return new Size(double.PositiveInfinity, Bounds.Height);
}
}
public override void Render(DrawingContext context)
{
var y = 0.0;
for (var i = (int)_offset.Y; i < itemCount; ++i)
{
using (var line = new FormattedText(
"Item " + (i + 1),
TextBlock.GetFontFamily(this),
TextBlock.GetFontSize(this),
TextBlock.GetFontStyle(this),
TextAlignment.Left,
TextBlock.GetFontWeight(this)))
{
context.DrawText(Brushes.Black, new Point(-_offset.X, y), line);
y += _lineSize.Height;
}
}
}
public bool BringIntoView(IControl target, Rect targetRect)
{
throw new NotImplementedException();
}
public IControl GetControlInDirection(NavigationDirection direction, IControl from)
{
throw new NotImplementedException();
}
protected override Size MeasureOverride(Size availableSize)
{
using (var line = new FormattedText(
"Item 100",
TextBlock.GetFontFamily(this),
TextBlock.GetFontSize(this),
TextBlock.GetFontStyle(this),
TextAlignment.Left,
TextBlock.GetFontWeight(this)))
{
line.Constraint = availableSize;
_lineSize = line.Measure();
return new Size(_lineSize.Width, _lineSize.Height * itemCount);
}
}
protected override Size ArrangeOverride(Size finalSize)
{
_viewport = new Size(finalSize.Width, finalSize.Height / _lineSize.Height);
_extent = new Size(_lineSize.Width, itemCount + 1);
InvalidateScroll?.Invoke();
return finalSize;
}
}
}

103
samples/XamlTestApplicationPcl/ViewModels/EditorViewModel.cs

@ -1,103 +0,0 @@
using Avalonia.Threading;
namespace XamlTestApplication.ViewModels
{
using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class ShellViewModel : ReactiveObject
{
private ShellViewModel()
{
documents = new ObservableCollection<EditorViewModel>();
AddDocumentCommand = ReactiveCommand.Create();
AddDocumentCommand.Subscribe(_ =>
{
Documents.Add(new EditorViewModel());
});
GCCommand = ReactiveCommand.Create();
GCCommand.Subscribe(_ =>
{
GC.Collect();
});
}
public static ShellViewModel Instance = new ShellViewModel();
private ObservableCollection<EditorViewModel> documents;
public ObservableCollection<EditorViewModel> Documents
{
get { return documents; }
set { this.RaiseAndSetIfChanged(ref documents, value); }
}
private EditorViewModel selectedDocument;
public EditorViewModel SelectedDocument
{
get { return selectedDocument; }
set { this.RaiseAndSetIfChanged(ref selectedDocument, value); }
}
private int instanceCount;
public int InstanceCount
{
get { return instanceCount; }
set { this.RaiseAndSetIfChanged(ref instanceCount, value); }
}
public ReactiveCommand<object> AddDocumentCommand { get; }
public ReactiveCommand<object> GCCommand { get; }
}
public class EditorViewModel : ReactiveObject
{
private static int InstanceCount = 0;
public EditorViewModel()
{
InstanceCount++;
ShellViewModel.Instance.InstanceCount = InstanceCount;
text = "This is some text.";
CloseCommand = ReactiveCommand.Create();
CloseCommand.Subscribe(_ =>
{
ShellViewModel.Instance.Documents.Remove(this);
});
}
~EditorViewModel()
{
//System.Console.WriteLine("EVM Destructed");
InstanceCount--;
Dispatcher.UIThread.InvokeAsync(() =>
{
ShellViewModel.Instance.InstanceCount = InstanceCount;
});
}
private string text;
public string Text
{
get { return text; }
set { this.RaiseAndSetIfChanged(ref text, value); }
}
public ReactiveCommand<object> CloseCommand { get; }
}
}

127
samples/XamlTestApplicationPcl/ViewModels/MainWindowViewModel.cs

@ -1,127 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using System.Collections.Generic;
using ReactiveUI;
using Avalonia.Controls;
namespace XamlTestApplication.ViewModels
{
public class MainWindowViewModel
{
public MainWindowViewModel()
{
Items = new List<TestItem>();
for (int i = 0; i < 10; ++i)
{
Items.Add(new TestItem($"Item {i}", $"Item {i} Value"));
}
Nodes = new List<TestNode>
{
new TestNode
{
Header = "Root",
SubHeader = "Root Item",
IsExpanded = true,
Children = new[]
{
new TestNode
{
Header = "Child 1",
SubHeader = "Child 1 Value",
},
new TestNode
{
Header = "Child 2",
SubHeader = "Child 2 Value",
IsExpanded = false,
Children = new[]
{
new TestNode
{
Header = "Grandchild",
SubHeader = "Grandchild Value",
},
new TestNode
{
Header = "Grandmaster Flash",
SubHeader = "White Lines",
},
}
},
}
}
};
CollapseNodesCommand = ReactiveCommand.Create();
CollapseNodesCommand.Subscribe(_ => ExpandNodes(false));
ExpandNodesCommand = ReactiveCommand.Create();
ExpandNodesCommand.Subscribe(_ => ExpandNodes(true));
OpenFileCommand = ReactiveCommand.Create();
OpenFileCommand.Subscribe(_ =>
{
var ofd = new OpenFileDialog();
ofd.ShowAsync();
});
OpenFolderCommand = ReactiveCommand.Create();
OpenFolderCommand.Subscribe(_ =>
{
var ofd = new OpenFolderDialog();
ofd.ShowAsync();
});
shell = ShellViewModel.Instance;
}
private ShellViewModel shell;
public ShellViewModel Shell
{
get { return shell; }
set { shell = value; }
}
public List<TestItem> Items { get; }
public List<TestNode> Nodes { get; }
public ReactiveCommand<object> CollapseNodesCommand { get; }
public ReactiveCommand<object> ExpandNodesCommand { get; }
public ReactiveCommand<object> OpenFileCommand { get; }
public ReactiveCommand<object> OpenFolderCommand { get; }
public void ExpandNodes(bool expanded)
{
foreach (var node in Nodes)
{
ExpandNodes(node, expanded);
}
}
private void ExpandNodes(TestNode node, bool expanded)
{
node.IsExpanded = expanded;
if (node.Children != null)
{
foreach (var child in node.Children)
{
ExpandNodes(child, expanded);
}
}
}
}
}

17
samples/XamlTestApplicationPcl/ViewModels/TestItem.cs

@ -1,17 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
namespace XamlTestApplication.ViewModels
{
public class TestItem
{
public TestItem(string header, string subheader)
{
Header = header;
SubHeader = subheader;
}
public string Header { get; }
public string SubHeader { get; }
}
}

23
samples/XamlTestApplicationPcl/ViewModels/TestNode.cs

@ -1,23 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System.Collections.Generic;
using ReactiveUI;
namespace XamlTestApplication.ViewModels
{
public class TestNode : ReactiveObject
{
private bool _isExpanded;
public string Header { get; set; }
public string SubHeader { get; set; }
public IEnumerable<TestNode> Children { get; set; }
public bool IsExpanded
{
get { return _isExpanded; }
set { this.RaiseAndSetIfChanged(ref this._isExpanded, value); }
}
}
}

32
samples/XamlTestApplicationPcl/Views/MainWindow.cs

@ -1,32 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Diagnostics;
using Avalonia.Markup.Xaml;
using XamlTestApplication.ViewModels;
namespace XamlTestApplication.Views
{
public class MainWindow : Window
{
private MenuItem _exitMenu;
public MainWindow()
{
InitializeComponent();
DataContext = new MainWindowViewModel();
DevTools.Attach(this);
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
_exitMenu = this.FindControl<MenuItem>("exitMenu");
_exitMenu.Click += (s, e) => Application.Current.Exit();
}
}
}

400
samples/XamlTestApplicationPcl/Views/MainWindow.xaml

@ -1,400 +0,0 @@
<Window x:Class="XamlTestApplication.MainWindow"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:XamlTestApplication;assembly=XamlTestApplicationPcl"
xmlns:vm="clr-namespace:XamlTestApplication.ViewModels;assembly=XamlTestApplicationPcl"
Title="Avalonia Test Application" Width="800" Height="600">
<Grid RowDefinitions="Auto,*,Auto" ColumnDefinitions="*,*">
<Menu Grid.ColumnSpan="2">
<MenuItem Header="_File">
<MenuItem Header="_Open" Command="{Binding OpenFileCommand}" />
<MenuItem Header="_Open Folder" Command="{Binding OpenFolderCommand}" />
<MenuItem Header="_Hello">
<MenuItem Header="_Goodbye"/>
<Separator/>
<MenuItem Header="_World" />
</MenuItem>
<Separator Background="Red"/>
<MenuItem Header="_Test"/>
<Separator/>
<MenuItem Name="exitMenu" Header="_Exit"/>
</MenuItem>
</Menu>
<TabControl Grid.Row="1" Grid.ColumnSpan="2" Padding="5">
<TabControl.Transition>
<PageSlide Duration="0.25" />
</TabControl.Transition>
<TabItem Header="Buttons">
<ScrollViewer CanScrollHorizontally="False">
<StackPanel Margin="10" Gap="4">
<TextBlock Text="Button" FontWeight="Medium" FontSize="20" Foreground="#212121" />
<TextBlock Text="A button control" FontSize="13" Foreground="#727272" Margin="0,0,0,10" />
<Button Content="Button" Width="150" />
<Button Content="Button" Width="150" IsEnabled="False" />
<TextBlock Text="ToggleButton" Margin="0, 40, 0, 0" FontSize="20" Foreground="#212121" />
<TextBlock Text="A toggle button control" FontSize="13" Foreground="#727272" Margin="0,0,0,10" />
<ToggleButton Width="150" IsChecked="True" Content="On" />
<ToggleButton Width="150" IsChecked="False" Content="Off" />
</StackPanel>
</ScrollViewer>
</TabItem>
<TabItem Header="Text">
<StackPanel Margin="10" Gap="4">
<TextBlock Text="TextBlock with ContextMenu" FontWeight="Medium" FontSize="20" Foreground="#212121">
<TextBlock.ContextMenu>
<ContextMenu>
<MenuItem Header="Testing 1" />
<MenuItem Header="Testing 2" />
<MenuItem Header="Testing 3" />
<MenuItem Header="Testing 4">
<MenuItem Header="SubItem 1" />
<MenuItem Header="SubItem 2" />
<MenuItem Header="SubItem 3" />
<MenuItem Header="SubItem 4" />
</MenuItem>
</ContextMenu>
</TextBlock.ContextMenu>
</TextBlock>
<TextBlock Text="A control for displaying text."
FontSize="13"
Foreground="#727272"
Margin="0, 0, 0, 10" />
<TextBlock Text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit." FontSize="11" />
<TextBlock Text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit." FontSize="11"
FontWeight="Medium" />
<TextBlock Text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit." FontSize="11"
FontWeight="Bold" />
<TextBlock Text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit." FontSize="11"
FontStyle="Italic" />
<TextBlock Margin="0,40,0,0" Text="HtmlLabel" FontWeight="Medium" FontSize="20"
Foreground="#212121" />
<TextBlock Text="A label capable of displaying HTML content" FontSize="13" Foreground="#727272"
Margin="0, 0, 0, 10" />
</StackPanel>
</TabItem>
<TabItem Header="Input">
<ScrollViewer CanScrollHorizontally="False">
<StackPanel Margin="10" Gap="4">
<TextBlock Text="TextBlock" FontWeight="Medium" FontSize="20" Foreground="#212121" />
<TextBlock Text="A text box control"
FontSize="13"
Foreground="#727272"
Margin="0, 0, 0, 10" />
<TextBox Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit." Width="200" />
<TextBox Width="200" Watermark="Watermark" />
<TextBox Width="200" Watermark="Floating Watermark" UseFloatingWatermark="True" />
<TextBox AcceptsReturn="True" TextWrapping="Wrap" Width="200" Height="150"
Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est." />
<TextBox Width="200" Text="Left aligned text" TextAlignment="Left" />
<TextBox Width="200" Text="Center aligned text" TextAlignment="Center" />
<TextBox Width="200" Text="Right aligned text" TextAlignment="Right" />
<TextBlock Margin="0, 40, 0, 0" Text="CheckBox" FontWeight="Medium" FontSize="20"
Foreground="#212121" />
<TextBlock Text="A check box control" FontSize="13" Foreground="#727272" Margin="0, 0, 0, 10" />
<CheckBox IsChecked="True" Margin="0, 0, 0, 5" Content="Checked" />
<CheckBox IsChecked="False" Content="Unchecked" />
<TextBlock Margin="0, 40, 0, 0" Text="RadioButton" FontWeight="Medium" FontSize="20"
Foreground="#212121" />
<TextBlock Text="A radio button control" FontSize="13" Foreground="#727272"
Margin="0, 0, 0, 10" />
<RadioButton IsChecked="True" Content="Option 1" />
<RadioButton IsChecked="False" Content="Option 2" />
<RadioButton IsChecked="False" Content="Option 3" />
</StackPanel>
</ScrollViewer>
</TabItem>
<TabItem Header="Images">
<StackPanel Margin="10" Gap="4" HorizontalAlignment="Center">
<TextBlock Text="Carousel" FontWeight="Medium" FontSize="20" Foreground="#212121" />
<TextBlock Text="An items control that displays its items as pages that fill the controls."
FontSize="13"
Foreground="#727272" Margin="0, 0, 0, 10" />
<StackPanel Name="carouselVisual" Orientation="Horizontal">
<Button VerticalAlignment="Center" Margin="5">
<Button.Content>
<Path Fill="Black"
Data="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" />
</Button.Content>
</Button>
<Carousel Width="400" Height="400">
<Carousel.Transition>
<PageSlide Duration="0.25" />
</Carousel.Transition>
<Image Source="github_icon.png" Width="400" Height="400" />
<Image Source="pattern.jpg" Width="400" Height="400" />
</Carousel>
<Button VerticalAlignment="Center" Margin="5">
<Button.Content>
<Path Fill="Black"
Data="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z" />
</Button.Content>
</Button>
</StackPanel>
</StackPanel>
</TabItem>
<TabItem Header="Lists">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<ListBox Items="{Binding Items}" SelectionMode="Multiple">
<ListBox.ItemTemplate>
<DataTemplate DataType="vm:TestItem">
<StackPanel>
<TextBlock Text="{Binding Header}" FontSize="24" />
<TextBlock Text="{Binding SubHeader}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<DropDown VerticalAlignment="Center" SelectedIndex="0">
<StackPanel>
<TextBlock Text="Item 1" FontSize="24" />
<TextBlock Text="Item 1 Value" />
</StackPanel>
<StackPanel>
<TextBlock Text="Item 2" FontSize="24" />
<TextBlock Text="Item 2 Value" />
</StackPanel>
</DropDown>
<TreeView Items="{Binding Nodes}">
<TreeView.Styles>
<Style Selector="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
</Style>
</TreeView.Styles>
<TreeView.ItemTemplate>
<TreeDataTemplate DataType="vm:TestNode" ItemsSource="{Binding Children}">
<StackPanel>
<TextBlock Text="{Binding Header}" FontSize="24" />
<TextBlock Text="{Binding SubHeader}" />
</StackPanel>
</TreeDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
<StackPanel Orientation="Vertical" Gap="4">
<Button Command="{Binding CollapseNodesCommand}">Collapse Nodes</Button>
<Button Command="{Binding ExpandNodesCommand}">Expand Nodes</Button>
</StackPanel>
</StackPanel>
</TabItem>
<TabItem Header="Layout">
<ScrollViewer CanScrollHorizontally="False">
<StackPanel Margin="10" Gap="4">
<TextBlock Text="Grid" FontWeight="Medium" FontSize="20" Foreground="#212121" />
<TextBlock Text="Lays out child controls according to a grid."
FontSize="13"
Foreground="#727272"
Margin="0, 0, 0, 10" />
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" Width="300">
<Rectangle Grid.ColumnSpan="2" Fill="#FF5722" Height="200" Margin="2.5" />
<Rectangle Grid.Row="1" Fill="#FF5722" Height="100" Margin="2.5" />
<Rectangle Grid.Row="1" Grid.Column="1" Fill="#FF5722" Height="100" Margin="2.5" />
</Grid>
<TextBlock Text="StackPanel" FontWeight="Medium" FontSize="20" Foreground="#212121" />
<TextBlock Text="A panel which lays out its children horizontally or vertically."
FontSize="13"
Foreground="#727272"
Margin="0, 0, 0, 10" />
<StackPanel Gap="4" Width="300">
<Rectangle Fill="#FFC107" Height="50" />
<Rectangle Fill="#FFC107" Height="50" />
<Rectangle Fill="#FFC107" Height="50" />
</StackPanel>
<TextBlock Text="WrapPanel" FontWeight="Medium" FontSize="20" Foreground="#212121" />
<TextBlock Text="Wraps children to new lines if no space is left:"
FontSize="13"
Foreground="#727272"
Margin="0, 0, 0, 10" />
<WrapPanel>
<Rectangle Fill="#FFC107" Height="50" Width="100" Margin="2.5" />
<Rectangle Fill="#FFC107" Height="100" Width="100" Margin="2.5" />
<Rectangle Fill="#FFC107" Height="50" Width="100" Margin="2.5" />
<Rectangle Fill="#FFC107" Height="50" Width="200" Margin="2.5" />
<Rectangle Fill="#FFC107" Height="100" Width="50" Margin="2.5" />
<Rectangle Fill="#FFC107" Height="50" Width="100" Margin="2.5" />
<Rectangle Fill="#FFC107" Height="50" Width="100" Margin="2.5" />
</WrapPanel>
<TextBlock Text="Canvas" FontWeight="Medium" FontSize="20" Foreground="#212121" />
<TextBlock Text="A panel which lays out its children by explicit coordinates."
FontSize="13"
Foreground="#727272"
Margin="0, 0, 0, 10" />
<Canvas Width="300" Height="200" Background="Yellow">
<Rectangle Fill="Blue" Width="63" Height="41" Canvas.Left="40" Canvas.Top="31" />
<Rectangle Fill="Green" Width="58" Height="58" Canvas.Left="130" Canvas.Top="79" />
</Canvas>
<TextBlock Text="DockPanel" FontWeight="Medium" FontSize="20" Foreground="#212121" />
<TextBlock
Text="A panel which lays docks its children on the sides and optionally fills the remaining space with the last child"
FontSize="13"
Foreground="#727272"
Margin="0, 0, 0, 10" />
<DockPanel Width="300" Height="300">
<Rectangle Fill="Red" Width="25" DockPanel.Dock="Left" />
<Rectangle Fill="Green" Height="25" DockPanel.Dock="Top" />
<Rectangle Fill="Blue" Width="25" DockPanel.Dock="Right" />
<Rectangle Fill="Yellow" Height="25" DockPanel.Dock="Bottom" />
<Rectangle Fill="Pink" />
</DockPanel>
<TextBlock Text="GridSplitter" FontWeight="Medium" FontSize="20" Foreground="#212121" />
<Grid Height="500" Width="500" ColumnDefinitions="*,Auto,*,Auto,*" RowDefinitions="*,Auto,*">
<Border Grid.Column="0" Grid.Row="0" Background="Red" />
<GridSplitter Grid.Column="0" Grid.Row="1" Orientation="Horizontal" />
<Border Grid.Column="0" Grid.Row="2" Background="Yellow" />
<GridSplitter Grid.Column="1" Grid.RowSpan="3" Orientation="Vertical" />
<Border Grid.Column="2" Grid.RowSpan="3" Background="Green" />
<GridSplitter Grid.Column="3" Grid.RowSpan="3" Orientation="Vertical"/>
<Border Grid.Column="4" Grid.Row="0" Background="Blue" />
<GridSplitter Grid.Column="4" Grid.Row="1" Orientation="Horizontal" />
<Border Grid.Column="4" Grid.Row="3" Background="Pink" />
</Grid>
</StackPanel>
</ScrollViewer>
</TabItem>
<TabItem Header="Animations">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border Width="100" Height="100">
<Border.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Color="Red" Offset="0" />
<GradientStop Color="Green" Offset="1" />
</LinearGradientBrush>
</Border.Background>
<TextBox HorizontalAlignment="Center" VerticalAlignment="Center" Text="hello!"></TextBox>
</Border>
<Border Grid.Row="0" Grid.Column="1" Background="Coral" HorizontalAlignment="Center"
VerticalAlignment="Center">
<Image Width="100" Height="100" Source="github_icon.png">
</Image>
</Border>
<Button Grid.Row="1" Grid.Column="1" Content="Animate" HorizontalAlignment="Center"></Button>
</Grid>
</TabItem>
<TabItem Header="Brushes">
<Grid ColumnDefinitions="Auto" RowDefinitions="Auto">
<Border Grid.Row="0" Grid.Column="0" Width="200" Height="200" Margin="10">
<Border.Background>
<VisualBrush TileMode="Tile" Stretch="None" AlignmentX="Left" AlignmentY="Top" SourceRect="0%,0%,100%,100%" DestinationRect="0,0,20,20">
<VisualBrush.Visual>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<Rectangle Width="10" Height="10" Fill="DarkGray"/>
<Rectangle Width="10" Height="10" Fill="LightGray"/>
</StackPanel>
<StackPanel Orientation="Vertical">
<Rectangle Width="10" Height="10" Fill="LightGray"/>
<Rectangle Width="10" Height="10" Fill="DarkGray"/>
</StackPanel>
</StackPanel>
</VisualBrush.Visual>
</VisualBrush>
</Border.Background>
</Border>
</Grid>
</TabItem>
<TabItem Header="IScrollable">
<ScrollViewer>
<local:TestScrollable/>
</ScrollViewer>
</TabItem>
<TabItem Header="Mem Leak Repro">
<Grid DataContext="{Binding Shell}">
<StackPanel>
<TabStrip Name="strip" Items="{Binding Documents}" SelectedItem="{Binding SelectedDocument, Mode=TwoWay}" Focusable="false">
<TabStrip.Styles>
<Style Selector="TabStripItem">
<Setter Property="Height" Value="20" />
<Setter Property="Background" Value="#2D2D30" />
<Setter Property="BorderBrush" Value="#3E3E42" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Margin" Value="0 0 0 -1" />
<Setter Property="Padding" Value="4 0 4 0" />
<Setter Property="FontSize" Value="12"/>
</Style>
<Style Selector="TabStripItem:pointerover">
<Setter Property="Background" Value="#1c97ea" />
</Style>
<Style Selector="TabStripItem:selected">
<Setter Property="Background" Value="#007ACC" />
</Style>
</TabStrip.Styles>
<TabStrip.DataTemplates>
<DataTemplate>
<StackPanel Orientation="Horizontal" Gap="2">
<TextBlock Text="{Binding Title}" Foreground="WhiteSmoke" Margin="2"/>
<Button Height="14" Width="14">
<Button.Styles>
<Style Selector="Button">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="Button:pointerover">
<Setter Property="Background" Value="#1c97ea" />
</Style>
</Button.Styles>
<Path Margin="2" Stretch="Uniform" UseLayoutRounding="False" Data="M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z" Fill="WhiteSmoke" />
</Button>
<Button Height="14" Width="14" Command="{Binding CloseCommand}">
<Button.Styles>
<Style Selector="Button">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="Button:pointerover">
<Setter Property="Background" Value="#1c97ea" />
</Style>
</Button.Styles>
<Path Margin="2" Stretch="Uniform" UseLayoutRounding="False" Data="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" Fill="WhiteSmoke" />
</Button>
</StackPanel>
</DataTemplate>
</TabStrip.DataTemplates>
</TabStrip>
<Grid Background="#007ACC" Height="2" />
<Button Content="AddTab" Command="{Binding AddDocumentCommand}" Width="50" Height="30" />
<Button Content="GC.Collecy" Command="{Binding GCCommand}" Width="50" Height="30" />
<TextBox Text="{Binding InstanceCount}" />
<Carousel Items="{Binding Documents}" SelectedIndex="{Binding #strip.SelectedIndex}" IsVirtualized="false">
<Carousel.DataTemplates>
<DataTemplate>
<TextBox Text="{Binding Text}" />
</DataTemplate>
</Carousel.DataTemplates>
</Carousel>
</StackPanel>
</Grid>
</TabItem>
</TabControl>
</Grid>
</Window>

14
samples/XamlTestApplicationPcl/XamlTestApp.cs

@ -1,14 +0,0 @@
using Avalonia;
using Avalonia.Markup.Xaml;
using XamlTestApplication.Views;
namespace XamlTestApplication
{
public class XamlTestApp : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
}
}

8
samples/XamlTestApplicationPcl/XamlTestApp.xaml

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

150
samples/XamlTestApplicationPcl/XamlTestApplicationPcl.csproj

@ -1,150 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EA113F1A-D8D7-4142-9948-353270E7EBAE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>XamlTestApplication</RootNamespace>
<AssemblyName>XamlTestApplicationPcl</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->
<EmbeddedResource Include="Views\MainWindow.xaml">
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestScrollable.cs" />
<Compile Include="ViewModels\EditorViewModel.cs" />
<Compile Include="ViewModels\MainWindowViewModel.cs" />
<Compile Include="ViewModels\TestItem.cs" />
<Compile Include="ViewModels\TestNode.cs" />
<Compile Include="Views\MainWindow.cs" />
<Compile Include="XamlTestApp.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="github_icon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="pattern.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup.Xaml\Avalonia.Markup.Xaml.csproj">
<Project>{3e53a01a-b331-47f3-b828-4a5717e77a24}</Project>
<Name>Avalonia.Markup.Xaml</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup\Avalonia.Markup.csproj">
<Project>{6417e941-21bc-467b-a771-0de389353ce6}</Project>
<Name>Avalonia.Markup</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Animation\Avalonia.Animation.csproj">
<Project>{d211e587-d8bc-45b9-95a4-f297c8fa5200}</Project>
<Name>Avalonia.Animation</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Base\Avalonia.Base.csproj">
<Project>{b09b78d8-9b26-48b0-9149-d64a2f120f3f}</Project>
<Name>Avalonia.Base</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Controls\Avalonia.Controls.csproj">
<Project>{d2221c82-4a25-4583-9b43-d791e3f6820c}</Project>
<Name>Avalonia.Controls</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.DesignerSupport\Avalonia.DesignerSupport.csproj">
<Project>{799a7bb5-3c2c-48b6-85a7-406a12c420da}</Project>
<Name>Avalonia.DesignerSupport</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj">
<Project>{7062ae20-5dcc-4442-9645-8195bdece63e}</Project>
<Name>Avalonia.Diagnostics</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.HtmlRenderer\Avalonia.HtmlRenderer.csproj">
<Project>{5fb2b005-0a7f-4dad-add4-3ed01444e63d}</Project>
<Name>Avalonia.HtmlRenderer</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Input\Avalonia.Input.csproj">
<Project>{62024b2d-53eb-4638-b26b-85eeaa54866e}</Project>
<Name>Avalonia.Input</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Interactivity\Avalonia.Interactivity.csproj">
<Project>{6b0ed19d-a08b-461c-a9d9-a9ee40b0c06b}</Project>
<Name>Avalonia.Interactivity</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Layout\Avalonia.Layout.csproj">
<Project>{42472427-4774-4c81-8aff-9f27b8e31721}</Project>
<Name>Avalonia.Layout</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj">
<Project>{6417b24e-49c2-4985-8db2-3ab9d898ec91}</Project>
<Name>Avalonia.ReactiveUI</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Visuals\Avalonia.Visuals.csproj">
<Project>{eb582467-6abb-43a1-b052-e981ba910e3a}</Project>
<Name>Avalonia.Visuals</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Styling\Avalonia.Styling.csproj">
<Project>{f1baa01a-f176-4c6a-b39d-5b40bb1b148f}</Project>
<Name>Avalonia.Styling</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj">
<Project>{3e10a5fa-e8da-48b1-ad44-6a5b6cb7750f}</Project>
<Name>Avalonia.Themes.Default</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Splat.1.6.2\lib\Portable-net45+win+wpa81+wp80\Splat.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Core.3.0.0\lib\netstandard1.1\System.Reactive.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Interfaces, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Interfaces.3.0.0\lib\netstandard1.0\System.Reactive.Interfaces.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="XamlTestApp.xaml">
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

26
samples/XamlTestApplicationPcl/XamlTestApplicationPcl.v2.ncrunchproject

@ -1,26 +0,0 @@
<ProjectConfiguration>
<AutoDetectNugetBuildDependencies>true</AutoDetectNugetBuildDependencies>
<BuildPriority>1000</BuildPriority>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<AllowCodeAnalysis>false</AllowCodeAnalysis>
<IgnoreThisComponentCompletely>true</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<DetectStackOverflow>true</DetectStackOverflow>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>60000</DefaultTestTimeout>
<UseBuildConfiguration></UseBuildConfiguration>
<UseBuildPlatform></UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>

BIN
samples/XamlTestApplicationPcl/github_icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

6
samples/XamlTestApplicationPcl/packages.config

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Splat" version="1.6.2" targetFramework="portable45-net45+win8" />
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" />
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" />
</packages>

BIN
samples/XamlTestApplicationPcl/pattern.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

20
src/Android/Avalonia.Android/AndroidPlatform.cs

@ -25,7 +25,7 @@ namespace Avalonia
namespace Avalonia.Android
{
public class AndroidPlatform : IPlatformSettings, IWindowingPlatform, IPlatformIconLoader
public class AndroidPlatform : IPlatformSettings, IWindowingPlatform
{
public static readonly AndroidPlatform Instance = new AndroidPlatform();
public Size DoubleClickSize => new Size(4, 4);
@ -50,7 +50,8 @@ namespace Avalonia.Android
.Bind<IPlatformSettings>().ToConstant(Instance)
.Bind<IPlatformThreadingInterface>().ToConstant(new AndroidThreadingInterface())
.Bind<ISystemDialogImpl>().ToTransient<SystemDialogImpl>()
.Bind<IWindowingPlatform>().ToConstant(Instance);
.Bind<IWindowingPlatform>().ToConstant(Instance)
.Bind<IPlatformIconLoader>().ToSingleton<PlatformIconLoader>();
SkiaPlatform.Initialize();
}
@ -74,20 +75,5 @@ namespace Avalonia.Android
{
throw new NotImplementedException();
}
public IWindowIconImpl LoadIcon(string fileName)
{
return null;
}
public IWindowIconImpl LoadIcon(Stream stream)
{
return null;
}
public IWindowIconImpl LoadIcon(IBitmapImpl bitmap)
{
return null;
}
}
}

1
src/Android/Avalonia.Android/Avalonia.Android.csproj

@ -63,6 +63,7 @@
<ItemGroup>
<Compile Include="AndroidPlatform.cs" />
<Compile Include="AndroidThreadingInterface.cs" />
<Compile Include="PlatformIconLoader.cs" />
<Compile Include="Platform\ClipboardImpl.cs" />
<Compile Include="CursorFactory.cs" />
<Compile Include="Platform\Input\AndroidKeyboardDevice.cs" />

59
src/Android/Avalonia.Android/PlatformIconLoader.cs

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Avalonia.Platform;
using System.IO;
namespace Avalonia.Android
{
class PlatformIconLoader : IPlatformIconLoader
{
public IWindowIconImpl LoadIcon(IBitmapImpl bitmap)
{
using (var stream = new MemoryStream())
{
bitmap.Save(stream);
return LoadIcon(stream);
}
}
public IWindowIconImpl LoadIcon(Stream stream)
{
return new FakeIcon(stream);
}
public IWindowIconImpl LoadIcon(string fileName)
{
using (var file = File.Open(fileName, FileMode.Open))
{
return new FakeIcon(file);
}
}
}
// Stores the icon created as a stream to support saving even though an icon is never shown
public class FakeIcon : IWindowIconImpl
{
private Stream stream = new MemoryStream();
public FakeIcon(Stream stream)
{
stream.CopyTo(this.stream);
}
public Stream Save()
{
var returnStream = new MemoryStream();
stream.CopyTo(returnStream);
return returnStream;
}
}
}

3
src/Avalonia.Controls/Platform/IWindowIconImpl.cs

@ -1,9 +1,12 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System.IO;
namespace Avalonia.Platform
{
public interface IWindowIconImpl
{
Stream Save();
}
}

2
src/Avalonia.Controls/WindowIcon.cs

@ -30,5 +30,7 @@ namespace Avalonia.Controls
}
public IWindowIconImpl PlatformImpl { get; }
public Stream Save() => PlatformImpl.Save();
}
}

6
src/Gtk/Avalonia.Gtk/IconImpl.cs

@ -5,6 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Gdk;
using System.IO;
namespace Avalonia.Gtk
{
@ -16,5 +17,10 @@ namespace Avalonia.Gtk
}
public Pixbuf Pixbuf { get; }
public Stream Save()
{
return new MemoryStream(Pixbuf.SaveToBuffer("png"));
}
}
}

16
src/Windows/Avalonia.Win32/IconImpl.cs

@ -5,6 +5,8 @@ using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Drawing.Imaging;
namespace Avalonia.Win32
{
@ -24,5 +26,19 @@ namespace Avalonia.Win32
}
public IntPtr HIcon => icon?.Handle ?? bitmap.GetHicon();
public Stream Save()
{
var stream = new MemoryStream();
if (icon != null)
{
icon.Save(stream);
}
else
{
bitmap.Save(stream, ImageFormat.Png);
}
return stream;
}
}
}

36
src/iOS/Avalonia.iOS/PlatformIconLoader.cs

@ -1,7 +1,4 @@
using Avalonia.Platform;
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace Avalonia.iOS
@ -10,17 +7,42 @@ namespace Avalonia.iOS
{
public IWindowIconImpl LoadIcon(IBitmapImpl bitmap)
{
return null;
using (var stream = new MemoryStream())
{
bitmap.Save(stream);
return LoadIcon(stream);
}
}
public IWindowIconImpl LoadIcon(Stream stream)
{
return null;
return new FakeIcon(stream);
}
public IWindowIconImpl LoadIcon(string fileName)
{
return null;
using (var file = File.Open(fileName, FileMode.Open))
{
return new FakeIcon(file);
}
}
}
}
// Stores the icon created as a stream to support saving even though an icon is never shown
public class FakeIcon : IWindowIconImpl
{
private Stream stream = new MemoryStream();
public FakeIcon(Stream stream)
{
stream.CopyTo(this.stream);
}
public Stream Save()
{
var returnStream = new MemoryStream();
stream.CopyTo(returnStream);
return returnStream;
}
}
}

1
src/iOS/Avalonia.iOSTestApplication/Avalonia.iOSTestApplication.csproj

@ -196,6 +196,5 @@
<IsWatchApp>false</IsWatchApp>
</ProjectReference>
</ItemGroup>
<Import Project="..\..\..\samples\TestApplicationShared\TestApplicationShared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>
Loading…
Cancel
Save