Small fix for .Net Core 3.0.
This commit is contained in:
Родитель
a9aeed04de
Коммит
a5cf3ef8d1
|
@ -32,6 +32,8 @@ namespace Microsoft.Toolkit.Forms.UI.XamlHost
|
|||
/// </remarks>
|
||||
private static readonly IXamlMetadataContainer _metadataContainer = XamlApplication.GetOrCreateXamlMetadataContainer();
|
||||
|
||||
#pragma warning disable SA1401 // Fields must be private
|
||||
#pragma warning disable CA1051 // Do not declare visible instance fields
|
||||
/// <summary>
|
||||
/// DesktopWindowXamlSource instance
|
||||
/// </summary>
|
||||
|
@ -41,6 +43,8 @@ namespace Microsoft.Toolkit.Forms.UI.XamlHost
|
|||
/// A render transform to scale the UWP XAML content should be applied
|
||||
/// </summary>
|
||||
private bool _dpiScalingRenderTransformEnabled = false;
|
||||
#pragma warning restore SA1401 // Fields must be private
|
||||
#pragma warning restore CA1051 // Do not declare visible instance fields
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current instance of <seealso cref="XamlApplication"/>
|
||||
|
|
|
@ -98,7 +98,6 @@ Global
|
|||
{9C49A885-D39B-4CA0-9DEB-204A6EA7D453}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9C49A885-D39B-4CA0-9DEB-204A6EA7D453}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9C49A885-D39B-4CA0-9DEB-204A6EA7D453}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9C49A885-D39B-4CA0-9DEB-204A6EA7D453}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F87EDD34-AF48-45C7-9342-49023B882DA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F87EDD34-AF48-45C7-9342-49023B882DA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F87EDD34-AF48-45C7-9342-49023B882DA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using windows = Windows;
|
||||
|
||||
namespace Microsoft.Toolkit.Wpf.UI.XamlHost
|
||||
{
|
||||
/// <summary>
|
||||
/// Extensions for use with UWP UIElement objects wrapped by the WindowsXamlHostBaseExt
|
||||
/// </summary>
|
||||
public static class UwpUIElementExtensions
|
||||
{
|
||||
private static bool IsDesktopWindowsXamlSourcePresent() => windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.UI.Xaml.Hosting.HostingContract", 3);
|
||||
|
||||
private static windows.UI.Xaml.DependencyProperty WrapperProperty
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsDesktopWindowsXamlSourcePresent())
|
||||
{
|
||||
var result = windows.UI.Xaml.DependencyProperty.RegisterAttached("Wrapper", typeof(System.Windows.UIElement), typeof(UwpUIElementExtensions), new windows.UI.Xaml.PropertyMetadata(null));
|
||||
return result;
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public static WindowsXamlHostBase GetWrapper(this windows.UI.Xaml.UIElement element)
|
||||
{
|
||||
if (IsDesktopWindowsXamlSourcePresent())
|
||||
{
|
||||
return (WindowsXamlHostBase)element.GetValue(WrapperProperty);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void SetWrapper(this windows.UI.Xaml.UIElement element, WindowsXamlHostBase wrapper)
|
||||
{
|
||||
if (IsDesktopWindowsXamlSourcePresent())
|
||||
{
|
||||
element.SetValue(WrapperProperty, wrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using windows = Windows;
|
||||
|
||||
namespace Microsoft.Toolkit.Wpf.UI.XamlHost
|
||||
{
|
||||
/// <summary>
|
||||
/// Extensions for use with UWP UIElement objects wrapped by the WindowsXamlHostBaseExt
|
||||
/// </summary>
|
||||
public static class UwpUIElementExtensions
|
||||
{
|
||||
private static bool IsDesktopWindowsXamlSourcePresent() => windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.UI.Xaml.Hosting.HostingContract", 3);
|
||||
|
||||
private static windows.UI.Xaml.DependencyProperty WrapperProperty
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsDesktopWindowsXamlSourcePresent())
|
||||
{
|
||||
var result = windows.UI.Xaml.DependencyProperty.RegisterAttached("Wrapper", typeof(System.Windows.UIElement), typeof(UwpUIElementExtensions), new windows.UI.Xaml.PropertyMetadata(null));
|
||||
return result;
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public static WindowsXamlHostBase GetWrapper(this windows.UI.Xaml.UIElement element)
|
||||
{
|
||||
if (IsDesktopWindowsXamlSourcePresent())
|
||||
{
|
||||
return (WindowsXamlHostBase)element.GetValue(WrapperProperty);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void SetWrapper(this windows.UI.Xaml.UIElement element, WindowsXamlHostBase wrapper)
|
||||
{
|
||||
if (IsDesktopWindowsXamlSourcePresent())
|
||||
{
|
||||
element.SetValue(WrapperProperty, wrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// Based on https://github.com/saikrishnav/testfxSTAext/blob/master/LICENSE
|
||||
|
||||
#if NETCOREAPP
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project.
|
||||
// Project-level suppressions either have no target or are given
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
|
||||
$globalJsonPath = Join-Path -Path $PSScriptRoot -ChildPath ..\global.json
|
||||
$globalJson = Get-Content $globalJsonPath | ConvertFrom-Json
|
||||
$dotnetinstall = Join-Path -Path $PSScriptRoot dotnet-install.ps1
|
||||
|
||||
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile $dotnetinstall;
|
||||
|
||||
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
|
||||
$globalJsonPath = Join-Path -Path $PSScriptRoot -ChildPath ..\global.json
|
||||
$globalJson = Get-Content $globalJsonPath | ConvertFrom-Json
|
||||
$dotnetinstall = Join-Path -Path $PSScriptRoot dotnet-install.ps1
|
||||
|
||||
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile $dotnetinstall;
|
||||
|
||||
& $dotnetinstall -Version $globalJson.sdk.version;
|
Загрузка…
Ссылка в новой задаче