diff --git a/.travis.yml b/.travis.yml index ea09278cdd..9fb48a024e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ env: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 - DOTNET_CLI_TELEMETRY_OPTOUT=1 mono: - - latest + - 5.2.0 dotnet: 2.0.0 script: - ./build.sh --target "Travis" --platform "Mono" --configuration "Release" diff --git a/Avalonia.sln b/Avalonia.sln index c6509817ce..a29f3dd754 100644 --- a/Avalonia.sln +++ b/Avalonia.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26730.10 +VisualStudioVersion = 15.0.27004.2008 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Base", "src\Avalonia.Base\Avalonia.Base.csproj", "{B09B78D8-9B26-48B0-9149-D64A2F120F3F}" EndProject @@ -155,7 +155,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Props", "Props", "{F3AC8BC1 build\ReactiveUI.props = build\ReactiveUI.props build\Rx.props = build\Rx.props build\Serilog.props = build\Serilog.props - build\Serilog.Sinks.Trace.props = build\Serilog.Sinks.Trace.props build\SharpDX.props = build\SharpDX.props build\SkiaSharp.Desktop.props = build\SkiaSharp.Desktop.props build\SkiaSharp.props = build\SkiaSharp.props diff --git a/appveyor.yml b/appveyor.yml index aa8c19ace4..ba3680d0b9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -os: Visual Studio 2017 +os: Previous Visual Studio 2017 platform: - Any CPU skip_branch_with_pr: true @@ -23,10 +23,6 @@ before_build: - git submodule update --init build_script: - ps: .\build.ps1 -Target "AppVeyor" -Platform "$env:platform" -Configuration "$env:configuration" -after_build: -- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%" -- pip install codecov -- codecov -f "./artifacts/coverage.xml" test: off artifacts: diff --git a/build/MonoMac.props b/build/MonoMac.props index 452177ca5d..5cf19ef503 100644 --- a/build/MonoMac.props +++ b/build/MonoMac.props @@ -1,5 +1,5 @@  - + diff --git a/build/Serilog.Sinks.Trace.props b/build/Serilog.Sinks.Trace.props deleted file mode 100644 index ef79fd7669..0000000000 --- a/build/Serilog.Sinks.Trace.props +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/build/Serilog.props b/build/Serilog.props index e9bd39f6af..a814cf998d 100644 --- a/build/Serilog.props +++ b/build/Serilog.props @@ -1,5 +1,7 @@  - + + + diff --git a/build/Splat.props b/build/Splat.props deleted file mode 100644 index bc3367be01..0000000000 --- a/build/Splat.props +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/packages.cake b/packages.cake index 98075ef36b..bc290fce22 100644 --- a/packages.cake +++ b/packages.cake @@ -107,7 +107,8 @@ public class Packages context.Information("Setting NuGet package dependencies versions:"); var SerilogVersion = packageVersions["Serilog"].FirstOrDefault().Item1; - var SplatVersion = packageVersions["Splat"].FirstOrDefault().Item1; + var SerilogSinksDebugVersion = packageVersions["Serilog.Sinks.Debug"].FirstOrDefault().Item1; + var SerilogSinksTraceVersion = packageVersions["Serilog.Sinks.Trace"].FirstOrDefault().Item1; var SpracheVersion = packageVersions["Sprache"].FirstOrDefault().Item1; var SystemReactiveVersion = packageVersions["System.Reactive"].FirstOrDefault().Item1; var ReactiveUIVersion = packageVersions["reactiveui"].FirstOrDefault().Item1; @@ -121,7 +122,6 @@ public class Packages var SharpDXDXGIVersion = packageVersions["SharpDX.DXGI"].FirstOrDefault().Item1; context.Information("Package: Serilog, version: {0}", SerilogVersion); - context.Information("Package: Splat, version: {0}", SplatVersion); context.Information("Package: Sprache, version: {0}", SpracheVersion); context.Information("Package: System.Reactive, version: {0}", SystemReactiveVersion); context.Information("Package: reactiveui, version: {0}", ReactiveUIVersion); @@ -245,7 +245,8 @@ public class Packages Dependencies = new DependencyBuilder(this) { new NuSpecDependency() { Id = "Serilog", Version = SerilogVersion }, - new NuSpecDependency() { Id = "Splat", Version = SplatVersion }, + new NuSpecDependency() { Id = "Serilog.Sinks.Debug", Version = SerilogSinksDebugVersion }, + new NuSpecDependency() { Id = "Serilog.Sinks.Trace", Version = SerilogSinksTraceVersion }, new NuSpecDependency() { Id = "Sprache", Version = SpracheVersion }, new NuSpecDependency() { Id = "System.Reactive", Version = SystemReactiveVersion }, new NuSpecDependency() { Id = "Avalonia.Remote.Protocol", Version = parameters.Version }, @@ -253,8 +254,9 @@ public class Packages new NuSpecDependency() { Id = "System.Threading.ThreadPool", TargetFramework = "netcoreapp2.0", Version = "4.3.0" }, new NuSpecDependency() { Id = "Microsoft.Extensions.DependencyModel", TargetFramework = "netcoreapp2.0", Version = "1.1.0" }, new NuSpecDependency() { Id = "NETStandard.Library", TargetFramework = "netcoreapp2.0", Version = "1.6.0" }, - new NuSpecDependency() { Id = "Splat", TargetFramework = "netcoreapp2.0", Version = SplatVersion }, new NuSpecDependency() { Id = "Serilog", TargetFramework = "netcoreapp2.0", Version = SerilogVersion }, + new NuSpecDependency() { Id = "Serilog.Sinks.Debug", TargetFramework = "netcoreapp2.0", Version = SerilogSinksDebugVersion }, + new NuSpecDependency() { Id = "Serilog.Sinks.Trace", TargetFramework = "netcoreapp2.0", Version = SerilogSinksTraceVersion }, new NuSpecDependency() { Id = "Sprache", TargetFramework = "netcoreapp2.0", Version = SpracheVersion }, new NuSpecDependency() { Id = "System.Reactive", TargetFramework = "netcoreapp2.0", Version = SystemReactiveVersion }, new NuSpecDependency() { Id = "Avalonia.Remote.Protocol", TargetFramework = "netcoreapp2.0", Version = parameters.Version }, diff --git a/samples/BindingTest/App.xaml.cs b/samples/BindingTest/App.xaml.cs index 42e5716541..ccad1d0ba9 100644 --- a/samples/BindingTest/App.xaml.cs +++ b/samples/BindingTest/App.xaml.cs @@ -16,22 +16,11 @@ namespace BindingTest private static void Main() { - InitializeLogging(); - AppBuilder.Configure() .UsePlatformDetect() .UseReactiveUI() + .LogToDebug() .Start(); } - - private static void InitializeLogging() - { -#if DEBUG - SerilogLogger.Initialize(new LoggerConfiguration() - .MinimumLevel.Warning() - .WriteTo.Trace(outputTemplate: "{Area}: {Message}") - .CreateLogger()); -#endif - } } } diff --git a/samples/BindingTest/BindingTest.csproj b/samples/BindingTest/BindingTest.csproj index d7d349fbdf..9f3fed5522 100644 --- a/samples/BindingTest/BindingTest.csproj +++ b/samples/BindingTest/BindingTest.csproj @@ -151,8 +151,6 @@ - - \ No newline at end of file diff --git a/samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj b/samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj index 3f4679086e..cfa2f89b0e 100644 --- a/samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj +++ b/samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj @@ -135,5 +135,4 @@ - \ No newline at end of file diff --git a/samples/ControlCatalog.Desktop/Program.cs b/samples/ControlCatalog.Desktop/Program.cs index 20bf4ed342..b151cabf43 100644 --- a/samples/ControlCatalog.Desktop/Program.cs +++ b/samples/ControlCatalog.Desktop/Program.cs @@ -12,8 +12,6 @@ namespace ControlCatalog { static void Main(string[] args) { - InitializeLogging(); - // TODO: Make this work with GTK/Skia/Cairo depending on command-line args // again. BuildAvaloniaApp().Start(); @@ -23,18 +21,7 @@ namespace ControlCatalog /// This method is needed for IDE previewer infrastructure /// public static AppBuilder BuildAvaloniaApp() - => AppBuilder.Configure().UsePlatformDetect(); - - // This will be made into a runtime configuration extension soon! - private static void InitializeLogging() - { -#if DEBUG - SerilogLogger.Initialize(new LoggerConfiguration() - .MinimumLevel.Warning() - .WriteTo.Trace(outputTemplate: "{Area}: {Message}") - .CreateLogger()); -#endif - } + => AppBuilder.Configure().LogToDebug().UsePlatformDetect(); private static void ConfigureAssetAssembly(AppBuilder builder) { diff --git a/samples/ControlCatalog/ControlCatalog.csproj b/samples/ControlCatalog/ControlCatalog.csproj index 11ff531514..0b4463ddb7 100644 --- a/samples/ControlCatalog/ControlCatalog.csproj +++ b/samples/ControlCatalog/ControlCatalog.csproj @@ -44,6 +44,9 @@ Designer + + Designer + Designer @@ -107,6 +110,9 @@ ButtonPage.xaml + + CalendarPage.xaml + CanvasPage.xaml diff --git a/samples/ControlCatalog/MainView.xaml b/samples/ControlCatalog/MainView.xaml index 0940316ce9..311a61a6dc 100644 --- a/samples/ControlCatalog/MainView.xaml +++ b/samples/ControlCatalog/MainView.xaml @@ -7,6 +7,7 @@ + diff --git a/samples/ControlCatalog/Pages/CalendarPage.xaml b/samples/ControlCatalog/Pages/CalendarPage.xaml new file mode 100644 index 0000000000..a433fd1add --- /dev/null +++ b/samples/ControlCatalog/Pages/CalendarPage.xaml @@ -0,0 +1,47 @@ + + + Calendar + A calendar control for selecting dates + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/ControlCatalog/Pages/CalendarPage.xaml.cs b/samples/ControlCatalog/Pages/CalendarPage.xaml.cs new file mode 100644 index 0000000000..e3e9a3444e --- /dev/null +++ b/samples/ControlCatalog/Pages/CalendarPage.xaml.cs @@ -0,0 +1,28 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using System; + +namespace ControlCatalog.Pages +{ + public class CalendarPage : UserControl + { + public CalendarPage() + { + this.InitializeComponent(); + + var today = DateTime.Today; + var cal1 = this.FindControl("DisplayDatesCalendar"); + cal1.DisplayDateStart = today.AddDays(-25); + cal1.DisplayDateEnd = today.AddDays(25); + + var cal2 = this.FindControl("BlackoutDatesCalendar"); + cal2.BlackoutDates.AddDatesInPast(); + cal2.BlackoutDates.Add(new CalendarDateRange(today.AddDays(6))); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + } +} diff --git a/samples/ControlCatalog/Pages/CarouselPage.xaml b/samples/ControlCatalog/Pages/CarouselPage.xaml index 317159cd8d..4a5b2cea26 100644 --- a/samples/ControlCatalog/Pages/CarouselPage.xaml +++ b/samples/ControlCatalog/Pages/CarouselPage.xaml @@ -9,7 +9,7 @@ - + @@ -28,6 +28,14 @@ Crossfade + + + Orientation + + Horizontal + Vertical + + \ No newline at end of file diff --git a/samples/ControlCatalog/Pages/CarouselPage.xaml.cs b/samples/ControlCatalog/Pages/CarouselPage.xaml.cs index 1c408c8ed7..272290e679 100644 --- a/samples/ControlCatalog/Pages/CarouselPage.xaml.cs +++ b/samples/ControlCatalog/Pages/CarouselPage.xaml.cs @@ -11,6 +11,7 @@ namespace ControlCatalog.Pages private Button _left; private Button _right; private DropDown _transition; + private DropDown _orientation; public CarouselPage() { @@ -18,6 +19,7 @@ namespace ControlCatalog.Pages _left.Click += (s, e) => _carousel.Previous(); _right.Click += (s, e) => _carousel.Next(); _transition.SelectionChanged += TransitionChanged; + _orientation.SelectionChanged += TransitionChanged; } private void InitializeComponent() @@ -27,6 +29,7 @@ namespace ControlCatalog.Pages _left = this.FindControl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Avalonia.Themes.Default/CheckBox.xaml b/src/Avalonia.Themes.Default/CheckBox.xaml index 195ec098c9..ef96e7ed4f 100644 --- a/src/Avalonia.Themes.Default/CheckBox.xaml +++ b/src/Avalonia.Themes.Default/CheckBox.xaml @@ -12,14 +12,23 @@ Width="18" Height="18" VerticalAlignment="Center"> - + + + + + + diff --git a/src/Avalonia.Themes.Default/DefaultTheme.xaml b/src/Avalonia.Themes.Default/DefaultTheme.xaml index 48f530cca8..ae00f0757a 100644 --- a/src/Avalonia.Themes.Default/DefaultTheme.xaml +++ b/src/Avalonia.Themes.Default/DefaultTheme.xaml @@ -36,4 +36,8 @@ + + + + diff --git a/src/Avalonia.Themes.Default/RadioButton.xaml b/src/Avalonia.Themes.Default/RadioButton.xaml index 996f46023e..0a0eb48564 100644 --- a/src/Avalonia.Themes.Default/RadioButton.xaml +++ b/src/Avalonia.Themes.Default/RadioButton.xaml @@ -20,6 +20,14 @@ UseLayoutRounding="False" HorizontalAlignment="Center" VerticalAlignment="Center"/> + + + diff --git a/src/Avalonia.Themes.Default/TabControl.xaml b/src/Avalonia.Themes.Default/TabControl.xaml index 2397ce4e95..f8fb4a1f49 100644 --- a/src/Avalonia.Themes.Default/TabControl.xaml +++ b/src/Avalonia.Themes.Default/TabControl.xaml @@ -1,4 +1,4 @@ - + - - + "; @@ -818,10 +823,11 @@ do we need it?")] { var xaml = @" - + "; @@ -881,4 +887,13 @@ do we need it?")] } } } + public class BasicTestsAttachedPropertyHolder + { + public static AvaloniaProperty FooProperty = + AvaloniaProperty.RegisterAttached("Foo"); + + public static void SetFoo(AvaloniaObject target, string value) => target.SetValue(FooProperty, value); + public static string GetFoo(AvaloniaObject target) => (string)target.GetValue(FooProperty); + + } } \ No newline at end of file diff --git a/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BindingTests_RelativeSource.cs b/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BindingTests_RelativeSource.cs index 9125e1e643..095aae7742 100644 --- a/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BindingTests_RelativeSource.cs +++ b/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BindingTests_RelativeSource.cs @@ -3,6 +3,7 @@ using Avalonia.Controls; using Avalonia.UnitTests; +using System; using Xunit; namespace Avalonia.Markup.Xaml.UnitTests.Xaml @@ -77,6 +78,77 @@ namespace Avalonia.Markup.Xaml.UnitTests.Xaml } } + [Fact] + public void Binding_To_First_Ancestor_Without_AncestorType_Throws_Exception() + { + using (UnitTestApplication.Start(TestServices.StyledWindow)) + { + var xaml = @" + + + +