From 1aa50361bb1a27821a407a26df8f4216cdad00c4 Mon Sep 17 00:00:00 2001 From: bmello4688 Date: Tue, 20 Oct 2020 08:55:17 -0400 Subject: [PATCH 1/8] add XmlnsPrefix which is in WPF --- .../Metadata/XmlnsPrefixAttribute.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/Avalonia.Base/Metadata/XmlnsPrefixAttribute.cs diff --git a/src/Avalonia.Base/Metadata/XmlnsPrefixAttribute.cs b/src/Avalonia.Base/Metadata/XmlnsPrefixAttribute.cs new file mode 100644 index 0000000000..0f091d540a --- /dev/null +++ b/src/Avalonia.Base/Metadata/XmlnsPrefixAttribute.cs @@ -0,0 +1,30 @@ +using System; + +namespace Avalonia.Metadata +{ + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class XmlnsPrefixAttribute : Attribute + { + /// + /// Constructor + /// + /// XML namespce + /// recommended prefix + public XmlnsPrefixAttribute(string xmlNamespace, string prefix) + { + XmlNamespace = xmlNamespace ?? throw new ArgumentNullException(nameof(xmlNamespace)); + + Prefix = prefix ?? throw new ArgumentNullException(nameof(prefix)); + } + + /// + /// XML Namespace + /// + public string XmlNamespace { get; } + + /// + /// New Xml Namespace + /// + public string Prefix { get; } + } +} From e80e413cf001bd77bec30688ae2c56c1c5aa2d6b Mon Sep 17 00:00:00 2001 From: bmello4688 Date: Wed, 21 Oct 2020 19:56:18 -0400 Subject: [PATCH 2/8] Add sumary and remark to class header --- src/Avalonia.Base/Metadata/XmlnsPrefixAttribute.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Avalonia.Base/Metadata/XmlnsPrefixAttribute.cs b/src/Avalonia.Base/Metadata/XmlnsPrefixAttribute.cs index 0f091d540a..ad017822e4 100644 --- a/src/Avalonia.Base/Metadata/XmlnsPrefixAttribute.cs +++ b/src/Avalonia.Base/Metadata/XmlnsPrefixAttribute.cs @@ -2,6 +2,15 @@ namespace Avalonia.Metadata { + /// + /// Use to predefine the prefix associated to an xml namespace in a xaml file + /// + /// + /// example: + /// [assembly: XmlnsPrefix("https://github.com/avaloniaui", "av")] + /// xaml: + /// xmlns:av="https://github.com/avaloniaui" + /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class XmlnsPrefixAttribute : Attribute { From 63d5ff3e2f9b871eda6adf6928997068f52a500a Mon Sep 17 00:00:00 2001 From: Andrey Kunchev Date: Thu, 22 Oct 2020 11:56:54 +0300 Subject: [PATCH 3/8] fix nuget package build --- build/SharedVersion.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/SharedVersion.props b/build/SharedVersion.props index d1e9f7b751..95556af160 100644 --- a/build/SharedVersion.props +++ b/build/SharedVersion.props @@ -20,6 +20,6 @@ - + From e39cc76cd55495eadafedbacb62b20b24df7d338 Mon Sep 17 00:00:00 2001 From: Dariusz Komosinski Date: Thu, 22 Oct 2020 13:34:01 +0200 Subject: [PATCH 4/8] Update readme to include info about Rider preview builds. --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index ccdbbfb967..726a634e1a 100644 --- a/readme.md +++ b/readme.md @@ -39,7 +39,7 @@ Examples of UIs built with Avalonia ## JetBrains Rider -If you need to develop Avalonia app with JetBrains Rider, go and *vote* on [this issue](https://youtrack.jetbrains.com/issue/RIDER-39247) in their tracker. JetBrains won't do things without their users telling them that they want the feature, so only **YOU** can make it happen. +If you need to develop Avalonia app with JetBrains Rider you can use latest Rider [preview builds](https://www.jetbrains.com/rider/nextversion/). ## Bleeding Edge Builds From a23b4bd97f851672214e19ce9e24582d5e18cf9c Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 22 Oct 2020 13:45:02 +0100 Subject: [PATCH 5/8] dont raise events when window isnt shown. --- src/Avalonia.Native/WindowImplBase.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Avalonia.Native/WindowImplBase.cs b/src/Avalonia.Native/WindowImplBase.cs index 5d35c773d7..127fd9dde4 100644 --- a/src/Avalonia.Native/WindowImplBase.cs +++ b/src/Avalonia.Native/WindowImplBase.cs @@ -251,6 +251,11 @@ namespace Avalonia.Native public bool RawTextInputEvent(uint timeStamp, string text) { + if (_inputRoot is null) + { + return false; + } + Dispatcher.UIThread.RunJobs(DispatcherPriority.Input + 1); var args = new RawTextInputEventArgs(_keyboard, timeStamp, _inputRoot, text); @@ -262,6 +267,11 @@ namespace Avalonia.Native public bool RawKeyEvent(AvnRawKeyEventType type, uint timeStamp, AvnInputModifiers modifiers, uint key) { + if (_inputRoot is null) + { + return false; + } + Dispatcher.UIThread.RunJobs(DispatcherPriority.Input + 1); var args = new RawKeyEventArgs(_keyboard, timeStamp, _inputRoot, (RawKeyEventType)type, (Key)key, (RawInputModifiers)modifiers); @@ -278,6 +288,11 @@ namespace Avalonia.Native public void RawMouseEvent(AvnRawMouseEventType type, uint timeStamp, AvnInputModifiers modifiers, AvnPoint point, AvnVector delta) { + if (_inputRoot is null) + { + return; + } + Dispatcher.UIThread.RunJobs(DispatcherPriority.Input + 1); switch (type) From f8eaca28e896462a6a5721a9be387385d85d2e51 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 22 Oct 2020 13:53:11 +0100 Subject: [PATCH 6/8] save some lines. --- src/Avalonia.Native/WindowImplBase.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Avalonia.Native/WindowImplBase.cs b/src/Avalonia.Native/WindowImplBase.cs index 127fd9dde4..824f62aee5 100644 --- a/src/Avalonia.Native/WindowImplBase.cs +++ b/src/Avalonia.Native/WindowImplBase.cs @@ -251,10 +251,8 @@ namespace Avalonia.Native public bool RawTextInputEvent(uint timeStamp, string text) { - if (_inputRoot is null) - { + if (_inputRoot is null) return false; - } Dispatcher.UIThread.RunJobs(DispatcherPriority.Input + 1); @@ -267,10 +265,8 @@ namespace Avalonia.Native public bool RawKeyEvent(AvnRawKeyEventType type, uint timeStamp, AvnInputModifiers modifiers, uint key) { - if (_inputRoot is null) - { + if (_inputRoot is null) return false; - } Dispatcher.UIThread.RunJobs(DispatcherPriority.Input + 1); @@ -288,10 +284,8 @@ namespace Avalonia.Native public void RawMouseEvent(AvnRawMouseEventType type, uint timeStamp, AvnInputModifiers modifiers, AvnPoint point, AvnVector delta) { - if (_inputRoot is null) - { + if (_inputRoot is null) return; - } Dispatcher.UIThread.RunJobs(DispatcherPriority.Input + 1); From 386f51a6a32e9724978ebedd80902ad505867d34 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 22 Oct 2020 16:50:41 +0100 Subject: [PATCH 7/8] dont sign assemblies for now. --- build/SharedVersion.props | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/SharedVersion.props b/build/SharedVersion.props index 95556af160..240300b7e5 100644 --- a/build/SharedVersion.props +++ b/build/SharedVersion.props @@ -15,8 +15,7 @@ avalonia;avaloniaui;mvvm;rx;reactive extensions;android;ios;mac;forms;wpf;net;netstandard;net461;uwp;xamarin https://github.com/AvaloniaUI/Avalonia/releases git - $(MSBuildThisFileDirectory)\avalonia.snk - True + $(MSBuildThisFileDirectory)\avalonia.snk From 5feee900d4bdd0ca8da07acad168ff264d1a4b64 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 22 Oct 2020 18:03:58 +0100 Subject: [PATCH 8/8] Revert "dont sign assemblies for now." This reverts commit 386f51a6a32e9724978ebedd80902ad505867d34. --- build/SharedVersion.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/SharedVersion.props b/build/SharedVersion.props index 240300b7e5..95556af160 100644 --- a/build/SharedVersion.props +++ b/build/SharedVersion.props @@ -15,7 +15,8 @@ avalonia;avaloniaui;mvvm;rx;reactive extensions;android;ios;mac;forms;wpf;net;netstandard;net461;uwp;xamarin https://github.com/AvaloniaUI/Avalonia/releases git - $(MSBuildThisFileDirectory)\avalonia.snk + $(MSBuildThisFileDirectory)\avalonia.snk + True