diff --git a/.gitignore b/.gitignore
index d7c4cdefde..44fe5e4ba4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -192,7 +192,7 @@ dirs.sln
##################
-# XCode
+# Xcode
##################
Index/
Logs/
diff --git a/Avalonia.sln b/Avalonia.sln
index c4f64be109..a989fb828d 100644
--- a/Avalonia.sln
+++ b/Avalonia.sln
@@ -234,8 +234,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.PlatformSupport",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlCatalog.iOS", "samples\ControlCatalog.iOS\ControlCatalog.iOS.csproj", "{70B9F5CC-E2F9-4314-9514-EDE762ACCC4B}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlCatalog.iOS.Legacy", "samples\ControlCatalog.iOS.Legacy\ControlCatalog.iOS.Legacy.csproj", "{3AF75F00-B497-4517-9491-922173DE216E}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
@@ -2214,30 +2212,6 @@ Global
{70B9F5CC-E2F9-4314-9514-EDE762ACCC4B}.Release|iPhone.Build.0 = Release|Any CPU
{70B9F5CC-E2F9-4314-9514-EDE762ACCC4B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{70B9F5CC-E2F9-4314-9514-EDE762ACCC4B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.AppStore|Any CPU.Build.0 = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.AppStore|iPhone.Build.0 = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Debug|iPhone.Build.0 = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Release|Any CPU.Build.0 = Release|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Release|iPhone.ActiveCfg = Release|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Release|iPhone.Build.0 = Release|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {3AF75F00-B497-4517-9491-922173DE216E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -2302,7 +2276,6 @@ Global
{26A98DA1-D89D-4A95-8152-349F404DA2E2} = {A0CC0258-D18C-4AB3-854F-7101680FC3F9}
{A0D0A6A4-5C72-4ADA-9B27-621C7D94F270} = {9B9E3891-2366-4253-A952-D08BCEB71098}
{70B9F5CC-E2F9-4314-9514-EDE762ACCC4B} = {9B9E3891-2366-4253-A952-D08BCEB71098}
- {3AF75F00-B497-4517-9491-922173DE216E} = {9B9E3891-2366-4253-A952-D08BCEB71098}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {87366D66-1391-4D90-8999-95A620AD786A}
diff --git a/build/SharedVersion.props b/build/SharedVersion.props
index dad40cccb7..3d9548ab9d 100644
--- a/build/SharedVersion.props
+++ b/build/SharedVersion.props
@@ -11,7 +11,7 @@
latest
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.
+ 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.
avalonia;avaloniaui;mvvm;rx;reactive extensions;android;ios;mac;forms;wpf;net;netstandard;net461;uwp;xamarin
https://github.com/AvaloniaUI/Avalonia/releases
git
diff --git a/native/Avalonia.Native/src/OSX/window.mm b/native/Avalonia.Native/src/OSX/window.mm
index 1de82d9f39..9b703c4838 100644
--- a/native/Avalonia.Native/src/OSX/window.mm
+++ b/native/Avalonia.Native/src/OSX/window.mm
@@ -735,7 +735,7 @@ private:
return E_INVALIDARG;
// If one tries to show a child window with a minimized parent window, then the parent window will be
- // restored but MacOS isn't kind enough to *tell* us that, so the window will be left in a non-interactive
+ // restored but macOS isn't kind enough to *tell* us that, so the window will be left in a non-interactive
// state. Detect this and explicitly restore the parent window ourselves to avoid this situation.
if (cparent->WindowState() == Minimized)
cparent->SetWindowState(Normal);
diff --git a/readme.md b/readme.md
index 96c7937559..7e32dbc321 100644
--- a/readme.md
+++ b/readme.md
@@ -5,7 +5,7 @@
## 📖 About
-Avalonia is a cross-platform UI framework for dotnet, providing a flexible styling system and supporting a wide range of Operating Systems such as Windows, Linux, MacOs. Avalonia is mature and production ready. We also have in beta release support for iOS, Android and in early stages support for browser via WASM.
+Avalonia is a cross-platform UI framework for dotnet, providing a flexible styling system and supporting a wide range of Operating Systems such as Windows, Linux, macOS. Avalonia is mature and production ready. We also have in beta release support for iOS, Android and in early stages support for browser via WASM.

diff --git a/samples/ControlCatalog.iOS.Legacy/AppDelegate.cs b/samples/ControlCatalog.iOS.Legacy/AppDelegate.cs
deleted file mode 100644
index a67de98259..0000000000
--- a/samples/ControlCatalog.iOS.Legacy/AppDelegate.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using Avalonia.iOS;
-using Foundation;
-using UIKit;
-
-namespace ControlCatalog.iOS.Legacy
-{
- // The UIApplicationDelegate for the application. This class is responsible for launching the
- // User Interface of the application, as well as listening (and optionally responding) to
- // application events from iOS.
- [Register("AppDelegate")]
- public partial class AppDelegate : AvaloniaAppDelegate
- {
-
- }
-}
diff --git a/samples/ControlCatalog.iOS.Legacy/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/ControlCatalog.iOS.Legacy/Assets.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index 98f4d035c8..0000000000
--- a/samples/ControlCatalog.iOS.Legacy/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,117 +0,0 @@
-{
- "images": [
- {
- "scale": "2x",
- "size": "20x20",
- "idiom": "iphone",
- "filename": "Icon40.png"
- },
- {
- "scale": "3x",
- "size": "20x20",
- "idiom": "iphone",
- "filename": "Icon60.png"
- },
- {
- "scale": "2x",
- "size": "29x29",
- "idiom": "iphone",
- "filename": "Icon58.png"
- },
- {
- "scale": "3x",
- "size": "29x29",
- "idiom": "iphone",
- "filename": "Icon87.png"
- },
- {
- "scale": "2x",
- "size": "40x40",
- "idiom": "iphone",
- "filename": "Icon80.png"
- },
- {
- "scale": "3x",
- "size": "40x40",
- "idiom": "iphone",
- "filename": "Icon120.png"
- },
- {
- "scale": "2x",
- "size": "60x60",
- "idiom": "iphone",
- "filename": "Icon120.png"
- },
- {
- "scale": "3x",
- "size": "60x60",
- "idiom": "iphone",
- "filename": "Icon180.png"
- },
- {
- "scale": "1x",
- "size": "20x20",
- "idiom": "ipad",
- "filename": "Icon20.png"
- },
- {
- "scale": "2x",
- "size": "20x20",
- "idiom": "ipad",
- "filename": "Icon40.png"
- },
- {
- "scale": "1x",
- "size": "29x29",
- "idiom": "ipad",
- "filename": "Icon29.png"
- },
- {
- "scale": "2x",
- "size": "29x29",
- "idiom": "ipad",
- "filename": "Icon58.png"
- },
- {
- "scale": "1x",
- "size": "40x40",
- "idiom": "ipad",
- "filename": "Icon40.png"
- },
- {
- "scale": "2x",
- "size": "40x40",
- "idiom": "ipad",
- "filename": "Icon80.png"
- },
- {
- "scale": "1x",
- "size": "76x76",
- "idiom": "ipad",
- "filename": "Icon76.png"
- },
- {
- "scale": "2x",
- "size": "76x76",
- "idiom": "ipad",
- "filename": "Icon152.png"
- },
- {
- "scale": "2x",
- "size": "83.5x83.5",
- "idiom": "ipad",
- "filename": "Icon167.png"
- },
- {
- "scale": "1x",
- "size": "1024x1024",
- "idiom": "ios-marketing",
- "filename": "Icon1024.png"
- }
- ],
- "properties": {},
- "info": {
- "version": 1,
- "author": "xcode"
- }
-}
\ No newline at end of file
diff --git a/samples/ControlCatalog.iOS.Legacy/ControlCatalog.iOS.Legacy.csproj b/samples/ControlCatalog.iOS.Legacy/ControlCatalog.iOS.Legacy.csproj
deleted file mode 100644
index 045114ff5a..0000000000
--- a/samples/ControlCatalog.iOS.Legacy/ControlCatalog.iOS.Legacy.csproj
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
- xamarin.ios10
- 15.0
- true
- Debug
- iPhoneSimulator
- {3AF75F00-B497-4517-9491-922173DE216E}
- {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Exe
- ControlCatalog.iOS.Legacy
- Resources
- ControlCatalog.iOS.Legacy
- NSUrlSessionHandler
- manual
- -all
-
-
- true
- full
- false
- bin\iPhoneSimulator\Debug
- DEBUG
- prompt
- 4
- false
- x86_64
- None
- true
-
-
- none
- true
- bin\iPhoneSimulator\Release
- prompt
- 4
- None
- x86_64
- false
-
-
- true
- full
- false
- bin\iPhone\Debug
- DEBUG
- prompt
- 4
- false
- ARM64
- Entitlements.plist
- true
-
-
- none
- true
- bin\iPhone\Release
- prompt
- 4
- Entitlements.plist
- ARM64
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
-
-
-
-
-
-
-
- {d2221c82-4a25-4583-9b43-d791e3f6820c}
- Avalonia.Controls
-
-
- {4488ad85-1495-4809-9aa4-ddfe0a48527e}
- Avalonia.iOS
-
-
- {d0a739b9-3c68-4ba6-a328-41606954b6bd}
- ControlCatalog
-
-
-
-
-
-
diff --git a/samples/ControlCatalog.iOS.Legacy/Entitlements.plist b/samples/ControlCatalog.iOS.Legacy/Entitlements.plist
deleted file mode 100644
index 36a8706706..0000000000
--- a/samples/ControlCatalog.iOS.Legacy/Entitlements.plist
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/samples/ControlCatalog.iOS.Legacy/Info.plist b/samples/ControlCatalog.iOS.Legacy/Info.plist
deleted file mode 100644
index 430ffb3aca..0000000000
--- a/samples/ControlCatalog.iOS.Legacy/Info.plist
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
- CFBundleDisplayName
- ControlCatalog
- CFBundleIdentifier
- com.companyname.ControlCatalog.iOS
- CFBundleShortVersionString
- 1.0
- CFBundleVersion
- 1.0
- LSRequiresIPhoneOS
-
- MinimumOSVersion
- 15.0
- UIDeviceFamily
-
- 12
-
- UILaunchStoryboardName
- LaunchScreen
- UIRequiredDeviceCapabilities
-
- armv7
-
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UISupportedInterfaceOrientations~ipad
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- XSAppIconAssets
- Assets.xcassets/AppIcon.appiconset
- UIStatusBarHidden
-
- UIViewControllerBasedStatusBarAppearance
-
-
-
diff --git a/samples/ControlCatalog.iOS.Legacy/Main.cs b/samples/ControlCatalog.iOS.Legacy/Main.cs
deleted file mode 100644
index 08b3831d73..0000000000
--- a/samples/ControlCatalog.iOS.Legacy/Main.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using UIKit;
-
-namespace ControlCatalog.iOS.Legacy
-{
- public class Application
- {
- // This is the main entry point of the application.
- static void Main(string[] args)
- {
- // if you want to use a different Application Delegate class from "AppDelegate"
- // you can specify it here.
- UIApplication.Main(args, null, "AppDelegate");
- }
- }
-}
diff --git a/samples/ControlCatalog.iOS.Legacy/Resources/LaunchScreen.xib b/samples/ControlCatalog.iOS.Legacy/Resources/LaunchScreen.xib
deleted file mode 100644
index 3a3df8b38e..0000000000
--- a/samples/ControlCatalog.iOS.Legacy/Resources/LaunchScreen.xib
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/ControlCatalog.iOS/Info.plist b/samples/ControlCatalog.iOS/Info.plist
index d4b91b381e..6ffe3ba662 100644
--- a/samples/ControlCatalog.iOS/Info.plist
+++ b/samples/ControlCatalog.iOS/Info.plist
@@ -5,7 +5,7 @@
CFBundleDisplayName
ControlCatalog.iOS
CFBundleIdentifier
- com.companyname.ControlCatalog.iOS
+ Avalonia.ControlCatalog
CFBundleShortVersionString
1.0
CFBundleVersion
@@ -39,9 +39,9 @@
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
- UIStatusBarHidden
-
- UIViewControllerBasedStatusBarAppearance
-
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
diff --git a/samples/ControlCatalog/Pages/TextBoxPage.xaml b/samples/ControlCatalog/Pages/TextBoxPage.xaml
index f15ac8ffd6..dec5f74da8 100644
--- a/samples/ControlCatalog/Pages/TextBoxPage.xaml
+++ b/samples/ControlCatalog/Pages/TextBoxPage.xaml
@@ -18,7 +18,7 @@
-
+
diff --git a/samples/ControlCatalog/Pages/TextBoxPage.xaml.cs b/samples/ControlCatalog/Pages/TextBoxPage.xaml.cs
index 9eeefebb02..cd5f790312 100644
--- a/samples/ControlCatalog/Pages/TextBoxPage.xaml.cs
+++ b/samples/ControlCatalog/Pages/TextBoxPage.xaml.cs
@@ -13,12 +13,6 @@ namespace ControlCatalog.Pages
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
-
- this.Get("numericWatermark")
- .TextInputOptionsQuery += (s, a) =>
- {
- a.ContentType = Avalonia.Input.TextInput.TextInputContentType.Number;
- };
}
}
}
diff --git a/samples/RenderDemo/MainWindow.xaml b/samples/RenderDemo/MainWindow.xaml
index 4a8fb819ca..923b51814f 100644
--- a/samples/RenderDemo/MainWindow.xaml
+++ b/samples/RenderDemo/MainWindow.xaml
@@ -66,5 +66,8 @@
+
+
+
diff --git a/samples/RenderDemo/Pages/BrushesPage.axaml b/samples/RenderDemo/Pages/BrushesPage.axaml
new file mode 100644
index 0000000000..9d5b6ee987
--- /dev/null
+++ b/samples/RenderDemo/Pages/BrushesPage.axaml
@@ -0,0 +1,71 @@
+
+
+
diff --git a/samples/RenderDemo/Pages/BrushesPage.axaml.cs b/samples/RenderDemo/Pages/BrushesPage.axaml.cs
new file mode 100644
index 0000000000..5852b72d9e
--- /dev/null
+++ b/samples/RenderDemo/Pages/BrushesPage.axaml.cs
@@ -0,0 +1,18 @@
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace RenderDemo.Pages;
+
+public class BrushesPage : UserControl
+{
+ public BrushesPage()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+}
+
diff --git a/src/Android/Avalonia.Android/AndroidInputMethod.cs b/src/Android/Avalonia.Android/AndroidInputMethod.cs
index b6491a5890..880b210a6c 100644
--- a/src/Android/Avalonia.Android/AndroidInputMethod.cs
+++ b/src/Android/Avalonia.Android/AndroidInputMethod.cs
@@ -13,7 +13,6 @@ namespace Avalonia.Android
{
private readonly TView _host;
private readonly InputMethodManager _imm;
- private IInputElement _inputElement;
public AndroidInputMethod(TView host)
{
@@ -33,8 +32,10 @@ namespace Avalonia.Android
_imm.RestartInput(_host);
}
- public void SetActive(bool active)
+ public void SetClient(ITextInputMethodClient client)
{
+ var active = client is { };
+
if (active)
{
_host.RequestFocus();
@@ -49,20 +50,8 @@ namespace Avalonia.Android
{
}
- public void SetOptions(TextInputOptionsQueryEventArgs options)
+ public void SetOptions(TextInputOptions options)
{
- if (_inputElement != null)
- {
- _inputElement.PointerReleased -= RestoreSoftKeyboard;
- }
-
- _inputElement = options.Source as InputElement;
-
- if (_inputElement == null)
- {
- _imm.HideSoftInputFromWindow(_host.WindowToken, HideSoftInputFlags.None);
- }
-
_host.InitEditorInfo((outAttrs) =>
{
outAttrs.InputType = options.ContentType switch
@@ -70,7 +59,7 @@ namespace Avalonia.Android
TextInputContentType.Email => global::Android.Text.InputTypes.TextVariationEmailAddress,
TextInputContentType.Number => global::Android.Text.InputTypes.ClassNumber,
TextInputContentType.Password => global::Android.Text.InputTypes.TextVariationPassword,
- TextInputContentType.Phone => global::Android.Text.InputTypes.ClassPhone,
+ TextInputContentType.Digits => global::Android.Text.InputTypes.ClassPhone,
TextInputContentType.Url => global::Android.Text.InputTypes.TextVariationUri,
_ => global::Android.Text.InputTypes.ClassText
};
@@ -86,8 +75,6 @@ namespace Avalonia.Android
outAttrs.ImeOptions |= ImeFlags.NoFullscreen | ImeFlags.NoExtractUi;
});
-
- //_inputElement.PointerReleased += RestoreSoftKeyboard;
}
private void RestoreSoftKeyboard(object sender, PointerReleasedEventArgs e)
diff --git a/src/Avalonia.Build.Tasks/Avalonia.Build.Tasks.csproj b/src/Avalonia.Build.Tasks/Avalonia.Build.Tasks.csproj
index e864ea2007..5a7daa6d12 100644
--- a/src/Avalonia.Build.Tasks/Avalonia.Build.Tasks.csproj
+++ b/src/Avalonia.Build.Tasks/Avalonia.Build.Tasks.csproj
@@ -83,6 +83,9 @@
Markup/%(RecursiveDir)%(FileName)%(Extension)
+
+ Markup/%(RecursiveDir)%(FileName)%(Extension)
+
Markup/%(RecursiveDir)%(FileName)%(Extension)
diff --git a/src/Avalonia.Controls.DataGrid/ApiCompatBaseline.txt b/src/Avalonia.Controls.DataGrid/ApiCompatBaseline.txt
new file mode 100644
index 0000000000..fcc74cf864
--- /dev/null
+++ b/src/Avalonia.Controls.DataGrid/ApiCompatBaseline.txt
@@ -0,0 +1 @@
+Total Issues: 0
diff --git a/src/Avalonia.Controls/ApiCompatBaseline.txt b/src/Avalonia.Controls/ApiCompatBaseline.txt
index d28a0f21a5..dc7b70229a 100644
--- a/src/Avalonia.Controls/ApiCompatBaseline.txt
+++ b/src/Avalonia.Controls/ApiCompatBaseline.txt
@@ -30,6 +30,7 @@ MembersMustExist : Member 'public System.Double Avalonia.Controls.NumericUpDownV
MembersMustExist : Member 'public System.Double Avalonia.Controls.NumericUpDownValueChangedEventArgs.OldValue.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public Avalonia.StyledProperty Avalonia.StyledProperty Avalonia.Controls.ScrollViewer.AllowAutoHideProperty' does not exist in the implementation but it does exist in the contract.
CannotRemoveBaseTypeOrInterface : Type 'Avalonia.Controls.TopLevel' does not implement interface 'Avalonia.Utilities.IWeakSubscriber' in the implementation but it does in the contract.
+CannotRemoveBaseTypeOrInterface : Type 'Avalonia.Controls.Viewbox' does not inherit from base type 'Avalonia.Controls.Decorator' in the implementation but it does in the contract.
MembersMustExist : Member 'public Avalonia.AvaloniaProperty Avalonia.AvaloniaProperty Avalonia.Controls.Viewbox.StretchProperty' does not exist in the implementation but it does exist in the contract.
CannotRemoveBaseTypeOrInterface : Type 'Avalonia.Controls.Window' does not implement interface 'Avalonia.Utilities.IWeakSubscriber' in the implementation but it does in the contract.
CannotRemoveBaseTypeOrInterface : Type 'Avalonia.Controls.WindowBase' does not implement interface 'Avalonia.Utilities.IWeakSubscriber' in the implementation but it does in the contract.
@@ -71,5 +72,6 @@ InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Platfor
MembersMustExist : Member 'public void Avalonia.Platform.IWindowImpl.Resize(Avalonia.Size)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Platform.IWindowImpl.Resize(Avalonia.Size, Avalonia.Platform.PlatformResizeReason)' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Platform.ITrayIconImpl Avalonia.Platform.IWindowingPlatform.CreateTrayIcon()' is present in the implementation but not in the contract.
+Total Issues: 70
Total Issues: 69
Total Issues: 66
diff --git a/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositioner.cs b/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositioner.cs
index 0f0dd7311d..a80a60350e 100644
--- a/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositioner.cs
+++ b/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositioner.cs
@@ -106,9 +106,9 @@ namespace Avalonia.Controls.Primitives.PopupPositioning
{
var screens = _popup.Screens;
- var targetScreen = screens.FirstOrDefault(s => s.Bounds.Contains(anchorRect.TopLeft))
+ var targetScreen = screens.FirstOrDefault(s => s.Bounds.ContainsExclusive(anchorRect.TopLeft))
?? screens.FirstOrDefault(s => s.Bounds.Intersects(anchorRect))
- ?? screens.FirstOrDefault(s => s.Bounds.Contains(parentGeometry.TopLeft))
+ ?? screens.FirstOrDefault(s => s.Bounds.ContainsExclusive(parentGeometry.TopLeft))
?? screens.FirstOrDefault(s => s.Bounds.Intersects(parentGeometry))
?? screens.FirstOrDefault();
diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs
index 995ec142a5..4d71717776 100644
--- a/src/Avalonia.Controls/TextBox.cs
+++ b/src/Avalonia.Controls/TextBox.cs
@@ -202,7 +202,10 @@ namespace Avalonia.Controls
FocusableProperty.OverrideDefaultValue(typeof(TextBox), true);
TextInputMethodClientRequestedEvent.AddClassHandler((tb, e) =>
{
- e.Client = tb._imClient;
+ if (!tb.IsReadOnly)
+ {
+ e.Client = tb._imClient;
+ }
});
}
diff --git a/src/Avalonia.Controls/Viewbox.cs b/src/Avalonia.Controls/Viewbox.cs
index 624c61bb82..50b9560cac 100644
--- a/src/Avalonia.Controls/Viewbox.cs
+++ b/src/Avalonia.Controls/Viewbox.cs
@@ -1,13 +1,15 @@
using Avalonia.Media;
+using Avalonia.Metadata;
namespace Avalonia.Controls
{
///
/// Viewbox is used to scale single child to fit in the available space.
///
- ///
- public class Viewbox : Decorator
+ public class Viewbox : Control
{
+ private Decorator _containerVisual;
+
///
/// Defines the property.
///
@@ -20,12 +22,27 @@ namespace Avalonia.Controls
public static readonly StyledProperty StretchDirectionProperty =
AvaloniaProperty.Register(nameof(StretchDirection), StretchDirection.Both);
+ ///
+ /// Defines the property
+ ///
+ public static readonly StyledProperty ChildProperty =
+ Decorator.ChildProperty.AddOwner();
+
static Viewbox()
{
ClipToBoundsProperty.OverrideDefaultValue(true);
+ UseLayoutRoundingProperty.OverrideDefaultValue(true);
AffectsMeasure(StretchProperty, StretchDirectionProperty);
}
+ public Viewbox()
+ {
+ _containerVisual = new Decorator();
+ _containerVisual.RenderTransformOrigin = RelativePoint.TopLeft;
+ LogicalChildren.Add(_containerVisual);
+ VisualChildren.Add(_containerVisual);
+ }
+
///
/// Gets or sets the stretch mode,
/// which determines how child fits into the available space.
@@ -45,9 +62,40 @@ namespace Avalonia.Controls
set => SetValue(StretchDirectionProperty, value);
}
+ ///
+ /// Gets or sets the child of the Viewbox
+ ///
+ [Content]
+ public IControl? Child
+ {
+ get => GetValue(ChildProperty);
+ set => SetValue(ChildProperty, value);
+ }
+
+ ///
+ /// Gets or sets the transform applied to the container visual that
+ /// hosts the child of the Viewbox
+ ///
+ protected internal ITransform? InternalTransform
+ {
+ get => _containerVisual.RenderTransform;
+ set => _containerVisual.RenderTransform = value;
+ }
+
+ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
+ {
+ base.OnPropertyChanged(change);
+
+ if (change.Property == ChildProperty)
+ {
+ _containerVisual.Child = change.NewValue.GetValueOrDefault();
+ InvalidateMeasure();
+ }
+ }
+
protected override Size MeasureOverride(Size availableSize)
{
- var child = Child;
+ var child = _containerVisual;
if (child != null)
{
@@ -57,7 +105,7 @@ namespace Avalonia.Controls
var size = Stretch.CalculateSize(availableSize, childSize, StretchDirection);
- return size.Constrain(availableSize);
+ return size;
}
return new Size();
@@ -65,31 +113,21 @@ namespace Avalonia.Controls
protected override Size ArrangeOverride(Size finalSize)
{
- var child = Child;
+ var child = _containerVisual;
if (child != null)
{
var childSize = child.DesiredSize;
var scale = Stretch.CalculateScaling(finalSize, childSize, StretchDirection);
- // TODO: Viewbox should have another decorator as a child so we won't affect other render transforms.
- var scaleTransform = child.RenderTransform as ScaleTransform;
-
- if (scaleTransform == null)
- {
- child.RenderTransform = scaleTransform = new ScaleTransform(scale.X, scale.Y);
- child.RenderTransformOrigin = RelativePoint.TopLeft;
- }
-
- scaleTransform.ScaleX = scale.X;
- scaleTransform.ScaleY = scale.Y;
+ InternalTransform = new ScaleTransform(scale.X, scale.Y);
child.Arrange(new Rect(childSize));
return childSize * scale;
}
- return new Size();
+ return finalSize;
}
}
}
diff --git a/src/Avalonia.DesignerSupport/ApiCompatBaseline.txt b/src/Avalonia.DesignerSupport/ApiCompatBaseline.txt
new file mode 100644
index 0000000000..fcc74cf864
--- /dev/null
+++ b/src/Avalonia.DesignerSupport/ApiCompatBaseline.txt
@@ -0,0 +1 @@
+Total Issues: 0
diff --git a/src/Avalonia.DesignerSupport/Remote/HtmlTransport/webapp/src/index.html b/src/Avalonia.DesignerSupport/Remote/HtmlTransport/webapp/src/index.html
index f5847cdd58..cf76de0077 100644
--- a/src/Avalonia.DesignerSupport/Remote/HtmlTransport/webapp/src/index.html
+++ b/src/Avalonia.DesignerSupport/Remote/HtmlTransport/webapp/src/index.html
@@ -9,6 +9,6 @@
Loading...
-
+