diff --git a/.editorconfig b/.editorconfig
index ff7ac5d69e..3620896f34 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -169,6 +169,8 @@ dotnet_diagnostic.CA1828.severity = warning
dotnet_diagnostic.CA1829.severity = warning
#CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
dotnet_diagnostic.CA1847.severity = warning
+#CACA2211:Non-constant fields should not be visible
+dotnet_diagnostic.CA2211.severity = error
# Wrapping preferences
csharp_wrap_before_ternary_opsigns = false
diff --git a/Directory.Build.props b/Directory.Build.props
index 42daa2df7f..c19a55e8ea 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -7,5 +7,6 @@
false
false
False
+ 11
diff --git a/NOTICE.md b/NOTICE.md
index e97fc654c9..7083706c3e 100644
--- a/NOTICE.md
+++ b/NOTICE.md
@@ -81,14 +81,14 @@ A "contributor" is any person that distributes its contribution under this licen
https://github.com/wayland-project/wayland-protocols
-Copyright 2008-2013 Kristian Hgsberg
-Copyright 2010-2013 Intel Corporation
-Copyright 2013 Rafael Antognolli
-Copyright 2013 Jasper St. Pierre
-Copyright 2014 Jonas dahl
-Copyright 2014 Jason Ekstrand
-Copyright 2014-2015 Collabora, Ltd.
-Copyright 2015 Red Hat Inc.
+Copyright © 2008-2013 Kristian Høgsberg
+Copyright © 2010-2013 Intel Corporation
+Copyright © 2013 Rafael Antognolli
+Copyright © 2013 Jasper St. Pierre
+Copyright © 2014 Jonas Ådahl
+Copyright © 2014 Jason Ekstrand
+Copyright © 2014-2015 Collabora, Ltd.
+Copyright © 2015 Red Hat Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@@ -140,7 +140,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
https://github.com/toptensoftware/RichTextKit
-Copyright 2019 Topten Software. All Rights Reserved.
+Copyright © 2019 Topten Software. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this product except in compliance with the License. You may obtain
@@ -303,3 +303,62 @@ https://github.com/chromium/chromium
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Flutter
+
+https://github.com/flutter/flutter
+
+//Copyright 2014 The Flutter Authors. All rights reserved.
+
+//Redistribution and use in source and binary forms, with or without modification,
+//are permitted provided that the following conditions are met:
+
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+//ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+//DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+//ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+//(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+//LOSS OF USE, DATA, OR PROFITS;
+//OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+//ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+//(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Reactive Extensions
+
+https://github.com/dotnet/reactive
+
+The MIT License (MIT)
+
+Copyright (c) .NET Foundation and Contributors
+
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/azure-pipelines-integrationtests.yml b/azure-pipelines-integrationtests.yml
index 43253ac6be..5735da19ab 100644
--- a/azure-pipelines-integrationtests.yml
+++ b/azure-pipelines-integrationtests.yml
@@ -13,14 +13,14 @@ jobs:
steps:
- task: UseDotNet@2
- displayName: 'Use .NET Core SDK 6.0.401'
+ displayName: 'Use .NET Core SDK 6.0.404'
inputs:
- version: 6.0.401
+ version: 6.0.404
- task: UseDotNet@2
- displayName: 'Use .NET Core SDK 7.0.100'
+ displayName: 'Use .NET Core SDK 7.0.101'
inputs:
- version: 7.0.100
+ version: 7.0.101
- script: system_profiler SPDisplaysDataType |grep Resolution
@@ -51,14 +51,14 @@ jobs:
steps:
- task: UseDotNet@2
- displayName: 'Use .NET Core SDK 6.0.401'
+ displayName: 'Use .NET Core SDK 6.0.404'
inputs:
- version: 6.0.401
+ version: 6.0.404
- task: UseDotNet@2
- displayName: 'Use .NET Core SDK 7.0.100'
+ displayName: 'Use .NET Core SDK 7.0.101'
inputs:
- version: 7.0.100
+ version: 7.0.101
- task: Windows Application Driver@0
inputs:
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index a3bbc33418..8bab6e68e2 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -30,14 +30,14 @@ jobs:
vmImage: 'ubuntu-20.04'
steps:
- task: UseDotNet@2
- displayName: 'Use .NET Core SDK 6.0.401'
+ displayName: 'Use .NET Core SDK 6.0.404'
inputs:
- version: 6.0.401
+ version: 6.0.404
- task: UseDotNet@2
- displayName: 'Use .NET Core SDK 7.0'
+ displayName: 'Use .NET Core SDK 7.0.101'
inputs:
- version: 7.0.100
+ version: 7.0.101
- task: CmdLine@2
displayName: 'Install Workloads'
@@ -67,14 +67,14 @@ jobs:
vmImage: 'macos-12'
steps:
- task: UseDotNet@2
- displayName: 'Use .NET Core SDK 6.0.401'
+ displayName: 'Use .NET Core SDK 6.0.404'
inputs:
- version: 6.0.401
+ version: 6.0.404
- task: UseDotNet@2
- displayName: 'Use .NET Core SDK 7.0.100'
+ displayName: 'Use .NET Core SDK 7.0.101'
inputs:
- version: 7.0.100
+ version: 7.0.101
- task: CmdLine@2
displayName: 'Install Workloads'
@@ -138,14 +138,14 @@ jobs:
SolutionDir: '$(Build.SourcesDirectory)'
steps:
- task: UseDotNet@2
- displayName: 'Use .NET Core SDK 6.0.401'
+ displayName: 'Use .NET Core SDK 6.0.404'
inputs:
- version: 6.0.401
+ version: 6.0.404
- task: UseDotNet@2
- displayName: 'Use .NET Core SDK 7.0.100'
+ displayName: 'Use .NET Core SDK 7.0.101'
inputs:
- version: 7.0.100
+ version: 7.0.101
- task: CmdLine@2
displayName: 'Install Workloads'
diff --git a/build/Base.props b/build/Base.props
index 100c9088cd..26f19e3abc 100644
--- a/build/Base.props
+++ b/build/Base.props
@@ -1,6 +1,7 @@
-
+
+
diff --git a/build/SharedVersion.props b/build/SharedVersion.props
index e9c3d65b41..eca3ba37b0 100644
--- a/build/SharedVersion.props
+++ b/build/SharedVersion.props
@@ -8,7 +8,6 @@
https://github.com/AvaloniaUI/Avalonia/
true
$(NoWarn);CS1591
- preview
MIT
Icon.png
Avalonia is a cross-platform UI framework for .NET providing a flexible styling system and supporting a wide range of Operating Systems such as Windows, Linux, macOS and with experimental support for Android, iOS and WebAssembly.
diff --git a/build/System.Memory.props b/build/System.Memory.props
index b36998a780..a413e18927 100644
--- a/build/System.Memory.props
+++ b/build/System.Memory.props
@@ -1,5 +1,5 @@
-
+
diff --git a/global.json b/global.json
index a9318b212f..8536535b51 100644
--- a/global.json
+++ b/global.json
@@ -1,11 +1,9 @@
{
"sdk": {
- "version": "7.0.100",
+ "version": "7.0.101",
"rollForward": "latestFeature"
},
"msbuild-sdks": {
- "Microsoft.Build.Traversal": "1.0.43",
- "MSBuild.Sdk.Extras": "3.0.22",
- "AggregatePackage.NuGet.Sdk" : "0.1.12"
+ "Microsoft.Build.Traversal": "3.2.0"
}
}
diff --git a/samples/ControlCatalog.Android/MainActivity.cs b/samples/ControlCatalog.Android/MainActivity.cs
index 62c582610c..f6fa07dbde 100644
--- a/samples/ControlCatalog.Android/MainActivity.cs
+++ b/samples/ControlCatalog.Android/MainActivity.cs
@@ -5,7 +5,7 @@ using Avalonia.Android;
namespace ControlCatalog.Android
{
- [Activity(Label = "ControlCatalog.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)]
+ [Activity(Label = "ControlCatalog.Android", Theme = "@style/MyTheme.Main", Icon = "@drawable/icon", LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)]
public class MainActivity : AvaloniaMainActivity
{
}
diff --git a/samples/ControlCatalog.Android/Resources/values/styles.xml b/samples/ControlCatalog.Android/Resources/values/styles.xml
index 2759d2904a..49e079a719 100644
--- a/samples/ControlCatalog.Android/Resources/values/styles.xml
+++ b/samples/ControlCatalog.Android/Resources/values/styles.xml
@@ -14,4 +14,8 @@
- @null
+
+
diff --git a/samples/ControlCatalog.Android/SplashActivity.cs b/samples/ControlCatalog.Android/SplashActivity.cs
index 908b5f082a..a0b68b129b 100644
--- a/samples/ControlCatalog.Android/SplashActivity.cs
+++ b/samples/ControlCatalog.Android/SplashActivity.cs
@@ -28,6 +28,8 @@ namespace ControlCatalog.Android
base.OnResume();
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
+
+ Finish();
}
}
}
diff --git a/samples/ControlCatalog.Browser/Properties/launchSettings.json b/samples/ControlCatalog.Browser/Properties/launchSettings.json
new file mode 100644
index 0000000000..76c1834e3c
--- /dev/null
+++ b/samples/ControlCatalog.Browser/Properties/launchSettings.json
@@ -0,0 +1,13 @@
+{
+ "profiles": {
+ "ControlCatalog.Browser": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
+ "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/debug?browser={browserInspectUri}"
+ }
+ }
+}
diff --git a/samples/ControlCatalog.Desktop/Program.cs b/samples/ControlCatalog.Desktop/Program.cs
index 7b8b27fff7..4d28f15e2c 100644
--- a/samples/ControlCatalog.Desktop/Program.cs
+++ b/samples/ControlCatalog.Desktop/Program.cs
@@ -23,7 +23,7 @@ namespace ControlCatalog
private static void ConfigureAssetAssembly(AppBuilder builder)
{
AvaloniaLocator.CurrentMutable
- .GetService()
+ .GetRequiredService()
.SetDefaultAssembly(typeof(App).Assembly);
}
}
diff --git a/samples/ControlCatalog/MainView.xaml b/samples/ControlCatalog/MainView.xaml
index 9e0fb3f852..166b98436e 100644
--- a/samples/ControlCatalog/MainView.xaml
+++ b/samples/ControlCatalog/MainView.xaml
@@ -209,8 +209,7 @@
+ HorizontalAlignment="Stretch">
None
Transparent
diff --git a/samples/ControlCatalog/MainView.xaml.cs b/samples/ControlCatalog/MainView.xaml.cs
index 15e666ae7b..f3c1a68e72 100644
--- a/samples/ControlCatalog/MainView.xaml.cs
+++ b/samples/ControlCatalog/MainView.xaml.cs
@@ -6,6 +6,7 @@ using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Avalonia.Media;
using Avalonia.Media.Immutable;
+using Avalonia.VisualTree;
using ControlCatalog.Models;
using ControlCatalog.Pages;
@@ -59,17 +60,25 @@ namespace ControlCatalog
};
var transparencyLevels = this.Get("TransparencyLevels");
- IDisposable? backgroundSetter = null, paneBackgroundSetter = null;
+ IDisposable? topLevelBackgroundSideSetter = null, sideBarBackgroundSetter = null, paneBackgroundSetter = null;
transparencyLevels.SelectionChanged += (sender, e) =>
{
- backgroundSetter?.Dispose();
+ topLevelBackgroundSideSetter?.Dispose();
+ sideBarBackgroundSetter?.Dispose();
paneBackgroundSetter?.Dispose();
- if (transparencyLevels.SelectedItem is WindowTransparencyLevel selected
- && selected != WindowTransparencyLevel.None)
+ if (transparencyLevels.SelectedItem is WindowTransparencyLevel selected)
{
- var semiTransparentBrush = new ImmutableSolidColorBrush(Colors.Gray, 0.5);
- backgroundSetter = sideBar.SetValue(BackgroundProperty, semiTransparentBrush, Avalonia.Data.BindingPriority.Style);
- paneBackgroundSetter = sideBar.SetValue(SplitView.PaneBackgroundProperty, semiTransparentBrush, Avalonia.Data.BindingPriority.Style);
+ var topLevel = (TopLevel)this.GetVisualRoot()!;
+ topLevel.TransparencyLevelHint = selected;
+
+ if (selected != WindowTransparencyLevel.None)
+ {
+ var transparentBrush = new ImmutableSolidColorBrush(Colors.White, 0);
+ var semiTransparentBrush = new ImmutableSolidColorBrush(Colors.Gray, 0.2);
+ topLevelBackgroundSideSetter = topLevel.SetValue(BackgroundProperty, transparentBrush, Avalonia.Data.BindingPriority.Style);
+ sideBarBackgroundSetter = sideBar.SetValue(BackgroundProperty, semiTransparentBrush, Avalonia.Data.BindingPriority.Style);
+ paneBackgroundSetter = sideBar.SetValue(SplitView.PaneBackgroundProperty, semiTransparentBrush, Avalonia.Data.BindingPriority.Style);
+ }
}
};
}
diff --git a/samples/ControlCatalog/MainWindow.xaml b/samples/ControlCatalog/MainWindow.xaml
index cebb3e0916..442c1d37b0 100644
--- a/samples/ControlCatalog/MainWindow.xaml
+++ b/samples/ControlCatalog/MainWindow.xaml
@@ -10,7 +10,6 @@
ExtendClientAreaToDecorationsHint="{Binding ExtendClientAreaEnabled}"
ExtendClientAreaChromeHints="{Binding ChromeHints}"
ExtendClientAreaTitleBarHeightHint="{Binding TitleBarHeight}"
- TransparencyLevelHint="{Binding TransparencyLevel}"
x:Name="MainWindow"
Background="Transparent"
x:Class="ControlCatalog.MainWindow" WindowState="{Binding WindowState, Mode=TwoWay}"
diff --git a/samples/ControlCatalog/Pages/DateTimePickerPage.xaml.cs b/samples/ControlCatalog/Pages/DateTimePickerPage.xaml.cs
index 11f504f4db..7520dabf37 100644
--- a/samples/ControlCatalog/Pages/DateTimePickerPage.xaml.cs
+++ b/samples/ControlCatalog/Pages/DateTimePickerPage.xaml.cs
@@ -17,7 +17,7 @@ namespace ControlCatalog.Pages
this.Get("TimePickerDesc").Text = "Use a TimePicker to let users set a time in your app, for example " +
"to set a reminder. The TimePicker displays three controls for hour, minute, and AM / PM(if necessary).These controls " +
"are easy to use with touch or mouse, and they can be styled and configured in several different ways. " +
- "12 - hour or 24 - hour clock and visiblility of AM / PM is dynamically set based on user time settings, or can be overridden.";
+ "12 - hour or 24 - hour clock and visibility of AM / PM is dynamically set based on user time settings, or can be overridden.";
}
diff --git a/samples/ControlCatalog/Pages/MenuPage.xaml.cs b/samples/ControlCatalog/Pages/MenuPage.xaml.cs
index 52c122f2bc..32cfa9b22b 100644
--- a/samples/ControlCatalog/Pages/MenuPage.xaml.cs
+++ b/samples/ControlCatalog/Pages/MenuPage.xaml.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Reactive;
using System.Threading.Tasks;
using System.Windows.Input;
using Avalonia.Controls;
diff --git a/samples/ControlCatalog/Pages/PointerCanvas.cs b/samples/ControlCatalog/Pages/PointerCanvas.cs
index 7d26da8603..da1ff5442d 100644
--- a/samples/ControlCatalog/Pages/PointerCanvas.cs
+++ b/samples/ControlCatalog/Pages/PointerCanvas.cs
@@ -24,7 +24,7 @@ public class PointerCanvas : Control
{
struct CanvasPoint
{
- public IBrush Brush;
+ public IBrush? Brush;
public Point Point;
public double Radius;
public double? Pressure;
diff --git a/samples/ControlCatalog/Pages/PointerContactsTab.cs b/samples/ControlCatalog/Pages/PointerContactsTab.cs
index b6aabebf99..1751b046c0 100644
--- a/samples/ControlCatalog/Pages/PointerContactsTab.cs
+++ b/samples/ControlCatalog/Pages/PointerContactsTab.cs
@@ -2,7 +2,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Reactive.Linq;
using Avalonia;
using Avalonia.Controls;
diff --git a/samples/ControlCatalog/Pages/ScreenPage.cs b/samples/ControlCatalog/Pages/ScreenPage.cs
index 6af4cf353e..b5b80fb147 100644
--- a/samples/ControlCatalog/Pages/ScreenPage.cs
+++ b/samples/ControlCatalog/Pages/ScreenPage.cs
@@ -36,44 +36,44 @@ namespace ControlCatalog.Pages
var drawBrush = Brushes.Black;
Pen p = new Pen(drawBrush);
- if (screens != null)
- foreach (Screen screen in screens)
+
+ foreach (Screen screen in screens)
+ {
+ if (screen.Bounds.X / 10f < _leftMost)
{
- if (screen.Bounds.X / 10f < _leftMost)
- {
- _leftMost = screen.Bounds.X / 10f;
- Dispatcher.UIThread.Post(InvalidateVisual, DispatcherPriority.Background);
- return;
- }
+ _leftMost = screen.Bounds.X / 10f;
+ Dispatcher.UIThread.Post(InvalidateVisual, DispatcherPriority.Background);
+ return;
+ }
- Rect boundsRect = new Rect(screen.Bounds.X / 10f + Math.Abs(_leftMost), screen.Bounds.Y / 10f, screen.Bounds.Width / 10f,
- screen.Bounds.Height / 10f);
- Rect workingAreaRect = new Rect(screen.WorkingArea.X / 10f + Math.Abs(_leftMost), screen.WorkingArea.Y / 10f, screen.WorkingArea.Width / 10f,
- screen.WorkingArea.Height / 10f);
-
- context.DrawRectangle(p, boundsRect);
- context.DrawRectangle(p, workingAreaRect);
+ Rect boundsRect = new Rect(screen.Bounds.X / 10f + Math.Abs(_leftMost), screen.Bounds.Y / 10f, screen.Bounds.Width / 10f,
+ screen.Bounds.Height / 10f);
+ Rect workingAreaRect = new Rect(screen.WorkingArea.X / 10f + Math.Abs(_leftMost), screen.WorkingArea.Y / 10f, screen.WorkingArea.Width / 10f,
+ screen.WorkingArea.Height / 10f);
+ context.DrawRectangle(p, boundsRect);
+ context.DrawRectangle(p, workingAreaRect);
- var formattedText = CreateFormattedText($"Bounds: {screen.Bounds.Width}:{screen.Bounds.Height}");
- context.DrawText(formattedText, boundsRect.Position.WithY(boundsRect.Size.Height));
- formattedText =
- CreateFormattedText($"WorkArea: {screen.WorkingArea.Width}:{screen.WorkingArea.Height}");
- context.DrawText(formattedText, boundsRect.Position.WithY(boundsRect.Size.Height + 20));
+ var formattedText = CreateFormattedText($"Bounds: {screen.Bounds.Width}:{screen.Bounds.Height}");
+ context.DrawText(formattedText, boundsRect.Position.WithY(boundsRect.Size.Height));
- formattedText = CreateFormattedText($"Scaling: {screen.Scaling * 100}%");
- context.DrawText(formattedText, boundsRect.Position.WithY(boundsRect.Size.Height + 40));
+ formattedText =
+ CreateFormattedText($"WorkArea: {screen.WorkingArea.Width}:{screen.WorkingArea.Height}");
+ context.DrawText(formattedText, boundsRect.Position.WithY(boundsRect.Size.Height + 20));
- formattedText = CreateFormattedText($"IsPrimary: {screen.IsPrimary}");
+ formattedText = CreateFormattedText($"Scaling: {screen.Scaling * 100}%");
+ context.DrawText(formattedText, boundsRect.Position.WithY(boundsRect.Size.Height + 40));
- context.DrawText(formattedText, boundsRect.Position.WithY(boundsRect.Size.Height + 60));
+ formattedText = CreateFormattedText($"IsPrimary: {screen.IsPrimary}");
- formattedText =
- CreateFormattedText(
- $"Current: {screen.Equals(w.Screens.ScreenFromBounds(new PixelRect(w.Position, PixelSize.FromSize(w.Bounds.Size, scaling))))}");
- context.DrawText(formattedText, boundsRect.Position.WithY(boundsRect.Size.Height + 80));
- }
+ context.DrawText(formattedText, boundsRect.Position.WithY(boundsRect.Size.Height + 60));
+
+ formattedText =
+ CreateFormattedText(
+ $"Current: {screen.Equals(w.Screens.ScreenFromBounds(new PixelRect(w.Position, PixelSize.FromSize(w.Bounds.Size, scaling))))}");
+ context.DrawText(formattedText, boundsRect.Position.WithY(boundsRect.Size.Height + 80));
+ }
context.DrawRectangle(p, new Rect(w.Position.X / 10f + Math.Abs(_leftMost), w.Position.Y / 10f, w.Bounds.Width / 10, w.Bounds.Height / 10));
}
diff --git a/samples/ControlCatalog/Pages/TabControlPage.xaml.cs b/samples/ControlCatalog/Pages/TabControlPage.xaml.cs
index 413b6e1c75..f3f4bf6e93 100644
--- a/samples/ControlCatalog/Pages/TabControlPage.xaml.cs
+++ b/samples/ControlCatalog/Pages/TabControlPage.xaml.cs
@@ -51,7 +51,7 @@ namespace ControlCatalog.Pages
private static IBitmap LoadBitmap(string uri)
{
- var assets = AvaloniaLocator.Current!.GetService()!;
+ var assets = AvaloniaLocator.Current.GetRequiredService();
return new Bitmap(assets.Open(new Uri(uri)));
}
}
diff --git a/samples/ControlCatalog/Pages/TextBoxPage.xaml b/samples/ControlCatalog/Pages/TextBoxPage.xaml
index 6a4d9b7d0e..7408399873 100644
--- a/samples/ControlCatalog/Pages/TextBoxPage.xaml
+++ b/samples/ControlCatalog/Pages/TextBoxPage.xaml
@@ -38,7 +38,7 @@
UseFloatingWatermark="True"
PasswordChar="*"
Text="Password" />
-
+
-
- None
- Transparent
- Blur
- AcrylicBlur
- Mica
-
diff --git a/samples/ControlCatalog/ViewModels/ComboBoxPageViewModel.cs b/samples/ControlCatalog/ViewModels/ComboBoxPageViewModel.cs
index bbe970afd6..d3e4ea7c31 100644
--- a/samples/ControlCatalog/ViewModels/ComboBoxPageViewModel.cs
+++ b/samples/ControlCatalog/ViewModels/ComboBoxPageViewModel.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
-using System.Reactive;
using Avalonia.Controls;
using Avalonia.Controls.Selection;
using MiniMvvm;
diff --git a/samples/ControlCatalog/ViewModels/ContextPageViewModel.cs b/samples/ControlCatalog/ViewModels/ContextPageViewModel.cs
index 4cfb00625e..f041f32b10 100644
--- a/samples/ControlCatalog/ViewModels/ContextPageViewModel.cs
+++ b/samples/ControlCatalog/ViewModels/ContextPageViewModel.cs
@@ -1,5 +1,4 @@
using System.Collections.Generic;
-using System.Reactive;
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.VisualTree;
@@ -56,12 +55,9 @@ namespace ControlCatalog.ViewModels
var result = await window.StorageProvider.OpenFilePickerAsync(new Avalonia.Platform.Storage.FilePickerOpenOptions() { AllowMultiple = true });
- if (result != null)
+ foreach (var file in result)
{
- foreach (var file in result)
- {
- System.Diagnostics.Debug.WriteLine($"Opened: {file.Name}");
- }
+ System.Diagnostics.Debug.WriteLine($"Opened: {file.Name}");
}
}
diff --git a/samples/ControlCatalog/ViewModels/CursorPageViewModel.cs b/samples/ControlCatalog/ViewModels/CursorPageViewModel.cs
index 8a3f0ba947..f44d927801 100644
--- a/samples/ControlCatalog/ViewModels/CursorPageViewModel.cs
+++ b/samples/ControlCatalog/ViewModels/CursorPageViewModel.cs
@@ -18,7 +18,7 @@ namespace ControlCatalog.ViewModels
.Select(x => new StandardCursorModel(x))
.ToList();
- var loader = AvaloniaLocator.Current!.GetService()!;
+ var loader = AvaloniaLocator.Current.GetRequiredService();
var s = loader.Open(new Uri("avares://ControlCatalog/Assets/avalonia-32.png"));
var bitmap = new Bitmap(s);
CustomCursor = new Cursor(bitmap, new PixelPoint(16, 16));
diff --git a/samples/ControlCatalog/ViewModels/ListBoxPageViewModel.cs b/samples/ControlCatalog/ViewModels/ListBoxPageViewModel.cs
index f89d9d1e20..7f32536b11 100644
--- a/samples/ControlCatalog/ViewModels/ListBoxPageViewModel.cs
+++ b/samples/ControlCatalog/ViewModels/ListBoxPageViewModel.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
-using System.Reactive;
using Avalonia.Controls;
using Avalonia.Controls.Selection;
using ControlCatalog.Pages;
diff --git a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs
index b79eff780c..3628a9b8a7 100644
--- a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs
+++ b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs
@@ -1,9 +1,9 @@
-using System.Reactive;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Controls.Notifications;
using Avalonia.Dialogs;
using Avalonia.Platform;
+using Avalonia.Reactive;
using System;
using System.ComponentModel.DataAnnotations;
using MiniMvvm;
@@ -12,12 +12,9 @@ namespace ControlCatalog.ViewModels
{
class MainWindowViewModel : ViewModelBase
{
- private IManagedNotificationManager _notificationManager;
-
private bool _isMenuItemChecked = true;
private WindowState _windowState;
private WindowState[] _windowStates = Array.Empty();
- private int _transparencyLevel;
private ExtendClientAreaChromeHints _chromeHints = ExtendClientAreaChromeHints.PreferSystemChrome;
private bool _extendClientAreaEnabled;
private bool _systemTitleBarEnabled;
@@ -77,12 +74,6 @@ namespace ControlCatalog.ViewModels
TitleBarHeight = -1;
}
- public int TransparencyLevel
- {
- get { return _transparencyLevel; }
- set { this.RaiseAndSetIfChanged(ref _transparencyLevel, value); }
- }
-
public ExtendClientAreaChromeHints ChromeHints
{
get { return _chromeHints; }
diff --git a/samples/ControlCatalog/ViewModels/MenuPageViewModel.cs b/samples/ControlCatalog/ViewModels/MenuPageViewModel.cs
index 16051c3c05..df62ba04cb 100644
--- a/samples/ControlCatalog/ViewModels/MenuPageViewModel.cs
+++ b/samples/ControlCatalog/ViewModels/MenuPageViewModel.cs
@@ -1,6 +1,4 @@
using System.Collections.Generic;
-using System.Reactive;
-using System.Reactive.Linq;
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.VisualTree;
diff --git a/samples/ControlCatalog/ViewModels/NotificationViewModel.cs b/samples/ControlCatalog/ViewModels/NotificationViewModel.cs
index a31f164a2a..bcbcb345ef 100644
--- a/samples/ControlCatalog/ViewModels/NotificationViewModel.cs
+++ b/samples/ControlCatalog/ViewModels/NotificationViewModel.cs
@@ -1,5 +1,4 @@
-using System.Reactive;
-using Avalonia.Controls.Notifications;
+using Avalonia.Controls.Notifications;
using MiniMvvm;
namespace ControlCatalog.ViewModels
diff --git a/samples/ControlCatalog/ViewModels/RefreshContainerViewModel.cs b/samples/ControlCatalog/ViewModels/RefreshContainerViewModel.cs
index d4b43043be..aa15d7758b 100644
--- a/samples/ControlCatalog/ViewModels/RefreshContainerViewModel.cs
+++ b/samples/ControlCatalog/ViewModels/RefreshContainerViewModel.cs
@@ -1,6 +1,5 @@
using System.Collections.ObjectModel;
using System.Linq;
-using System.Reactive;
using System.Threading.Tasks;
using Avalonia.Controls.Notifications;
using ControlCatalog.Pages;
diff --git a/samples/ControlCatalog/ViewModels/TransitioningContentControlPageViewModel.cs b/samples/ControlCatalog/ViewModels/TransitioningContentControlPageViewModel.cs
index 93857fd899..4505c11e95 100644
--- a/samples/ControlCatalog/ViewModels/TransitioningContentControlPageViewModel.cs
+++ b/samples/ControlCatalog/ViewModels/TransitioningContentControlPageViewModel.cs
@@ -19,7 +19,7 @@ namespace ControlCatalog.ViewModels
{
public TransitioningContentControlPageViewModel()
{
- var assetLoader = AvaloniaLocator.Current?.GetService()!;
+ var assetLoader = AvaloniaLocator.Current.GetRequiredService();
var images = new string[]
{
diff --git a/samples/ControlCatalog/ViewModels/TreeViewPageViewModel.cs b/samples/ControlCatalog/ViewModels/TreeViewPageViewModel.cs
index 80d4844f7a..7c0855e0af 100644
--- a/samples/ControlCatalog/ViewModels/TreeViewPageViewModel.cs
+++ b/samples/ControlCatalog/ViewModels/TreeViewPageViewModel.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
-using System.Reactive;
using Avalonia.Controls;
using MiniMvvm;
diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props
index 471c42ec07..3b14f0ce12 100644
--- a/samples/Directory.Build.props
+++ b/samples/Directory.Build.props
@@ -2,9 +2,8 @@
false
$(MSBuildThisFileDirectory)..\src\tools\Avalonia.Designer.HostApp\bin\Debug\netcoreapp2.0\Avalonia.Designer.HostApp.dll
+ false
+ 11
-
- false
-
diff --git a/samples/MiniMvvm/MiniMvvm.csproj b/samples/MiniMvvm/MiniMvvm.csproj
index 6535b2bdbd..2a9164624a 100644
--- a/samples/MiniMvvm/MiniMvvm.csproj
+++ b/samples/MiniMvvm/MiniMvvm.csproj
@@ -2,5 +2,7 @@
netstandard2.0
-
+
+
+
diff --git a/samples/MiniMvvm/PropertyChangedExtensions.cs b/samples/MiniMvvm/PropertyChangedExtensions.cs
index f1065c7530..f51773810d 100644
--- a/samples/MiniMvvm/PropertyChangedExtensions.cs
+++ b/samples/MiniMvvm/PropertyChangedExtensions.cs
@@ -1,8 +1,8 @@
using System;
using System.ComponentModel;
using System.Linq.Expressions;
-using System.Reactive.Linq;
using System.Reflection;
+using Avalonia.Reactive;
namespace MiniMvvm
{
@@ -92,11 +92,13 @@ namespace MiniMvvm
Expression> v3,
Func cb
) where TModel : INotifyPropertyChanged =>
- Observable.CombineLatest(
- model.WhenAnyValue(v1),
- model.WhenAnyValue(v2),
- model.WhenAnyValue(v3),
- cb);
+ model.WhenAnyValue(v1)
+ .CombineLatest(
+ model.WhenAnyValue(v2),
+ (l, r) => (l, r))
+ .CombineLatest(
+ model.WhenAnyValue(v3),
+ (t, r) => cb(t.l, t.r, r));
public static IObservable> WhenAnyValue(this TModel model,
Expression> v1,
diff --git a/samples/MiniMvvm/ViewModelBase.cs b/samples/MiniMvvm/ViewModelBase.cs
index 7256b05cef..8bc398607f 100644
--- a/samples/MiniMvvm/ViewModelBase.cs
+++ b/samples/MiniMvvm/ViewModelBase.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.ComponentModel;
-using System.Reactive.Joins;
using System.Runtime.CompilerServices;
namespace MiniMvvm
diff --git a/samples/PlatformSanityChecks/PlatformSanityChecks.csproj b/samples/PlatformSanityChecks/PlatformSanityChecks.csproj
index 5c743aabdb..5f61a08f3c 100644
--- a/samples/PlatformSanityChecks/PlatformSanityChecks.csproj
+++ b/samples/PlatformSanityChecks/PlatformSanityChecks.csproj
@@ -11,4 +11,5 @@
+
diff --git a/samples/Previewer/Previewer.csproj b/samples/Previewer/Previewer.csproj
index 2cc84168dc..76c1ba7b69 100644
--- a/samples/Previewer/Previewer.csproj
+++ b/samples/Previewer/Previewer.csproj
@@ -12,7 +12,8 @@
-
+
+
diff --git a/samples/ReactiveUIDemo/ReactiveUIDemo.csproj b/samples/ReactiveUIDemo/ReactiveUIDemo.csproj
index 94ca4ee809..9650068434 100644
--- a/samples/ReactiveUIDemo/ReactiveUIDemo.csproj
+++ b/samples/ReactiveUIDemo/ReactiveUIDemo.csproj
@@ -23,6 +23,5 @@
-
diff --git a/samples/interop/WindowsInteropTest/WindowsInteropTest.csproj b/samples/interop/WindowsInteropTest/WindowsInteropTest.csproj
index 223a53d8c5..1643ca3ee2 100644
--- a/samples/interop/WindowsInteropTest/WindowsInteropTest.csproj
+++ b/samples/interop/WindowsInteropTest/WindowsInteropTest.csproj
@@ -15,6 +15,4 @@
ControlCatalog
-
-
diff --git a/src/Android/Avalonia.Android/AndroidThreadingInterface.cs b/src/Android/Avalonia.Android/AndroidThreadingInterface.cs
index de9149e9a1..152076013f 100644
--- a/src/Android/Avalonia.Android/AndroidThreadingInterface.cs
+++ b/src/Android/Avalonia.Android/AndroidThreadingInterface.cs
@@ -1,10 +1,10 @@
using System;
-using System.Reactive.Disposables;
using System.Threading;
using Android.OS;
using Avalonia.Platform;
+using Avalonia.Reactive;
using Avalonia.Threading;
using App = Android.App.Application;
diff --git a/src/Android/Avalonia.Android/AvaloniaSplashActivity.cs b/src/Android/Avalonia.Android/AvaloniaSplashActivity.cs
index ec26ee5599..38038ef26c 100644
--- a/src/Android/Avalonia.Android/AvaloniaSplashActivity.cs
+++ b/src/Android/Avalonia.Android/AvaloniaSplashActivity.cs
@@ -1,6 +1,5 @@
using Android.OS;
using AndroidX.AppCompat.App;
-using Avalonia.Controls;
namespace Avalonia.Android
{
@@ -8,15 +7,22 @@ namespace Avalonia.Android
{
protected abstract AppBuilder CreateAppBuilder();
+ private static AppBuilder s_appBuilder;
+
protected override void OnCreate(Bundle? savedInstanceState)
{
base.OnCreate(savedInstanceState);
- var builder = CreateAppBuilder();
+ if (s_appBuilder == null)
+ {
+ var builder = CreateAppBuilder();
+
+ var lifetime = new SingleViewLifetime();
- var lifetime = new SingleViewLifetime();
+ builder.SetupWithLifetime(lifetime);
- builder.SetupWithLifetime(lifetime);
+ s_appBuilder = builder;
+ }
}
}
diff --git a/src/Android/Avalonia.Android/AvaloniaView.cs b/src/Android/Avalonia.Android/AvaloniaView.cs
index 5267843bfc..f7e32f99db 100644
--- a/src/Android/Avalonia.Android/AvaloniaView.cs
+++ b/src/Android/Avalonia.Android/AvaloniaView.cs
@@ -24,6 +24,8 @@ namespace Avalonia.Android
_root = new EmbeddableControlRoot(_view);
_root.Prepare();
+
+ this.SetBackgroundColor(global::Android.Graphics.Color.Transparent);
}
internal TopLevelImpl TopLevelImpl => _view;
diff --git a/src/Android/Avalonia.Android/ChoreographerTimer.cs b/src/Android/Avalonia.Android/ChoreographerTimer.cs
index 19dc7b4ab6..3545ae8fe1 100644
--- a/src/Android/Avalonia.Android/ChoreographerTimer.cs
+++ b/src/Android/Avalonia.Android/ChoreographerTimer.cs
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
-using System.Reactive.Disposables;
using System.Threading.Tasks;
using Android.OS;
using Android.Views;
+using Avalonia.Reactive;
using Avalonia.Rendering;
using Java.Lang;
diff --git a/src/Android/Avalonia.Android/Platform/SkiaPlatform/InvalidationAwareSurfaceView.cs b/src/Android/Avalonia.Android/Platform/SkiaPlatform/InvalidationAwareSurfaceView.cs
index 33501ece06..f205458f0e 100644
--- a/src/Android/Avalonia.Android/Platform/SkiaPlatform/InvalidationAwareSurfaceView.cs
+++ b/src/Android/Avalonia.Android/Platform/SkiaPlatform/InvalidationAwareSurfaceView.cs
@@ -22,6 +22,7 @@ namespace Avalonia.Android
public InvalidationAwareSurfaceView(Context context) : base(context)
{
Holder.AddCallback(this);
+ Holder.SetFormat(global::Android.Graphics.Format.Transparent);
_handler = new Handler(context.MainLooper);
}
diff --git a/src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs b/src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs
index 56dbadca03..1aac567dda 100644
--- a/src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs
+++ b/src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs
@@ -26,6 +26,7 @@ using Avalonia.Rendering.Composition;
using Java.Lang;
using Math = System.Math;
using AndroidRect = Android.Graphics.Rect;
+using Android.Graphics.Drawables;
namespace Avalonia.Android.Platform.SkiaPlatform
{
@@ -283,7 +284,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
public Action LostFocus { get; set; }
public Action TransparencyLevelChanged { get; set; }
- public WindowTransparencyLevel TransparencyLevel => WindowTransparencyLevel.None;
+ public WindowTransparencyLevel TransparencyLevel { get; private set; }
public AcrylicPlatformCompensationLevels AcrylicCompensationLevels => new AcrylicPlatformCompensationLevels(1, 1, 1);
@@ -301,7 +302,87 @@ namespace Avalonia.Android.Platform.SkiaPlatform
public void SetTransparencyLevelHint(WindowTransparencyLevel transparencyLevel)
{
- throw new NotImplementedException();
+ if (TransparencyLevel != transparencyLevel)
+ {
+ bool isBelowR = Build.VERSION.SdkInt < BuildVersionCodes.R;
+ bool isAboveR = Build.VERSION.SdkInt > BuildVersionCodes.R;
+ if (_view.Context is AvaloniaMainActivity activity)
+ {
+ switch (transparencyLevel)
+ {
+ case WindowTransparencyLevel.AcrylicBlur:
+ case WindowTransparencyLevel.ForceAcrylicBlur:
+ case WindowTransparencyLevel.Mica:
+ case WindowTransparencyLevel.None:
+ if (!isBelowR)
+ {
+ activity.SetTranslucent(false);
+ }
+ if (isAboveR)
+ {
+ activity.Window?.ClearFlags(WindowManagerFlags.BlurBehind);
+
+ var attr = activity.Window?.Attributes;
+ if (attr != null)
+ {
+ attr.BlurBehindRadius = 0;
+
+ activity.Window.Attributes = attr;
+ }
+ }
+ activity.Window.SetBackgroundDrawable(new ColorDrawable(Color.White));
+
+ if(transparencyLevel != WindowTransparencyLevel.None)
+ {
+ return;
+ }
+ break;
+ case WindowTransparencyLevel.Transparent:
+ if (!isBelowR)
+ {
+ activity.SetTranslucent(true);
+ }
+ if (isAboveR)
+ {
+ activity.Window?.ClearFlags(WindowManagerFlags.BlurBehind);
+
+ var attr = activity.Window?.Attributes;
+ if (attr != null)
+ {
+ attr.BlurBehindRadius = 0;
+
+ activity.Window.Attributes = attr;
+ }
+ }
+ activity.Window.SetBackgroundDrawable(new ColorDrawable(Color.Transparent));
+ break;
+ case WindowTransparencyLevel.Blur:
+ if (isAboveR)
+ {
+ activity.SetTranslucent(true);
+ activity.Window?.AddFlags(WindowManagerFlags.BlurBehind);
+
+ var attr = activity.Window?.Attributes;
+ if (attr != null)
+ {
+ attr.BlurBehindRadius = 120;
+
+ activity.Window.Attributes = attr;
+ }
+ activity.Window.SetBackgroundDrawable(new ColorDrawable(Color.Transparent));
+ }
+ else
+ {
+ activity.Window?.ClearFlags(WindowManagerFlags.BlurBehind);
+ activity.Window.SetBackgroundDrawable(new ColorDrawable(Color.White));
+
+ return;
+ }
+ break;
+ }
+ TransparencyLevel = transparencyLevel;
+ }
+ }
}
}
diff --git a/src/Android/Avalonia.Android/Platform/Specific/Helpers/AndroidMotionEventsHelper.cs b/src/Android/Avalonia.Android/Platform/Specific/Helpers/AndroidMotionEventsHelper.cs
index 6d0e6be0ad..3d0f3b2652 100644
--- a/src/Android/Avalonia.Android/Platform/Specific/Helpers/AndroidMotionEventsHelper.cs
+++ b/src/Android/Avalonia.Android/Platform/Specific/Helpers/AndroidMotionEventsHelper.cs
@@ -38,7 +38,7 @@ namespace Avalonia.Android.Platform.Specific.Helpers
return null;
}
- var eventTime = (ulong)DateTime.Now.Millisecond;
+ var eventTime = (ulong)e.EventTime;
var inputRoot = _view.InputRoot;
var actionMasked = e.ActionMasked;
var modifiers = GetModifiers(e.MetaState, e.ButtonState);
diff --git a/src/Avalonia.Base/Animation/Animation.cs b/src/Avalonia.Base/Animation/Animation.cs
index 06087cdd6a..d62acc0d52 100644
--- a/src/Avalonia.Base/Animation/Animation.cs
+++ b/src/Avalonia.Base/Animation/Animation.cs
@@ -2,8 +2,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
-using System.Reactive.Disposables;
-using System.Reactive.Linq;
+using Avalonia.Reactive;
using System.Threading;
using System.Threading.Tasks;
diff --git a/src/Avalonia.Base/Animation/AnimationInstance`1.cs b/src/Avalonia.Base/Animation/AnimationInstance`1.cs
index 6a6e69894b..682629c801 100644
--- a/src/Avalonia.Base/Animation/AnimationInstance`1.cs
+++ b/src/Avalonia.Base/Animation/AnimationInstance`1.cs
@@ -1,10 +1,8 @@
using System;
using System.Linq;
-using System.Reactive.Linq;
+using Avalonia.Reactive;
using Avalonia.Animation.Animators;
-using Avalonia.Animation.Utils;
using Avalonia.Data;
-using Avalonia.Reactive;
namespace Avalonia.Animation
{
diff --git a/src/Avalonia.Base/Animation/AnimatorKeyFrame.cs b/src/Avalonia.Base/Animation/AnimatorKeyFrame.cs
index 3168a67d79..dcce75b31c 100644
--- a/src/Avalonia.Base/Animation/AnimatorKeyFrame.cs
+++ b/src/Avalonia.Base/Animation/AnimatorKeyFrame.cs
@@ -63,7 +63,7 @@ namespace Avalonia.Animation
}
else
{
- return this.Bind(ValueProperty, ObservableEx.SingleValue(value).ToBinding(), targetControl);
+ return this.Bind(ValueProperty, Observable.SingleValue(value).ToBinding(), targetControl);
}
}
diff --git a/src/Avalonia.Base/Animation/Animators/Animator`1.cs b/src/Avalonia.Base/Animation/Animators/Animator`1.cs
index b5d1feb4a7..2db890bd0a 100644
--- a/src/Avalonia.Base/Animation/Animators/Animator`1.cs
+++ b/src/Avalonia.Base/Animation/Animators/Animator`1.cs
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Reactive.Disposables;
-using System.Reactive.Linq;
using Avalonia.Animation.Utils;
using Avalonia.Collections;
using Avalonia.Data;
diff --git a/src/Avalonia.Base/Animation/Animators/ColorAnimator.cs b/src/Avalonia.Base/Animation/Animators/ColorAnimator.cs
index 72add21d69..7be974b9e5 100644
--- a/src/Avalonia.Base/Animation/Animators/ColorAnimator.cs
+++ b/src/Avalonia.Base/Animation/Animators/ColorAnimator.cs
@@ -2,7 +2,7 @@
// and adopted from LottieSharp Project (https://github.com/ascora/LottieSharp).
using System;
-using System.Reactive.Disposables;
+using Avalonia.Reactive;
using Avalonia.Logging;
using Avalonia.Media;
diff --git a/src/Avalonia.Base/Animation/Animators/TransformAnimator.cs b/src/Avalonia.Base/Animation/Animators/TransformAnimator.cs
index e12ca722f9..8040fb595b 100644
--- a/src/Avalonia.Base/Animation/Animators/TransformAnimator.cs
+++ b/src/Avalonia.Base/Animation/Animators/TransformAnimator.cs
@@ -1,5 +1,5 @@
using System;
-using System.Reactive.Disposables;
+using Avalonia.Reactive;
using Avalonia.Logging;
using Avalonia.Media;
using Avalonia.Media.Transformation;
diff --git a/src/Avalonia.Base/Animation/Clock.cs b/src/Avalonia.Base/Animation/Clock.cs
index 5afd2ae705..f2bce9d3a5 100644
--- a/src/Avalonia.Base/Animation/Clock.cs
+++ b/src/Avalonia.Base/Animation/Clock.cs
@@ -1,4 +1,5 @@
using System;
+using Avalonia.Reactive;
namespace Avalonia.Animation
{
diff --git a/src/Avalonia.Base/Animation/CrossFade.cs b/src/Avalonia.Base/Animation/CrossFade.cs
index a229bc7ce6..640d6456a3 100644
--- a/src/Avalonia.Base/Animation/CrossFade.cs
+++ b/src/Avalonia.Base/Animation/CrossFade.cs
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
-using System.Reactive.Disposables;
+using Avalonia.Reactive;
using System.Threading;
using System.Threading.Tasks;
using Avalonia.Animation.Easings;
@@ -108,7 +108,7 @@ namespace Avalonia.Animation
}
var tasks = new List();
- using (var disposables = new CompositeDisposable())
+ using (var disposables = new CompositeDisposable(1))
{
if (to != null)
{
diff --git a/src/Avalonia.Base/Avalonia.Base.csproj b/src/Avalonia.Base/Avalonia.Base.csproj
index d6f1542687..cd122a8b67 100644
--- a/src/Avalonia.Base/Avalonia.Base.csproj
+++ b/src/Avalonia.Base/Avalonia.Base.csproj
@@ -14,7 +14,6 @@
-
@@ -37,6 +36,13 @@
+
+
+
+
+
+
+
@@ -48,8 +54,12 @@
+
+
+
+
diff --git a/src/Avalonia.Base/AvaloniaObject.cs b/src/Avalonia.Base/AvaloniaObject.cs
index a3a732428e..dc94dfba40 100644
--- a/src/Avalonia.Base/AvaloniaObject.cs
+++ b/src/Avalonia.Base/AvaloniaObject.cs
@@ -621,7 +621,7 @@ namespace Avalonia
/// The old property value.
/// The new property value.
/// The priority of the binding that produced the value.
- private protected void RaisePropertyChanged(
+ protected void RaisePropertyChanged(
DirectPropertyBase property,
Optional oldValue,
BindingValue newValue,
diff --git a/src/Avalonia.Base/AvaloniaObjectExtensions.cs b/src/Avalonia.Base/AvaloniaObjectExtensions.cs
index 867d6215a5..7b17b9152d 100644
--- a/src/Avalonia.Base/AvaloniaObjectExtensions.cs
+++ b/src/Avalonia.Base/AvaloniaObjectExtensions.cs
@@ -1,10 +1,6 @@
using System;
-using System.Reactive;
-using System.Reactive.Disposables;
-using System.Reactive.Linq;
-using System.Reactive.Subjects;
-using Avalonia.Data;
using Avalonia.Reactive;
+using Avalonia.Data;
namespace Avalonia
{
@@ -127,108 +123,6 @@ namespace Avalonia
property ?? throw new ArgumentNullException(nameof(property)));
}
- ///
- /// Gets a subject for an .
- ///
- /// The object.
- /// The property.
- ///
- /// The priority with which binding values are written to the object.
- ///
- ///
- /// An which can be used for two-way binding to/from the
- /// property.
- ///
- public static ISubject