diff --git a/src/Uno.UI/UI/Xaml/Documents/Hyperlink.cs b/src/Uno.UI/UI/Xaml/Documents/Hyperlink.cs index 27e5fcb63918..59ba70f32167 100644 --- a/src/Uno.UI/UI/Xaml/Documents/Hyperlink.cs +++ b/src/Uno.UI/UI/Xaml/Documents/Hyperlink.cs @@ -17,8 +17,10 @@ namespace Windows.UI.Xaml.Documents { public sealed partial class Hyperlink : Span - { + { +#pragma warning disable CS0649 // error CS0649: Field '_focusableHelper' is never assigned to, and will always have its default value null private readonly IFocusable _focusableHelper; +#pragma warning restore CS0649 // error CS0649: Field '_focusableHelper' is never assigned to, and will always have its default value null #region Static private static Brush _defaultForeground; diff --git a/src/Uno.UI/UI/Xaml/Documents/Hyperlink.mux.cs b/src/Uno.UI/UI/Xaml/Documents/Hyperlink.mux.cs index c03a39006f55..cee89eebc6cf 100644 --- a/src/Uno.UI/UI/Xaml/Documents/Hyperlink.mux.cs +++ b/src/Uno.UI/UI/Xaml/Documents/Hyperlink.mux.cs @@ -10,7 +10,7 @@ namespace Windows.UI.Xaml.Documents { public partial class Hyperlink { - internal bool IsFocusable() + internal new bool IsFocusable() { var element = GetContainingFrameworkElement(); return diff --git a/src/Uno.UI/UI/Xaml/DragDrop/DragDropExtension.wasm.cs b/src/Uno.UI/UI/Xaml/DragDrop/DragDropExtension.wasm.cs index 88741ba2d5f3..041468fee513 100644 --- a/src/Uno.UI/UI/Xaml/DragDrop/DragDropExtension.wasm.cs +++ b/src/Uno.UI/UI/Xaml/DragDrop/DragDropExtension.wasm.cs @@ -477,6 +477,7 @@ IEnumerable GetModifiers(DragDropExtensionEventArgs that) [DataContract] private struct DataEntry { +#pragma warning disable CS0649 // error CS0649: Field 'DragDropExtension.DataEntry.kind' is never assigned to, and will always have its default value null [DataMember] public int id; @@ -485,6 +486,7 @@ private struct DataEntry [DataMember] public string type; +#pragma warning restore CS0649 // error CS0649: Field 'DragDropExtension.DataEntry.kind' is never assigned to, and will always have its default value null /// public override string ToString() diff --git a/src/Uno.UI/UI/Xaml/FontFamily.wasm.cs b/src/Uno.UI/UI/Xaml/FontFamily.wasm.cs index a27226061d8a..720842c25d8f 100644 --- a/src/Uno.UI/UI/Xaml/FontFamily.wasm.cs +++ b/src/Uno.UI/UI/Xaml/FontFamily.wasm.cs @@ -61,7 +61,7 @@ private static bool TryGetExternalUri(string? source, out Uri? uri) if (!uri.IsAbsoluteUri || source.StartsWith("/")) { // Support for implicit ms-appx resolution - var assetUri = AssetsPathBuilder.BuildAssetUri(Uri.EscapeUriString(source.TrimStart('/'))); + var assetUri = AssetsPathBuilder.BuildAssetUri(Uri.EscapeDataString(source.TrimStart('/'))); uri = new Uri(assetUri, UriKind.RelativeOrAbsolute); } diff --git a/src/Uno.UI/UI/Xaml/FrameworkElement.Interface.wasm.cs b/src/Uno.UI/UI/Xaml/FrameworkElement.Interface.wasm.cs index be4fdc0f98eb..2dce624a70c6 100644 --- a/src/Uno.UI/UI/Xaml/FrameworkElement.Interface.wasm.cs +++ b/src/Uno.UI/UI/Xaml/FrameworkElement.Interface.wasm.cs @@ -63,8 +63,8 @@ public FrameworkElement(string htmlTag, bool isSvg) : base(htmlTag, isSvg) _logDebug = _log.IsEnabled(LogLevel.Debug) ? _log : null; } - private protected readonly Logger _log; - private protected readonly Logger _logDebug; + private new protected readonly Logger _log; + private new protected readonly Logger _logDebug; private static readonly Uri DefaultBaseUri = new Uri("ms-appx://local"); public global::System.Uri BaseUri { get; internal set; } = DefaultBaseUri; diff --git a/src/Uno.UI/UI/Xaml/IFrameworkElement.cs b/src/Uno.UI/UI/Xaml/IFrameworkElement.cs index de22eba152ed..6f174f44886d 100644 --- a/src/Uno.UI/UI/Xaml/IFrameworkElement.cs +++ b/src/Uno.UI/UI/Xaml/IFrameworkElement.cs @@ -47,6 +47,7 @@ using ObjCRuntime; #endif #elif __WASM__ +#pragma warning disable CS8981 // The type name 'nint' only contains lower-cased ascii characters. Such names may become reserved for the language using nint = System.Int32; using nfloat = System.Double; using Point = Windows.Foundation.Point; diff --git a/src/Uno.UI/UI/Xaml/UIElement.Pointers.wasm.cs b/src/Uno.UI/UI/Xaml/UIElement.Pointers.wasm.cs index 885f202b2138..17cc9d9c12cd 100644 --- a/src/Uno.UI/UI/Xaml/UIElement.Pointers.wasm.cs +++ b/src/Uno.UI/UI/Xaml/UIElement.Pointers.wasm.cs @@ -328,7 +328,7 @@ private static PointerRoutedEventArgs ToPointerArgs( } #endregion - partial void OnManipulationModeChanged(ManipulationModes _, ManipulationModes newMode) + partial void OnManipulationModeChanged(ManipulationModes oldMode, ManipulationModes newMode) { if (newMode is ManipulationModes.None or ManipulationModes.System) { diff --git a/src/Uno.UI/UI/Xaml/UIElement.wasm.cs b/src/Uno.UI/UI/Xaml/UIElement.wasm.cs index c792165b0f99..3bc0df2975cf 100644 --- a/src/Uno.UI/UI/Xaml/UIElement.wasm.cs +++ b/src/Uno.UI/UI/Xaml/UIElement.wasm.cs @@ -406,12 +406,12 @@ public Rect Arranged public Func DesiredSizeSelector { get; set; } - partial void OnVisibilityChangedPartial(Visibility oldValue, Visibility newVisibility) + partial void OnVisibilityChangedPartial(Visibility oldValue, Visibility newValue) { InvalidateMeasure(); UpdateHitTest(); - WindowManagerInterop.SetVisibility(HtmlId, newVisibility == Visibility.Visible); + WindowManagerInterop.SetVisibility(HtmlId, newValue == Visibility.Visible); if (FeatureConfiguration.UIElement.AssignDOMXamlProperties) { diff --git a/src/Uno.UI/UI/Xaml/VisualStateManager.wasm.cs b/src/Uno.UI/UI/Xaml/VisualStateManager.wasm.cs index 048d05192f33..591d996218c7 100644 --- a/src/Uno.UI/UI/Xaml/VisualStateManager.wasm.cs +++ b/src/Uno.UI/UI/Xaml/VisualStateManager.wasm.cs @@ -18,7 +18,7 @@ private static void TryAssignDOMVisualStates(IList groups, IFr if (Uno.UI.FeatureConfiguration.UIElement.AssignDOMXamlProperties) { var sb = new StringBuilder(); - sb.Append("["); + sb.Append('['); foreach (var group in groups) { sb.Append($"{group}: {group.CurrentState}, "); diff --git a/src/Uno.UI/Uno.UI.Wasm.csproj b/src/Uno.UI/Uno.UI.Wasm.csproj index 551baec0a0db..c22d285a473c 100644 --- a/src/Uno.UI/Uno.UI.Wasm.csproj +++ b/src/Uno.UI/Uno.UI.Wasm.csproj @@ -16,6 +16,7 @@ Uno.UI Uno.UI true + true $(MSBuildThisFileDirectory)tsBindings Uno;Uno.UI diff --git a/src/Uno.UWP/Collections/HashtableEx.cs b/src/Uno.UWP/Collections/HashtableEx.cs index ed4733f1a3b9..3621ef9fbe5b 100644 --- a/src/Uno.UWP/Collections/HashtableEx.cs +++ b/src/Uno.UWP/Collections/HashtableEx.cs @@ -1,4 +1,6 @@ -#nullable enable +#pragma warning disable CS8981 + +#nullable enable // Based on https://github.com/dotnet/runtime/commit/bdc8e420aa75999021e06b85e2e1869962730a0f // Licensed to the .NET Foundation under one or more agreements. diff --git a/src/Uno.UWP/UI/Input/GestureRecognizer.Manipulation.InertiaProcessor.cs b/src/Uno.UWP/UI/Input/GestureRecognizer.Manipulation.InertiaProcessor.cs index 7903cc830219..3badf5bff936 100644 --- a/src/Uno.UWP/UI/Input/GestureRecognizer.Manipulation.InertiaProcessor.cs +++ b/src/Uno.UWP/UI/Input/GestureRecognizer.Manipulation.InertiaProcessor.cs @@ -54,10 +54,10 @@ public InertiaProcessor(Manipulation owner, Point position, ManipulationDelta cu _isTranslateInertiaXEnabled = _owner._isTranslateXEnabled && _owner._settings.HasFlag(Input.GestureSettings.ManipulationTranslateInertia) - && Abs(velocities.Linear.X) > _owner._inertiaThresholds.TranslateX; + && Math.Abs(velocities.Linear.X) > _owner._inertiaThresholds.TranslateX; _isTranslateInertiaYEnabled = _owner._isTranslateYEnabled && _owner._settings.HasFlag(Input.GestureSettings.ManipulationTranslateInertia) - && Abs(velocities.Linear.Y) > _owner._inertiaThresholds.TranslateY; + && Math.Abs(velocities.Linear.Y) > _owner._inertiaThresholds.TranslateY; _isRotateInertiaEnabled = _owner._isRotateEnabled && _owner._settings.HasFlag(Input.GestureSettings.ManipulationRotateInertia) && Abs(velocities.Angular) > _owner._inertiaThresholds.Rotate; @@ -93,7 +93,7 @@ public void Start() // As of 2021-07-21, according to test, Displacement takes over Deceleration. if (!IsNaN(DesiredDisplacement)) { - var v0 = (Abs(_velocities0.Linear.X) + Abs(_velocities0.Linear.Y)) / 2; + var v0 = (Math.Abs(_velocities0.Linear.X) + Math.Abs(_velocities0.Linear.Y)) / 2; DesiredDisplacementDeceleration = GetDecelerationFromDesiredDisplacement(v0, DesiredDisplacement); } if (!IsNaN(DesiredRotation)) @@ -184,14 +184,14 @@ private float GetValue(bool enabled, double v0, double d, double t, float lastVa // https://docs.microsoft.com/en-us/windows/win32/wintouch/inertia-mechanics#inertia-physics-overview private float GetValue(double v0, double d, double t) => v0 >= 0 - ? (float)(v0 * t - d * Pow(t, 2)) - : -(float)(-v0 * t - d * Pow(t, 2)); + ? (float)(v0 * t - d * Math.Pow(t, 2)) + : -(float)(-v0 * t - d * Math.Pow(t, 2)); private bool IsCompleted(double v0, double d, double t) - => Abs(v0) - d * 2 * t <= 0; // The derivative of the GetValue function + => Math.Abs(v0) - d * 2 * t <= 0; // The derivative of the GetValue function private double GetDecelerationFromDesiredDisplacement(double v0, double displacement, double durationMs = _defaultDurationMs) - => (v0 * durationMs - displacement) / Pow(_defaultDurationMs, 2); + => (v0 * durationMs - displacement) / Math.Pow(_defaultDurationMs, 2); /// public void Dispose()