chore: Adjust for preview5 merge

This commit is contained in:
Jerome Laban 2021-03-04 17:38:56 -05:00
Родитель 15d0ed8466
Коммит 1dc21ed175
81 изменённых файлов: 2066 добавлений и 13900 удалений

Просмотреть файл

@ -116,7 +116,8 @@
<!-- BEGIN Uno Specific -->
<PropertyGroup>
<TargetFrameworksOverride>uap10.0.16299;MonoAndroid10.0;xamarinios10;netstandard2.0;xamarinmac20</TargetFrameworksOverride>
<!--<TargetFrameworksOverride>uap10.0.17763;MonoAndroid10.0;xamarinios10;netstandard2.0;xamarinmac20</TargetFrameworksOverride>-->
<TargetFrameworksOverride>netstandard2.0</TargetFrameworksOverride>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'MonoAndroid80' or '$(TargetFramework)' == 'xamarinios10' ">

Просмотреть файл

@ -23,7 +23,7 @@
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI"
Version="3.0.0-dev.1549" />
Version="3.4.0" />
</ItemGroup>
<!-- END UNO SPECIFIC -->
</Project>

Просмотреть файл

@ -13,16 +13,6 @@
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.DeveloperTools</PackageId>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI" Version="3.0.0-dev.1549" />
</ItemGroup>
<ItemGroup>
<None Include="VisualStudioToolsManifest.xml" Pack="true" PackagePath="tools" />
@ -36,4 +26,18 @@
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
</Target>
<!-- BEGIN UNO SPECIFIC -->
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.DeveloperTools</PackageId>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI"
Version="3.4.0" />
</ItemGroup>
<!-- END UNO SPECIFIC -->
</Project>

Просмотреть файл

@ -25,6 +25,7 @@
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>false</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@ -90,8 +91,10 @@
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.Uwp.Managed">
<Version>2.0.2-uno.74</Version>
</PackageReference>
<PackageReference Include="Uno.UI" Version="3.0.0-dev.1549" />
</ItemGroup>
<PackageReference Include="Uno.UI" Version="3.4.0" />
<PackageReference Include="System.Text.Json"
Version="4.7.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Parsers\Microsoft.Toolkit.Parsers.csproj">
<Project>{42ca4935-54be-42ea-ac19-992378c08de6}</Project>
@ -113,7 +116,14 @@
<Project>{b24a296c-b3eb-4e06-a64e-74ac2d1acc91}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Animations</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.csproj">
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Behaviors\Microsoft.Toolkit.Uwp.UI.Behaviors.csproj">
<Project>{d4ff799d-0df2-495a-adc9-3bbc4aef8971}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Behaviors</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Core\Microsoft.Toolkit.Uwp.UI.Controls.Core.csproj">
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.csproj">
<Project>{ae9086c5-6aad-4f37-b93d-1eb491aa8356}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.DataGrid</Name>
</ProjectReference>
@ -121,10 +131,34 @@
<Project>{d4d78cba-b238-4794-89a0-4f1a2d8fea97}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Graph</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Input\Microsoft.Toolkit.Uwp.UI.Controls.Input.csproj">
<Project>{af1be4e9-e2e1-4729-b076-b3725d8e21ee}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Input</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Layout\Microsoft.Toolkit.Uwp.UI.Controls.Layout.csproj">
<Project>{cb444381-18ba-4a51-bb32-3a498bcc1e99}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Layout</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Markdown\Microsoft.Toolkit.Uwp.UI.Controls.Markdown.csproj">
<Project>{6fedf199-b052-49dd-8f3e-2a9224998e0f}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Markdown</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Media\Microsoft.Toolkit.Uwp.UI.Controls.Media.csproj">
<Project>{43bd2a36-9e12-4788-80ae-2377e41e6d05}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Media</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Primitives\Microsoft.Toolkit.Uwp.UI.Controls.Primitives.csproj">
<Project>{84ab7dc5-95c9-4cf8-a370-d077e9e9ef1a}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Primitives</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.csproj">
<Project>{e9faabfb-d726-42c1-83c1-cb46a29fea81}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Media\Microsoft.Toolkit.Uwp.UI.Media.csproj">
<Project>{75f9ee44-3efa-47bc-aedd-351b9834a0af}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Media</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI\Microsoft.Toolkit.Uwp.UI.csproj">
<Project>{3dd8aa7c-3569-4e51-992f-0c2257e8878e}</Project>
<Name>Microsoft.Toolkit.Uwp.UI</Name>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType Condition="'$(Configuration)'=='Release'">WinExe</OutputType>
<OutputType Condition="'$(Configuration)'=='Debug'">Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<UnoUIUseRoslynSourceGenerators>false</UnoUIUseRoslynSourceGenerators>
</PropertyGroup>
<ItemGroup Condition="exists('..\Microsoft.Toolkit.Uwp.SampleApp.UWP')">
<EmbeddedResource Include="..\Microsoft.Toolkit.Uwp.SampleApp.UWP\Package.appxmanifest" LogicalName="Package.appxmanifest" />
<Content Include="..\Microsoft.Toolkit.Uwp.SampleApp.UWP\Assets\StoreLogo.png" Link="Assets\StoreLogo.png" />
<Content Include="Assets\Fonts\uno-fluentui-assets.ttf" />
</ItemGroup>
<ItemGroup>
<UpToDateCheckInput Include="..\Microsoft.Toolkit.Uwp.SampleApp.Shared\**\*.xaml" />
</ItemGroup>
<ItemGroup>
<!-- Note that for WebAssembly version 1.1.1 of the console logger required -->
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
<PackageReference Include="Uno.UI.Skia.Gtk" Version="3.6.0-dev.294" />
<PackageReference Include="Uno.UI.RemoteControl" Version="3.5.1" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="Uno.UI.Sample.Banner" Version="1.44.0-dev.33" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.Connectivity\Microsoft.Toolkit.Uwp.Connectivity.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.DeveloperTools\Microsoft.Toolkit.Uwp.DeveloperTools.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Animations\Microsoft.Toolkit.Uwp.UI.Animations.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Behaviors\Microsoft.Toolkit.Uwp.UI.Behaviors.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Media\Microsoft.Toolkit.Uwp.UI.Media.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI\Microsoft.Toolkit.Uwp.UI.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp\Microsoft.Toolkit.Uwp.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit\Microsoft.Toolkit.csproj" />
</ItemGroup>
<Import Project="..\Microsoft.Toolkit.Uwp.SampleApp\Microsoft.Toolkit.Uwp.SampleApp.Shared.projitems" Label="Shared" />
<Import Project="..\Microsoft.Toolkit.Uwp.SampleApp.iOS\Exclusions.props" />
</Project>

Просмотреть файл

@ -0,0 +1,22 @@
using System;
using GLib;
using Uno.UI.Runtime.Skia;
namespace Microsoft.Toolkit.Uwp.SampleApp.Skia.Gtk
{
class Program
{
static void Main(string[] args)
{
ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
{
Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
expArgs.ExitApplication = true;
};
var host = new GtkHost(() => new App(), args);
host.Run();
}
}
}

Просмотреть файл

@ -1,15 +1,12 @@
<linker>
<assembly fullname="WebAssembly.Bindings"/>
<assembly fullname="Uno.Foundation"/>
<assembly fullname="Uno.Xaml"/>
<assembly fullname="Microsoft.Toolkit.Uwp.SampleApp.Wasm"/>
<assembly fullname="ColorCode.UWP"/>
<assembly fullname="ColorCode.Core"/>
<assembly fullname="Microsoft.Toolkit"/>
<assembly fullname="Microsoft.Toolkit.Parsers"/>
<assembly fullname="Microsoft.Toolkit.Uwp.DeveloperTools"/>
<assembly fullname="Microsoft.Toolkit.Uwp"/>
<assembly fullname="Microsoft.Toolkit.Uwp" />
<assembly fullname="Microsoft.Toolkit.Uwp.UI.Animations"/>
<assembly fullname="Microsoft.Toolkit.Uwp.UI.Controls" />
<assembly fullname="Microsoft.Toolkit.Uwp.UI.Controls.DataGrid"/>

Просмотреть файл

@ -3,16 +3,18 @@
<PropertyGroup>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<WasmPWAManifestFile Condition="'$(Configuration)'=='Release'">manifest.json</WasmPWAManifestFile>
<NoWarn>$(NoWarm);Uno0001</NoWarn>
<MonoRuntimeDebuggerEnabled Condition="'$(Configuration)'=='Debug'">true</MonoRuntimeDebuggerEnabled>
<UseAOT Condition="$([MSBuild]::IsOsPlatform('Linux')) or ( $([MSBuild]::IsOsPlatform('Windows')) and '$(BUILD_REPOSITORY_PROVIDER)'=='' )">true</UseAOT>
<WasmShellMonoRuntimeExecutionMode Condition="'$(UseAOT)'=='true'">FullAOT</WasmShellMonoRuntimeExecutionMode>
<!--<WasmShellMonoRuntimeExecutionMode Condition="'$(UseAOT)'=='true'">FullAOT</WasmShellMonoRuntimeExecutionMode>-->
<!--<WasmShellGenerateAOTProfile>true</WasmShellGenerateAOTProfile>-->
<WasmShellEnableEmccProfiling>true</WasmShellEnableEmccProfiling>
<WasmShellEnableLongPathSupport>false</WasmShellEnableLongPathSupport>
</PropertyGroup>
<UnoUIUseRoslynSourceGenerators>false</UnoUIUseRoslynSourceGenerators>
</PropertyGroup>
<ItemGroup>
<WasmShellMonoEnvironment Include="MONO_GC_PARAMS" Value="soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep" />
@ -25,26 +27,27 @@
-->
<ItemGroup>
<PackageReference Include="Uno.UI.WebAssembly" Version="3.0.0-dev.1549" />
<PackageReference Include="Uno.Wasm.Bootstrap" Version="1.4.0-dev.24" />
<PackageReference Include="Uno.Wasm.Bootstrap.DevServer" Version="1.4.0-dev.24" />
<PackageReference Include="Uno.UI.WebAssembly" Version="3.5.1" />
<PackageReference Include="Uno.Wasm.Bootstrap" Version="2.0.0-dev.153" />
<PackageReference Include="Uno.Wasm.Bootstrap.DevServer" Version="2.0.0-dev.153" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
<PackageReference Include="Microsoft.TypeScript.Compiler" Version="2.8.3" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="2.8.3" />
<PackageReference Include="Uno.UI.Sample.Banner" Version="1.44.0-dev.33" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<PackageReference Include="System.Text.Json" Version="4.7.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Parsers\Microsoft.Toolkit.Parsers.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Services\Microsoft.Toolkit.Services.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.Connectivity\Microsoft.Toolkit.Uwp.Connectivity.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.DeveloperTools\Microsoft.Toolkit.Uwp.DeveloperTools.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Animations\Microsoft.Toolkit.Uwp.UI.Animations.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI\Microsoft.Toolkit.Uwp.UI.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Behaviors\Microsoft.Toolkit.Uwp.UI.Behaviors.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Media\Microsoft.Toolkit.Uwp.UI.Media.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI\Microsoft.Toolkit.Uwp.UI.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp\Microsoft.Toolkit.Uwp.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit\Microsoft.Toolkit.csproj" />
</ItemGroup>

Просмотреть файл

@ -9,6 +9,7 @@
<RootNamespace>Microsoft.Toolkit.Uwp.SampleApp.iOS</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>Microsoft.Toolkit.Uwp.SampleApp.iOS</AssemblyName>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
@ -116,7 +117,8 @@
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
<PackageReference Include="Uno.UI.Sample.Banner" Version="1.44.0-dev.33" />
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.2-uno.74" />
<PackageReference Include="Uno.UI" Version="3.0.0-dev.1549" />
<PackageReference Include="Uno.UI" Version="3.4.0" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Parsers\Microsoft.Toolkit.Parsers.csproj">
@ -139,7 +141,14 @@
<Project>{b24a296c-b3eb-4e06-a64e-74ac2d1acc91}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Animations</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.csproj">
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Behaviors\Microsoft.Toolkit.Uwp.UI.Behaviors.csproj">
<Project>{d4ff799d-0df2-495a-adc9-3bbc4aef8971}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Behaviors</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Media\Microsoft.Toolkit.Uwp.UI.Media.csproj">
<Name>Microsoft.Toolkit.Uwp.UI.Media</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.csproj">
<Project>{ae9086c5-6aad-4f37-b93d-1eb491aa8356}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.DataGrid</Name>
</ProjectReference>
@ -147,6 +156,29 @@
<Project>{d4d78cba-b238-4794-89a0-4f1a2d8fea97}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Graph</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Input\Microsoft.Toolkit.Uwp.UI.Controls.Input.csproj">
<Project>{af1be4e9-e2e1-4729-b076-b3725d8e21ee}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Input</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Layout\Microsoft.Toolkit.Uwp.UI.Controls.Layout.csproj">
<Project>{cb444381-18ba-4a51-bb32-3a498bcc1e99}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Layout</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Core\Microsoft.Toolkit.Uwp.UI.Controls.Core.csproj">
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Markdown\Microsoft.Toolkit.Uwp.UI.Controls.Markdown.csproj">
<Project>{6fedf199-b052-49dd-8f3e-2a9224998e0f}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Markdown</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Media\Microsoft.Toolkit.Uwp.UI.Controls.Media.csproj">
<Project>{43bd2a36-9e12-4788-80ae-2377e41e6d05}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Media</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Primitives\Microsoft.Toolkit.Uwp.UI.Controls.Primitives.csproj">
<Project>{84ab7dc5-95c9-4cf8-a370-d077e9e9ef1a}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Primitives</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.csproj">
<Project>{e9faabfb-d726-42c1-83c1-cb46a29fea81}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls</Name>

Просмотреть файл

@ -16,7 +16,7 @@
<ResourceDictionary Source="ms-appx:///Styles/Generic.xaml" />
<!-- WinUI -->
<not_wasm:XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>
<!--<not_wasm:XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>-->
</ResourceDictionary.MergedDictionaries>
<!-- Converters -->

Просмотреть файл

@ -24,7 +24,9 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.Controls
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register(nameof(Text), typeof(string), typeof(XamlCodeEditor), new PropertyMetadata(string.Empty));
#if !HAS_UNO
private ThemeListener _themeListener = new ThemeListener();
#endif
public XamlCodeEditor()
{

Просмотреть файл

@ -107,9 +107,6 @@
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\BluetoothLEHelper\BluetoothLEHelperPage.xaml.cs">
<DependentUpon>BluetoothLEHelperPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Blur\BlurBehaviorPage.xaml.cs">
<DependentUpon>BlurBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\CameraHelper\CameraHelperPage.xaml.cs">
<DependentUpon>CameraHelperPage.xaml</DependentUpon>
</Compile>
@ -134,9 +131,6 @@
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\DataGrid\DataGridPage.xaml.cs">
<DependentUpon>DataGridPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\DispatcherHelper\DispatcherHelperPage.xaml.cs">
<DependentUpon>DispatcherHelperPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\DockPanel\DockPanelPage.xaml.cs">
<DependentUpon>DockPanelPage.xaml</DependentUpon>
</Compile>
@ -152,9 +146,6 @@
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\FadeHeader\FadeHeaderBehaviorPage.xaml.cs">
<DependentUpon>FadeHeaderBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Fade\FadeBehaviorPage.xaml.cs">
<DependentUpon>FadeBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\FocusTracker\FocusTrackerPage.xaml.cs">
<DependentUpon>FocusTrackerPage.xaml</DependentUpon>
</Compile>
@ -176,9 +167,6 @@
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\HeaderedItemsControl\HeaderedItemsControlPage.xaml.cs">
<DependentUpon>HeaderedItemsControlPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\HeaderedTextBlock\HeaderedTextBlockPage.xaml.cs">
<DependentUpon>HeaderedTextBlockPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\ImageBlendBrush\ImageBlendBrushPage.xaml.cs">
<DependentUpon>ImageBlendBrushPage.xaml</DependentUpon>
</Compile>
@ -212,12 +200,6 @@
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\LayoutTransformControl\LayoutTransformControlPage.xaml.cs">
<DependentUpon>LayoutTransformControlPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Light\LightBehaviorPage.xaml.cs">
<DependentUpon>LightBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\LinkedIn Service\LinkedInPage.xaml.cs">
<DependentUpon>LinkedInPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\ListViewExtensions\ListViewExtensionsPage.xaml.cs">
<DependentUpon>ListViewExtensionsPage.xaml</DependentUpon>
</Compile>
@ -230,22 +212,13 @@
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\LoginButton\LoginButtonPage.xaml.cs">
<DependentUpon>LoginButtonPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\MarkdownParser\MarkdownParserPage.xaml.cs">
<DependentUpon>MarkdownParserPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\MarkdownTextBlock\MarkdownTextBlockPage.xaml.cs">
<DependentUpon>MarkdownTextBlockPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\MasterDetailsView\MasterDetailsViewPage.xaml.cs">
<DependentUpon>MasterDetailsViewPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Menu\Commands\VsCommands.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Menu\MenuPage.xaml.cs">
<DependentUpon>MenuPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Microsoft Translator Service\MicrosoftTranslatorPage.xaml.cs">
<DependentUpon>MicrosoftTranslatorPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Mouse\MouseCursorPage.xaml.cs">
<DependentUpon>MouseCursorPage.xaml</DependentUpon>
</Compile>
@ -255,9 +228,6 @@
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Object Storage\ObjectStoragePage.xaml.cs">
<DependentUpon>ObjectStoragePage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Offset\OffsetBehaviorPage.xaml.cs">
<DependentUpon>OffsetBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\OnDevice\OnDevicePage.xaml.cs">
<DependentUpon>OnDevicePage.xaml</DependentUpon>
</Compile>
@ -287,24 +257,9 @@
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\RemoteDeviceHelper\RemoteDeviceHelperPage.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\RemoteDevicePicker\RemoteDevicePickerControlPage.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\ReorderGridAnimation\ReorderGridPage.xaml.cs">
<DependentUpon>ReorderGridPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Rotate\RotateBehaviorPage.xaml.cs">
<DependentUpon>RotateBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\RotatorTile\RotatorTilePage.xaml.cs">
<DependentUpon>RotatorTilePage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\RssParser\RssParserPage.xaml.cs">
<DependentUpon>RssParserPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Saturation\SaturationBehaviorPage.xaml.cs">
<DependentUpon>SaturationBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Scale\ScaleBehaviorPage.xaml.cs">
<DependentUpon>ScaleBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\ScrollHeader\ScrollHeaderPage.xaml.cs">
<DependentUpon>ScrollHeaderPage.xaml</DependentUpon>
</Compile>
@ -317,13 +272,9 @@
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\StringExtensions\StringExtensionsPage.xaml.cs">
<DependentUpon>StringExtensionsPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\SurfaceDialTextbox\SurfaceDialTextboxPage.xaml.cs">
<DependentUpon>SurfaceDialTextboxPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\SystemInformation\SystemInformationPage.xaml.cs">
<DependentUpon>SystemInformationPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\TabView\TabViewPage.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\TextBoxMask\TextBoxMaskPage.xaml.cs">
<DependentUpon>TextBoxMaskPage.xaml</DependentUpon>
</Compile>
@ -343,42 +294,18 @@
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Toast\ToastPage.xaml.cs">
<DependentUpon>ToastPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\TokenizingTextBox\NameToColorConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\TokenizingTextBox\SampleDataType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\TokenizingTextBox\SampleEmailDataType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\TokenizingTextBox\TokenizingTextBoxPage.xaml.cs">
<DependentUpon>TokenizingTextBoxPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\CompareStateTriggerPage.xaml.cs">
<DependentUpon>CompareStateTriggerPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\FullScreenModeStateTriggerPage.xaml.cs">
<DependentUpon>FullScreenModeStateTriggerPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\IsEqualStateTriggerPage.xaml.cs">
<DependentUpon>IsEqualStateTriggerPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\IsNotEqualStateTriggerPage.xaml.cs">
<DependentUpon>IsNotEqualStateTriggerPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\IsNullOrEmptyStateTriggerPage.xaml.cs">
<DependentUpon>IsNullOrEmptyStateTriggerPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\NetworkConnectionStateTriggerPage.xaml.cs">
<DependentUpon>NetworkConnectionStateTriggerPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\RegexStateTriggerPage.xaml.cs">
<DependentUpon>RegexStateTriggerPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\UserHandPreferenceStateTriggerPage.xaml.cs">
<DependentUpon>UserHandPreferenceStateTriggerPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\UserInteractionModeStateTriggerPage.xaml.cs">
<DependentUpon>UserInteractionModeStateTriggerPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Twitter Service\TwitterPage.xaml.cs">
<DependentUpon>TwitterPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Twitter Service\TwitterTemplateSelector.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\UniformGrid\UniformGridPage.xaml.cs">
<DependentUpon>UniformGridPage.xaml</DependentUpon>
</Compile>
@ -394,7 +321,6 @@
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\WeatherLiveTileAndToast\WeatherLiveTileAndToastPage.xaml.cs">
<DependentUpon>WeatherLiveTileAndToastPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\Weibo Service\WeiboPage.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SamplePages\WrapPanel\WrapPanelPage.xaml.cs">
<DependentUpon>WrapPanelPage.xaml</DependentUpon>
</Compile>
@ -459,7 +385,6 @@
<Content Include="$(MSBuildThisFileDirectory)Assets\UWPCommunityToolkit_Uno_SplashScreen.scale-200.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\DataGrid\DataGrid.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Eyedropper\Eyedropper.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Facebook Service\icon.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\GazeInteraction\GazeInteraction.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\ImageCropper\ImageCropper.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\LoginButton\LoginButton.png" />
@ -467,10 +392,8 @@
<Content Include="$(MSBuildThisFileDirectory)SamplePages\PersonView\PersonView.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\RemoteDeviceHelper\RemoteDeviceHelper.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\RemoteDevicePicker\RemoteDevicePicker.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\TabView\TabView.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\TokenizingTextBox\TokenizingTextBox.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\ViewportBehavior\ViewportBehavior.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Weibo Service\WeiboLogo.png" />
<None Include="$(MSBuildThisFileDirectory)Assets\Photos\OnlinePhotos.json" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Photos\OregonWineryNamaste.jpg" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Photos\Owl.jpg" />
@ -571,7 +494,7 @@
<Content Include="$(MSBuildThisFileDirectory)Icons\More.png" />
<Content Include="$(MSBuildThisFileDirectory)Icons\Notifications.png" />
<Content Include="$(MSBuildThisFileDirectory)Icons\Services.png" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)landingPageLinks.json" />
<Content Include="$(MSBuildThisFileDirectory)landingPageLinks.json" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\AdaptiveGridView\AdaptiveGridView.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\AdaptiveGridView\AdaptiveGridViewCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\AdvancedCollectionView\AdvancedCollectionView.bind" />
@ -594,9 +517,6 @@
<Content Include="$(MSBuildThisFileDirectory)SamplePages\BladeView\BladeView.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\BluetoothLEHelper\BluetoothLEHelper.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\BluetoothLEHelper\BluetoothLEHelperCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Blur\BlurBehavior.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Blur\BlurBehaviorCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Blur\BlurBehaviorXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\CameraHelper\CameraHelper.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\CameraHelper\CameraHelperCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\CameraPreview\CameraPreview.png" />
@ -606,8 +526,6 @@
<None Include="$(MSBuildThisFileDirectory)SamplePages\Carousel\CarouselCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Connected Animations\ConnectedAnimations.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Connected Animations\ConnectedAnimationsCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\DispatcherHelper\DispatcherHelperCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\DispatcherHelper\DispatchHelper.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\DockPanel\DockPanel.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\DockPanel\DockPanel.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\DropShadowPanel\DropShadowPanel.png" />
@ -616,14 +534,9 @@
<Content Include="$(MSBuildThisFileDirectory)SamplePages\DropShadowPanel\Unicorn.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Expander\Expander.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Expander\ExpanderXaml.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Facebook Service\FacebookCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Facebook Service\FacebookLogo.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\FadeHeader\FadeHeaderBehavior.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\FadeHeader\FadeHeaderBehaviorCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\FadeHeader\FadeHeaderBehaviorXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Fade\FadeBehavior.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Fade\FadeBehaviorCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Fade\FadeBehaviorXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\FocusTracker\FocusTracker.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\FocusTracker\FocusTrackerXaml.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\FrameworkElementExtensions\FrameworkElementExtensionsCode.bind" />
@ -636,8 +549,6 @@
<None Include="$(MSBuildThisFileDirectory)SamplePages\HeaderedContentControl\HeaderedContentControlXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\HeaderedItemsControl\HeaderedItemsControl.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\HeaderedItemsControl\HeaderedItemsControlXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\HeaderedTextBlock\HeaderedTextBlock.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\HeaderedTextBlock\HeaderedTextBlockCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\ImageBlendBrush\ImageBlendBrush.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\ImageBlendBrush\ImageBlendBrushXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\ImageCache\ImageCache.png" />
@ -656,39 +567,23 @@
<Content Include="$(MSBuildThisFileDirectory)SamplePages\InfiniteCanvas\InfiniteCanvas.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\LayoutTransformControl\LayoutTransformControl.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\LayoutTransformControl\LayoutTransformControlXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Light\LightBehavior.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Light\LightBehaviorCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Light\LightBehaviorXaml.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\LinkedIn Service\LinkedInCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\LinkedIn Service\LinkedInLogo.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\ListViewExtensions\ListViewExtensionsCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\LiveTile\LiveTile.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\LiveTile\LiveTileCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\LiveTile\LiveTileCodeJavaScript.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Loading\Loading.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Loading\LoadingCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\MarkdownTextBlock\InitialContent.md" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\MarkdownTextBlock\MarkdownTextBlock.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\MarkdownTextBlock\MarkdownTextBlock.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\MarkdownTextBlock\MarkdownTextBlockCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\MasterDetailsView\MasterDetailsView.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\MasterDetailsView\MasterDetailsView.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\MasterDetailsView\MasterDetailsViewCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\MasterDetailsView\OneDriveLogo.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Menu\Menu.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Menu\Menu.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Microsoft Translator Service\MicrosoftTranslatorCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Microsoft Translator Service\TranslatorService.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Mouse\MouseCursor.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Mouse\MouseCursorPage.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\NetworkHelper\NetworkHelper.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\NetworkHelper\NetworkHelperCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Object Storage\ObjectStorage.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Object Storage\ObjectStorageCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Offset\OffsetBehavior.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Offset\OffsetBehaviorCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Offset\OffsetBehaviorXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\OneDrive Service\OneDriveLogo.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\OrbitView\OrbitView.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\OrbitView\OrbitViewXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\PeoplePicker\PeoplePicker.png" />
@ -704,22 +599,11 @@
<None Include="$(MSBuildThisFileDirectory)SamplePages\RadialProgressBar\RadialProgressBarCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\RangeSelector\RangeSelector.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\RangeSelector\RangeSelectorCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\ReorderGridAnimation\ReorderGrid.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\ReorderGridAnimation\ReorderGrid.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Rotate\RotateBehavior.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Rotate\RotateBehaviorCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Rotate\RotateBehaviorXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\RotatorTile\RotatorTile.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\RotatorTile\RotatorTileCode.bind" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)SamplePages\samples.json">
<Content Include="$(MSBuildThisFileDirectory)SamplePages\samples.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</EmbeddedResource>
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Saturation\SaturationBehavior.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Saturation\SaturationBehaviorCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Saturation\SaturationBehaviorXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Scale\ScaleBehavior.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Scale\ScaleBehaviorCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Scale\ScaleBehaviorXaml.bind" />
</Content>
<Content Include="$(MSBuildThisFileDirectory)SamplePages\ScrollHeader\ScrollHeader.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\ScrollHeader\ScrollHeaderCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\ScrollViewerExtensions\ScrollViewerExtensionsCode.bind" />
@ -741,10 +625,6 @@
<Content Include="$(MSBuildThisFileDirectory)SamplePages\TileControl\TileControl.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Toast\Toast.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Toast\ToastCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Toast\ToastCodeJavaScript.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Twitter Service\icon.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Twitter Service\TwitterCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\Twitter Service\TwitterLogo.png" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\UniformGrid\UniformGrid.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\UniformGrid\UniformGridXaml.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\ViewExtensions\ViewExtensions.png" />
@ -753,7 +633,6 @@
<None Include="$(MSBuildThisFileDirectory)SamplePages\Visual Extensions\VisualExtensionsCode.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\WeatherLiveTileAndToast\WeatherLiveTileAndToast.png" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\WeatherLiveTileAndToast\WeatherLiveTileAndToastCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\WeatherLiveTileAndToast\WeatherLiveTileAndToastCodeJavaScript.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\WrapPanel\WrapPanel.bind" />
<Content Include="$(MSBuildThisFileDirectory)SamplePages\WrapPanel\WrapPanel.png" />
</ItemGroup>
@ -822,10 +701,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Blur\BlurBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\CameraHelper\CameraHelperPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -858,10 +733,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\DispatcherHelper\DispatcherHelperPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\DockPanel\DockPanelPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -882,10 +753,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Fade\FadeBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\FocusTracker\FocusTrackerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -914,10 +781,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\HeaderedTextBlock\HeaderedTextBlockPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\ImageBlendBrush\ImageBlendBrushPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -958,14 +821,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Light\LightBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\LinkedIn Service\LinkedInPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\ListViewExtensions\ListViewExtensionsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -982,26 +837,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\MarkdownParser\MarkdownParserPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\MarkdownTextBlock\MarkdownTextBlockPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\MasterDetailsView\MasterDetailsViewPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Menu\MenuPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Microsoft Translator Service\MicrosoftTranslatorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Mouse\MouseCursorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -1014,10 +857,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Offset\OffsetBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\OnDevice\OnDevicePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -1062,30 +901,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\ReorderGridAnimation\ReorderGridPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Rotate\RotateBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\RotatorTile\RotatorTilePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\RssParser\RssParserPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Saturation\SaturationBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Scale\ScaleBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\ScrollHeader\ScrollHeaderPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -1102,18 +921,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\SurfaceDialTextbox\SurfaceDialTextboxPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\SystemInformation\SystemInformationPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\TabView\TabViewPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\TextBoxMask\TextBoxMaskPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -1142,46 +953,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\CompareStateTriggerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\FullScreenModeStateTriggerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\IsEqualStateTriggerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\IsNotEqualStateTriggerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\IsNullOrEmptyStateTriggerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\NetworkConnectionStateTriggerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\RegexStateTriggerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\UserHandPreferenceStateTriggerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Triggers\UserInteractionModeStateTriggerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Twitter Service\TwitterPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\UniformGrid\UniformGridPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -1202,10 +981,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\Weibo Service\WeiboPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)SamplePages\WrapPanel\WrapPanelPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -1237,11 +1012,9 @@
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)SamplePages\DataGrid\DataGridCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\TabView\TabViewXaml.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\Weibo Service\WeiboCode.bind" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Assets\mtns.csv" />
<Content Include="$(MSBuildThisFileDirectory)Assets\mtns.csv" />
</ItemGroup>
<ItemGroup>
<Compile Update="C:\s\nv.github\Uno.WindowsCommunityToolkit\Microsoft.Toolkit.Uwp.SampleApp.Shared\SamplePages\RemoteDeviceHelper\RemoteDeviceHelperPage.xaml.cs">
@ -1261,7 +1034,12 @@
<None Include="$(MSBuildThisFileDirectory)SamplePages\RemoteDeviceHelper\RemoteDeviceHelperCode.bind" />
<None Include="$(MSBuildThisFileDirectory)SamplePages\RemoteDevicePicker\RemoteDevicePickerCode.bind" />
</ItemGroup>
<!-- BEGIN UNO SPECIFIC -->
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)SamplePages\**\*.bind" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)SamplePages\**\*.bind" Exclude="$(MSBuildThisFileDirectory)bin\**;$(MSBuildThisFileDirectory)obj\**" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)SamplePages\**\*.csv" Exclude="$(MSBuildThisFileDirectory)bin\**;$(MSBuildThisFileDirectory)obj\**" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)**\*.json" Exclude="$(MSBuildThisFileDirectory)bin\**;$(MSBuildThisFileDirectory)obj\**" />
</ItemGroup>
<!-- END UNO SPECIFIC -->
</Project>

Просмотреть файл

@ -86,17 +86,11 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
{
var categories = await Samples.GetCategoriesAsync();
#if HAS_UNO
return categories?
.SelectMany(c => c.Samples)
.FirstOrDefault(s => s.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
#else
// Replace any spaces in the category name as it's used for the host part of the URI in deep links and that can't have spaces.
return categories?
.FirstOrDefault(c => c.Name.Replace(" ", string.Empty).Equals(category, StringComparison.OrdinalIgnoreCase))?
.Samples
.FirstOrDefault(s => s.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
#endif
}
private PropertyDescriptor _propertyDescriptor;
@ -105,7 +99,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
public string Type { get; set; }
public bool? IsUno { get; set; }
public bool IsUno { get; set; }
public string Subcategory { get; set; }
@ -116,7 +110,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
/// <summary>
/// Gets the Page Type.
/// </summary>
public Type PageType => this.GetType().Assembly.GetType("Microsoft.Toolkit.Uwp.SampleApp.SamplePages." + Type);
public Type PageType => System.Type.GetType("Microsoft.Toolkit.Uwp.SampleApp.SamplePages." + Type);
/// <summary>
/// Gets or sets the Category Name.
@ -199,7 +193,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
public async Task<string> GetCSharpSourceAsync()
{
using (var codeStream = await StreamHelper.GetEmbeddedFileStreamAsync(GetType(), CodeFile.StartsWith("/") ? CodeFile : $"SamplePages/{Name}/{CodeFile}"))
using (var codeStream = await StreamHelper.GetPackagedFileStreamAsync(CodeFile.StartsWith('/') ? CodeFile : $"SamplePages/{Name}/{CodeFile}"))
{
using (var streamReader = new StreamReader(codeStream.AsStream()))
{
@ -208,17 +202,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
}
}
public async Task<string> GetJavaScriptSourceAsync()
{
using (var codeStream = await StreamHelper.GetEmbeddedFileStreamAsync(GetType(), JavaScriptCodeFile.StartsWith("/") ? JavaScriptCodeFile : $"SamplePages/{Name}/{JavaScriptCodeFile}"))
{
using (var streamreader = new StreamReader(codeStream.AsStream()))
{
return await streamreader.ReadToEndAsync();
}
}
}
#pragma warning disable SA1009 // Doesn't like ValueTuples.
public async Task<(string contents, string path)> GetDocumentationAsync()
#pragma warning restore SA1009 // Doesn't like ValueTuples.
@ -288,7 +271,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
{
try
{
using (var localDocsStream = await StreamHelper.GetEmbeddedFileStreamAsync(GetType(), $"docs.{filepath}"))
using (var localDocsStream = await StreamHelper.GetPackagedFileStreamAsync($"docs/{filepath}"))
{
var result = await localDocsStream.ReadTextAsync(Encoding.UTF8);
_cachedDocumentation = ProcessDocs(result);
@ -485,7 +468,8 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
// Get Xaml code
using (var codeStream = typeof(Samples).GetTypeInfo().Assembly.GetManifestResourceStream(manifestName))
#else
using (var codeStream = await StreamHelper.GetEmbeddedFileStreamAsync(GetType(), XamlCodeFile.StartsWith("/") ? XamlCodeFile : $"SamplePages/{Name}/{XamlCodeFile}"))
// Get Xaml code
using (var codeStream = await StreamHelper.GetPackagedFileStreamAsync(XamlCodeFile.StartsWith('/') ? XamlCodeFile : $"SamplePages/{Name}/{XamlCodeFile}"))
#endif
{
XamlCode = await codeStream.ReadTextAsync(Encoding.UTF8);
@ -585,9 +569,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
catch (Exception ex)
{
Debug.WriteLine($"Unable to extract slider info from {value}({ex.Message})");
#if NETFX_CORE // UNO TODO
TrackingManager.TrackException(ex);
#endif
TrackingManager.TrackException(ex);
continue;
}
@ -600,17 +582,12 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
var split = value.Split('.');
var typeName = string.Join(".", split.Take(split.Length - 1));
var enumType = LookForTypeByName(typeName);
if (enumType != null)
{
options.DefaultValue = Enum.Parse(enumType, split.Last());
}
options.DefaultValue = Enum.Parse(enumType, split.Last());
}
catch (Exception ex)
{
Debug.WriteLine($"Unable to parse enum from {value}({ex.Message})");
#if NETFX_CORE // UNO TODO
TrackingManager.TrackException(ex);
#endif
continue;
}
@ -637,9 +614,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
catch (Exception ex)
{
Debug.WriteLine($"Unable to parse bool from {value}({ex.Message})");
#if NETFX_CORE // UNO TODO
TrackingManager.TrackException(ex);
#endif
continue;
}
@ -695,12 +670,16 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
// TODO Reintroduce graph controls
// typeof(UserToPersonConverter)) // Search in Microsoft.Toolkit.Graph.Controls
EasingType.Default.GetType(), // Microsoft.Toolkit.Uwp.UI.Animations
ImageBlendMode.Multiply.GetType(), // Search in Microsoft.Toolkit.Uwp.UI
typeof(UI.SortDirection), // Search in Microsoft.Toolkit.Uwp.UI
#if !HAS_UNO
Interaction.Enabled.GetType(), // Microsoft.Toolkit.Uwp.Input.GazeInteraction
#endif
DataGridGridLinesVisibility.None.GetType(), // Microsoft.Toolkit.Uwp.UI.Controls.DataGrid
GridSplitter.GridResizeDirection.Auto.GetType(), // Microsoft.Toolkit.Uwp.UI.Controls.Layout
typeof(MarkdownTextBlock), // Microsoft.Toolkit.Uwp.UI.Controls.Markdown
#if !HAS_UNO
BitmapFileFormat.Bmp.GetType(), // Microsoft.Toolkit.Uwp.UI.Controls.Media
#endif
StretchChild.Last.GetType() // Microsoft.Toolkit.Uwp.UI.Controls.Primitivs
};
@ -750,4 +729,4 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
public string Sha { get; set; }
}
}
}
}

Просмотреть файл

@ -8,8 +8,10 @@ using System.IO;
using System.Linq;
using System.Text.Json;
using System.Threading;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.Toolkit.Uwp.Helpers;
using Windows.UI.Composition;
namespace Microsoft.Toolkit.Uwp.SampleApp
{
@ -22,9 +24,9 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
private static LinkedList<Sample> _recentSamples;
private static LocalObjectStorageHelper _localObjectStorageHelper = new LocalObjectStorageHelper(new SystemSerializer());
public static bool ShowUnoUnsupported { get; set; } = false;
public static async Task<SampleCategory> GetCategoryBySample(Sample sample)
{
return (await GetCategoriesAsync()).FirstOrDefault(c => c.Samples.Contains(sample));
@ -58,11 +60,17 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
{
List<SampleCategory> allCategories;
var manifestName = typeof(Samples).GetTypeInfo().Assembly
.GetManifestResourceNames()
.FirstOrDefault(n => n.EndsWith("samples.json", StringComparison.OrdinalIgnoreCase));
using (var jsonStream = await StreamHelper.GetEmbeddedFileStreamAsync(typeof(Samples), "samples.json"))
{
using var reader = new StreamReader(jsonStream);
var t = reader.ReadToEnd();
}
if (manifestName != null)
#if HAS_UNO
using (var jsonStream = await StreamHelper.GetEmbeddedFileStreamAsync(typeof(Samples), "samples.json"))
#else
using (var jsonStream = await StreamHelper.GetPackagedFileStreamAsync("SamplePages/samples.json"))
#endif
{
allCategories = await JsonSerializer.DeserializeAsync<List<SampleCategory>>(jsonStream.AsStream(), new JsonSerializerOptions
{
@ -70,35 +78,30 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
});
}
// Check API
var supportedCategories = new List<SampleCategory>();
foreach (var category in allCategories)
// Check API
var supportedCategories = new List<SampleCategory>();
foreach (var category in allCategories)
{
var finalSamples = new List<Sample>();
foreach (var sample in category.Samples)
{
var finalSamples = new List<Sample>();
sample.CategoryName = category.Name;
foreach (var sample in category.Samples)
{
sample.CategoryName = category.Name;
if (sample.IsSupported && (sample.IsUno ?? ShowUnoUnsupported))
if (sample.IsSupported && (sample.IsUno || ShowUnoUnsupported))
{
finalSamples.Add(sample);
}
}
if (finalSamples.Count > 0)
{
supportedCategories.Add(category);
category.Samples = finalSamples.OrderBy(s => s.Name).ToArray();
}
if (finalSamples.Count > 0)
{
supportedCategories.Add(category);
category.Samples = finalSamples.OrderBy(s => s.Name).ToArray();
}
}
_samplesCategories = supportedCategories.ToList();
}
else
{
throw new Exception("samples.json cannot be found in resources");
}
_samplesCategories = supportedCategories.ToList();
}
_semaphore.Release();

Просмотреть файл

@ -1,6 +1,7 @@
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.Pages.About"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@ -54,7 +55,7 @@
<TextBlock Text="{x:Bind FullName}" />
<TextBlock HorizontalAlignment="Right"
Opacity="0.5"
Text="{x:Bind Published.ToString('MMM d', {x:Null})}" />
Text="{x:Bind Published}" />
</Grid>
</HyperlinkButton>
</DataTemplate>
@ -90,7 +91,8 @@
<ColumnDefinition Width="336" />
</Grid.ColumnDefinitions>
<Border x:Name="RightBorder"
<!-- UNO TODO Vector3 conversion -->
<win:Border x:Name="RightBorder"
Grid.Column="1"
ui:VisualExtensions.NormalizedCenterPoint="0, 0.5"
Background="{ThemeResource Background-AboutPage-SidePane}">
@ -104,7 +106,7 @@
To="0, 1, 0"
Duration="0:0:0.3" />
</animations:Implicit.HideAnimations>
</Border>
</win:Border>
<Border Background="{ThemeResource Background-AboutPage-Main}" />
@ -261,7 +263,9 @@
</Grid>
</controls:DropShadowPanel>
<animations:Implicit.ShowAnimations>
<!--
UNO TODO
<animations:Implicit.ShowAnimations>
<animations:OpacityAnimation From="0"
To="1"
Duration="0:0:0.5" />
@ -277,6 +281,7 @@
To="0.9"
Duration="0:0:0.2" />
</animations:Implicit.HideAnimations>
-->
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="WindowStates">

Просмотреть файл

@ -246,6 +246,8 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
async Task SetSampleDataContext()
{
InfoAreaPivot.Items.Clear();
DataContext = CurrentSample;
// Load Sample Properties before we load sample (if we haven't before)
@ -265,8 +267,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
}
}
InfoAreaPivot.Items.Clear();
if (CurrentSample.HasXAMLCode)
{

Просмотреть файл

@ -213,11 +213,11 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
// TODO: Add InApp Notification?
if (data is SampleDataType sample)
{
Debug.WriteLine("Added Token: " + sample.Text);
System.Diagnostics.Debug.WriteLine("Added Token: " + sample.Text);
}
else
{
Debug.WriteLine("Added Token: " + data);
System.Diagnostics.Debug.WriteLine("Added Token: " + data);
}
}
@ -225,11 +225,11 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
if (args.Item is SampleDataType sample)
{
Debug.WriteLine("Removed Token: " + sample.Text);
System.Diagnostics.Debug.WriteLine("Removed Token: " + sample.Text);
}
else
{
Debug.WriteLine("Removed Token: " + args.Item);
System.Diagnostics.Debug.WriteLine("Removed Token: " + args.Item);
}
}
@ -262,11 +262,11 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
if (args is SampleEmailDataType sample)
{
Debug.WriteLine("Added Email: " + sample.DisplayName);
System.Diagnostics.Debug.WriteLine("Added Email: " + sample.DisplayName);
}
else
{
Debug.WriteLine("Added Token: " + args);
System.Diagnostics.Debug.WriteLine("Added Token: " + args);
}
_acvEmail.RefreshFilter();
@ -276,11 +276,11 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
if (args is SampleEmailDataType sample)
{
Debug.WriteLine("Removed Email: " + sample.DisplayName);
System.Diagnostics.Debug.WriteLine("Removed Email: " + sample.DisplayName);
}
else
{
Debug.WriteLine("Removed Token: " + args);
System.Diagnostics.Debug.WriteLine("Removed Token: " + args);
}
_acvEmail.RefreshFilter();

Просмотреть файл

@ -127,7 +127,7 @@
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Input/RadialGauge",
"XamlCodeFile": "RadialGaugeCode.bind",
"Icon": "/SamplePages/RadialGauge/RadialGauge.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/RadialGauge.md",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/RadialGauge.md"
},
{
"Name": "RadialProgressBar",
@ -137,7 +137,7 @@
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Core/RadialProgressBar",
"XamlCodeFile": "RadialProgressBarCode.bind",
"Icon": "/SamplePages/RadialProgressBar/RadialProgressBar.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/RadialProgressBar.md",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/RadialProgressBar.md"
},
{
"Name": "RotatorTile",
@ -157,7 +157,7 @@
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Layout/BladeView",
"XamlCodeFile": "BladeCode.bind",
"Icon": "/SamplePages/BladeView/BladeView.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/BladeView.md",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/BladeView.md"
},
{
"Name": "ScrollHeader",
@ -176,7 +176,7 @@
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Layout/GridSplitter",
"XamlCodeFile": "GridSplitter.bind",
"Icon": "/SamplePages/GridSplitter/GridSplitter.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/GridSplitter.md",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/GridSplitter.md"
},
{
"Name": "DropShadowPanel",
@ -272,7 +272,7 @@
"XamlCodeFile": "InAppNotificationXaml.bind",
"CodeFile": "InAppNotificationCode.bind",
"Icon": "/SamplePages/InAppNotification/InAppNotification.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/InAppNotification.md",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/InAppNotification.md"
},
{
"Name": "DockPanel",
@ -762,7 +762,7 @@
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp/Helpers/SystemInformation.cs",
"CodeFile": "SystemInformationCode.bind",
"Icon": "/SamplePages/SystemInformation/SystemInformation.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/SystemInformation.md",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/SystemInformation.md"
},
{
"Name": "PrintHelper",
@ -783,7 +783,7 @@
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp/Helpers/DispatcherQueueHelper.cs",
"CodeFile": "DispatcherQueueHelperCode.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/DispatcherQueueHelper.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/DispatcherQueueHelper.md",
"IsUno": true
},
{
@ -864,7 +864,7 @@
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Behaviors/",
"CodeFile": "FocusBehaviorXaml.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/FocusBehavior.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/FocusBehavior.md",
"IsUno": true
},
{
@ -948,7 +948,7 @@
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
"XamlCodeFile": "/SamplePages/Triggers/FullScreenModeStateTrigger.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/Triggers.md",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/Triggers.md"
},
{
"Name": "IsNullOrEmptyStateTrigger",
@ -1142,7 +1142,7 @@
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewExtensions",
"XamlCodeFile": "ListViewExtensionsCode.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/ListViewExtensions.md",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/ListViewExtensions.md"
},
{
"Name": "ViewExtensions",
@ -1160,7 +1160,7 @@
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxMask",
"XamlCodeFile": "TextBoxMask.bind",
"Icon": "/SamplePages/TextBoxMask/TextBoxMask.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/TextBoxMask.md",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/TextBoxMask.md"
},
{
"Name": "Mouse",

Просмотреть файл

@ -16,14 +16,6 @@ using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media.Animation;
#if HAS_UNO
using NavigationView = Windows.UI.Xaml.Controls.NavigationView;
using NavigationViewItemInvokedEventArgs = Windows.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs;
#else
using NavigationView = Microsoft.UI.Xaml.Controls.NavigationView;
using NavigationViewItemInvokedEventArgs = Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs;
#endif
namespace Microsoft.Toolkit.Uwp.SampleApp
{
public sealed partial class Shell
@ -134,7 +126,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
SamplePickerGrid.Visibility = Windows.UI.Xaml.Visibility.Visible;
}
private void NavView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
private void NavView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args)
{
//// Temp Workaround for WinUI Bug https://github.com/microsoft/microsoft-ui-xaml/issues/2520
var invokedItem = args.InvokedItem;

Просмотреть файл

@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:xamarin="http://uno/xamarin"
xmlns:banner="using:Uno.UI.Sample.Banner"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
@ -59,7 +60,8 @@
</winui:ParallaxView>
<Frame x:Name="NavigationFrame" />
<Grid>
<Border x:Name="ContentShadow"
<!-- UNO TODO: UIElementExtensions.VisualFactory issue-->
<win:Border x:Name="ContentShadow"
Background="{ThemeResource BackingTint}"
Tapped="ContentShadow_Tapped"
Visibility="{Binding Visibility, ElementName=SamplePickerGrid}">
@ -78,7 +80,7 @@
To="0"
Duration="0:0:0.2" />
</animations:Implicit.HideAnimations>
</Border>
</win:Border>
<Grid x:Name="SamplePickerGrid"
VerticalAlignment="Top"
@ -105,7 +107,7 @@
win:ItemContainerTransitions="{x:Null}"
ItemTemplate="{StaticResource SampleTemplate}"
SelectionMode="Single"
Transitions="{x:Null}">
win:Transitions="{x:Null}">
<GridView.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
@ -122,7 +124,9 @@
Duration="0:0:0.3" />
</animations:Implicit.ShowAnimations>
</GridView>
<animations:Implicit.ShowAnimations>
<!--
UNO TODO https://github.com/unoplatform/uno/issues/5376
<animations:Implicit.ShowAnimations>
<animations:OpacityAnimation From="0"
To="1"
Duration="0:0:0.3" />
@ -138,6 +142,7 @@
To="0, -1000, 0"
Duration="0:0:0.5" />
</animations:Implicit.HideAnimations>
-->
</Grid>
</Grid>
@ -162,11 +167,13 @@
Color="Black">
<Border Background="{ThemeResource Menu-DropDown-Background}"
Opacity="0.96">
<media:UIElementExtensions.VisualFactory>
<!-- UNO TODO: UIElementExtensions.VisualFactory issue
<media:UIElementExtensions.VisualFactory>
<media:PipelineVisualFactory Source="{media:BackdropSource}">
<media:BlurEffect Amount="8" />
</media:PipelineVisualFactory>
</media:UIElementExtensions.VisualFactory>
-->
</Border>
</controls:DropShadowPanel>
@ -206,7 +213,9 @@
FontSize="10"
Foreground="{ThemeResource Brush-Main}"
Text="{Binding BadgeUpdateVersionRequired}" />
<animations:Implicit.HideAnimations>
<!--
UNO TODO https://github.com/unoplatform/uno/issues/5376
<animations:Implicit.HideAnimations>
<animations:OpacityAnimation To="0"
Duration="0:0:0.01" />
</animations:Implicit.HideAnimations>
@ -220,8 +229,11 @@
To="0"
Duration="0:0:0.3" />
</animations:Implicit.ShowAnimations>
-->
</Border>
<!--
UNO TODO https://github.com/unoplatform/uno/issues/5376
<animations:Implicit.ShowAnimations>
<animations:OpacityAnimation Delay="0:0:0.2"
From="0"
@ -232,10 +244,13 @@
To="0"
Duration="0:0:0.3" />
</animations:Implicit.ShowAnimations>
-->
</StackPanel>
</Grid>
</Grid>
<!--
UNO TODO https://github.com/unoplatform/uno/issues/5376
<animations:Implicit.ShowAnimations>
<animations:OpacityAnimation From="0"
To="1"
@ -252,6 +267,7 @@
To="0.5"
Duration="0:0:0.2" />
</animations:Implicit.HideAnimations>
-->
</Grid>
</Canvas>
</Grid>

Просмотреть файл

@ -12,16 +12,6 @@ using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Navigation;
#if HAS_UNO
using NavigationView = Windows.UI.Xaml.Controls.NavigationView;
using NavigationViewItemInvokedEventArgs = Windows.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs;
using NavigationViewBackRequestedEventArgs = Windows.UI.Xaml.Controls.NavigationViewBackRequestedEventArgs;
#else
using NavigationView = Microsoft.UI.Xaml.Controls.NavigationView;
using NavigationViewItemInvokedEventArgs = Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs;
using NavigationViewBackRequestedEventArgs = Microsoft.UI.Xaml.Controls.NavigationViewBackRequestedEventArgs;
#endif
namespace Microsoft.Toolkit.Uwp.SampleApp
{
public sealed partial class Shell
@ -137,7 +127,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
System.Console.WriteLine($"Done navigating");
}
private void NavView_BackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
private void NavView_BackRequested(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewBackRequestedEventArgs args)
{
if (NavigationFrame.CanGoBack)
{

Просмотреть файл

@ -902,488 +902,7 @@
<Setter Property="FontWeight" Value="Bold" />
</Style>
<!--
UNO TODO
<Style x:Key="ToolkitNavViewStyle" TargetType="winui:NavigationView">
<Setter Property="PaneToggleButtonStyle" Value="{StaticResource PaneToggleButtonStyle}" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="CompactPaneLength" Value="{ThemeResource NavigationViewCompactPaneLength}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="winui:NavigationView">
<Grid x:Name="RootGrid">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="DisplayModeGroup">
<VisualState x:Name="Compact" />
<VisualState x:Name="Expanded">
<VisualState.Setters>
<Setter Target="RootSplitView.PaneBackground" Value="{ThemeResource NavigationViewExpandedPaneBackground}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Minimal">
<VisualState.Setters>
<Setter Target="HeaderContent.Margin" Value="48,5,0,0" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="MinimalWithBackButton">
<VisualState.Setters>
<Setter Target="HeaderContent.Margin" Value="104,5,0,0" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="TogglePaneGroup">
<VisualState x:Name="TogglePaneButtonVisible" />
<VisualState x:Name="TogglePaneButtonCollapsed">
<VisualState.Setters>
<Setter Target="PaneContentGridToggleButtonRow.Height" Value="4" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="HeaderGroup">
<VisualState x:Name="HeaderVisible" />
<VisualState x:Name="HeaderCollapsed">
<VisualState.Setters>
<Setter Target="HeaderContent.Visibility" Value="Collapsed" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="SettingsGroup">
<VisualState x:Name="SettingsVisible" />
<VisualState x:Name="SettingsCollapsed">
<VisualState.Setters>
<Setter Target="SettingsNavPaneItem.Visibility" Value="Collapsed" />
<Setter Target="SettingsTopNavPaneItem.Visibility" Value="Collapsed" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="AutoSuggestGroup">
<VisualState x:Name="AutoSuggestBoxVisible" />
<VisualState x:Name="AutoSuggestBoxCollapsed">
<VisualState.Setters>
<Setter Target="AutoSuggestArea.Visibility" Value="Collapsed" />
<Setter Target="TopPaneAutoSuggestArea.Visibility" Value="Collapsed" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="PaneStateGroup">
<VisualState x:Name="NotClosedCompact" />
<VisualState x:Name="ClosedCompact">
<VisualState.Setters>
<Setter Target="PaneAutoSuggestBoxPresenter.Visibility" Value="Collapsed" />
<Setter Target="PaneAutoSuggestButton.Visibility" Value="Visible" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="PaneStateListSizeGroup">
<VisualState x:Name="ListSizeFull" />
<VisualState x:Name="ListSizeCompact">
<VisualState.Setters>
<Setter Target="MenuItemsHost.HorizontalAlignment" Value="Left" />
--><!-- This is essentially a TemplateBinding: --><!--
<Setter Target="MenuItemsHost.Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CompactPaneLength}" />
<Setter Target="SettingsNavPaneItem.HorizontalAlignment" Value="Left" />
<Setter Target="SettingsNavPaneItem.Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CompactPaneLength}" />
<Setter Target="PaneTitleTextBlock.Visibility" Value="Collapsed" />
<Setter Target="PaneHeaderContentBorder.Visibility" Value="Collapsed" />
<Setter Target="PaneCustomContentBorder.HorizontalAlignment" Value="Left" />
<Setter Target="PaneCustomContentBorder.Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CompactPaneLength}" />
<Setter Target="FooterContentBorder.HorizontalAlignment" Value="Left" />
<Setter Target="FooterContentBorder.Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CompactPaneLength}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="TitleBarVisibilityGroup">
<VisualState x:Name="TitleBarVisible" />
<VisualState x:Name="TitleBarCollapsed">
<VisualState.Setters>
<Setter Target="PaneContentGrid.Margin" Value="0,32,0,0" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="OverflowLabelGroup">
<VisualState x:Name="OverflowButtonWithLabel" />
<VisualState x:Name="OverflowButtonNoLabel">
<VisualState.Setters>
<Setter Target="TopNavOverflowButton.Style" Value="{ThemeResource NavigationViewOverflowButtonNoLabelStyleWhenPaneOnTop}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="BackButtonGroup">
<VisualState x:Name="BackButtonVisible" />
<VisualState x:Name="BackButtonCollapsed">
<VisualState.Setters>
<Setter Target="BackButtonPlaceholderOnTopNav.Width" Value="0" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid
x:Name="PaneToggleButtonGrid"
Margin="0,0,0,8"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Canvas.ZIndex="100">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid x:Name="ButtonHolderGrid" Grid.Row="1">
<Button x:Name="NavigationViewBackButton"
Height="48"
Style="{StaticResource NavigationBackButtonNormalStyle}"
VerticalAlignment="Center"
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.BackButtonVisibility}"
IsEnabled="{TemplateBinding IsBackEnabled}"/>
<Button
x:Name="TogglePaneButton"
Style="{TemplateBinding PaneToggleButtonStyle}"
AutomationProperties.LandmarkType="Navigation"
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneToggleButtonVisibility}"
VerticalAlignment="Center"/>
</Grid>
</Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel
x:Name="TopNavArea"
Background="{ThemeResource Background-NavigationBar}"
Grid.Row="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Canvas.ZIndex="1">
<Grid x:Name="TopNavTopPadding"
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}"
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPaneVisibility}"/>
<Grid x:Name="TopNavGrid"
Height="48"
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPaneVisibility}">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="BackButtonPlaceholderOnTopNav" Width="{ThemeResource NavigationBackButtonWidth}" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
--><!-- removed MinWidth to work around https://github.com/unoplatform/uno/issues/1535 --><!--
<ColumnDefinition Width="*" /> --><!-- MinWidth="48" --><!--
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid
x:Name="TopNavLeftPadding"
Grid.Column="1"
Width="0"/>
<ContentControl
x:Name="PaneHeaderOnTopPane"
IsTabStop="False"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Grid.Column="2"/>
--><!-- Top nav list --><!--
<winui:ItemsRepeaterScrollHost
AutomationProperties.LandmarkType="Navigation"
Grid.Column="3"
ScrollViewer.HorizontalScrollMode="Disabled"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollMode="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Hidden">
<ScrollViewer
HorizontalScrollMode="Disabled"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollMode="Disabled"
VerticalScrollBarVisibility="Hidden">
<winui:ItemsRepeater
x:Name="TopNavMenuItemsHost"
ItemTemplate="{TemplateBinding MenuItemTemplateSelector}"
AutomationProperties.LandmarkType="Navigation"
AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"
AutomationProperties.AccessibilityView = "Content">
<winui:ItemsRepeater.Layout>
<winui:StackLayout Orientation="Horizontal"/>
</winui:ItemsRepeater.Layout>
</winui:ItemsRepeater>
</ScrollViewer>
</winui:ItemsRepeaterScrollHost>
<winui:NavigationViewList AutomationProperties.LandmarkType="Navigation" x:Name="TopNavMenuItemsHost" Grid.Column="3" SelectionMode="Single" IsItemClickEnabled="True" ItemTemplate="{TemplateBinding MenuItemTemplate}" ItemTemplateSelector="{TemplateBinding MenuItemTemplateSelector}" ItemContainerStyle="{TemplateBinding MenuItemContainerStyle}" ItemContainerStyleSelector="{TemplateBinding MenuItemContainerStyleSelector}" ScrollViewer.HorizontalScrollMode="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollMode="Disabled" ScrollViewer.VerticalScrollBarVisibility="Hidden" SingleSelectionFollowsFocus="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SingleSelectionFollowsFocus}">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
--><!--Use a StackPanel instead of a ItemsStackPanel to workaround https://github.com/unoplatform/uno/issues/2136--><!--
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemContainerTransitions>
<TransitionCollection />
</ListView.ItemContainerTransitions>
</winui:NavigationViewList>
<Button
x:Name="TopNavOverflowButton"
Grid.Column="4"
Content="More"
FontFamily="Segoe UI"
FontSize="15px"
FontWeight="Normal"
VerticalAlignment="Center"
Style="{StaticResource NavigationViewOverflowButtonStyleWhenPaneOnTop}"
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.OverflowButtonVisibility}">
<Button.Flyout>
<Flyout Placement="Bottom">
<Flyout.FlyoutPresenterStyle>
<Style TargetType="FlyoutPresenter">
<Setter Property="Padding" Value="0,8" />
--><!-- Set negative top margin to make the flyout align exactly with the button --><!--
<Setter Property="Margin" Value="0,-4,0,0" />
</Style>
</Flyout.FlyoutPresenterStyle>
<winui:ItemsRepeaterScrollHost>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<winui:ItemsRepeater
x:Name="TopNavMenuItemsOverflowHost"
ItemTemplate="{TemplateBinding MenuItemTemplateSelector}"
AutomationProperties.AccessibilityView = "Content">
<winui:ItemsRepeater.Layout>
<winui:StackLayout Orientation="Vertical"/>
</winui:ItemsRepeater.Layout>
</winui:ItemsRepeater>
</ScrollViewer>
</winui:ItemsRepeaterScrollHost>
</Flyout>
</Button.Flyout>
</Button>
<ContentControl
x:Name="PaneCustomContentOnTopPane"
IsTabStop="False"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Grid.Column="5"/>
<Grid
x:Name="TopPaneAutoSuggestArea"
Height="{ThemeResource NavigationViewTopPaneHeight}"
Grid.Column="6">
<ContentControl
x:Name="TopPaneAutoSuggestBoxPresenter"
Margin="12,0,12,0"
MinWidth="200"
IsTabStop="False"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Center"/>
</Grid>
<ContentControl
x:Name="PaneFooterOnTopPane"
IsTabStop="False"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Grid.Column="7" />
--><!-- UNO TODO --><!--
<winui:NavigationViewItem x:Name="SettingsTopNavPaneItem" Grid.Column="8" Icon="Home" />
--><!--<winui:NavigationViewItem x:Name="SettingsTopNavPaneItem" Style="{ThemeResource MUX_NavigationViewSettingsItemStyleWhenOnTopPane}" Grid.Column="8" Icon="Home" />--><!--
</Grid>
<Border Background="{ThemeResource Border-NavigationBar}"
Height="1" />
<Border
x:Name="TopNavContentOverlayAreaGrid"
Child="{TemplateBinding ContentOverlay}" />
</StackPanel>
<SplitView
x:Name="RootSplitView"
Background="{TemplateBinding Background}"
CompactPaneLength="{TemplateBinding CompactPaneLength}"
DisplayMode="Inline"
IsPaneOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPaneOpen, Mode=TwoWay}"
IsTabStop="False"
OpenPaneLength="{TemplateBinding OpenPaneLength}"
PaneBackground="{ThemeResource NavigationViewDefaultPaneBackground}"
Grid.Row="1">
<SplitView.Pane>
<Grid
x:Name="PaneContentGrid"
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.LeftPaneVisibility}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="0" />
--><!-- above button margin + back button space --><!--
<RowDefinition x:Name="PaneContentGridToggleButtonRow" Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="8" />
--><!-- above list margin --><!--
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="8" />
</Grid.RowDefinitions>
<Grid x:Name="ContentPaneTopPadding"
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}"/>
<Grid Grid.Row="2" Height="{StaticResource PaneToggleButtonHeight}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
x:Name="PaneTitleTextBlock"
Grid.Column="0"
Text="{TemplateBinding PaneTitle}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Style="{StaticResource NavigationViewItemHeaderTextStyle}"/>
<ContentControl
x:Name="PaneHeaderContentBorder"
IsTabStop="False"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Grid.Column="1" />
</Grid>
<Grid
x:Name="AutoSuggestArea"
Grid.Row="3"
Height="{ThemeResource NavigationViewTopPaneHeight}"
VerticalAlignment="Center">
<ContentControl
x:Name="PaneAutoSuggestBoxPresenter"
Margin="{ThemeResource NavigationViewAutoSuggestBoxMargin}"
IsTabStop="False"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Center"/>
<Button
x:Name="PaneAutoSuggestButton"
Visibility="Collapsed"
Style="{ThemeResource NavigationViewPaneSearchButtonStyle}"
Width="{TemplateBinding CompactPaneLength}"/>
</Grid>
<ContentControl
x:Name="PaneCustomContentBorder"
IsTabStop="False"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Grid.Row="4" />
--><!-- Left nav list --><!--
<winui:ItemsRepeaterScrollHost
Grid.Row="6"
Margin="0,0,0,20"
HorizontalAlignment="Stretch"
VerticalAlignment="Top">
<ScrollViewer
TabNavigation="Once"
VerticalScrollBarVisibility="Auto">
<winui:ItemsRepeater
x:Name="MenuItemsHost"
ItemTemplate="{TemplateBinding MenuItemTemplateSelector}"
AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"
AutomationProperties.AccessibilityView = "Content">
<winui:ItemsRepeater.Layout>
<winui:StackLayout Orientation="Vertical"/>
</winui:ItemsRepeater.Layout>
</winui:ItemsRepeater>
</ScrollViewer>
</winui:ItemsRepeaterScrollHost>
<ContentControl
x:Name="FooterContentBorder"
IsTabStop="False"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Grid.Row="7" />
<winui:NavigationViewItem x:Name="SettingsNavPaneItem" Grid.Row="8" Icon="Setting" />
</Grid>
</SplitView.Pane>
<SplitView.Content>
<Grid x:Name="ContentGrid">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentControl
x:Name="HeaderContent"
MinHeight="{StaticResource PaneToggleButtonHeight}"
IsTabStop="False"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Style="{StaticResource NavigationViewTitleHeaderContentControlTextStyle}"/>
<ContentPresenter
AutomationProperties.LandmarkType="Main"
Grid.Row="1"
Content="{TemplateBinding Content}"/>
</Grid>
</SplitView.Content>
</SplitView>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
-->
<Style x:Key="ToolkitNavViewStyle" TargetType="winui:NavigationView">
<Style x:Key="ToolkitNavViewStyle" TargetType="winui:NavigationView">
<Setter Property="PaneToggleButtonStyle" Value="{StaticResource PaneToggleButtonStyle}" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="CompactPaneLength" Value="{ThemeResource NavigationViewCompactPaneLength}" />
@ -1579,8 +1098,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<!-- removed MinWidth to work around https://github.com/unoplatform/uno/issues/1535 -->
<ColumnDefinition Width="*" /> <!-- MinWidth="48" -->
<ColumnDefinition Width="*" MinWidth="48" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
@ -1599,17 +1117,30 @@
Grid.Column="2"/>
<!-- Top nav list -->
<winui:NavigationViewList AutomationProperties.LandmarkType="Navigation" x:Name="TopNavMenuItemsHost" Grid.Column="3" SelectionMode="Single" IsItemClickEnabled="True" ItemTemplate="{TemplateBinding MenuItemTemplate}" ItemTemplateSelector="{TemplateBinding MenuItemTemplateSelector}" ItemContainerStyle="{TemplateBinding MenuItemContainerStyle}" ItemContainerStyleSelector="{TemplateBinding MenuItemContainerStyleSelector}" ScrollViewer.HorizontalScrollMode="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollMode="Disabled" ScrollViewer.VerticalScrollBarVisibility="Hidden" SingleSelectionFollowsFocus="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SingleSelectionFollowsFocus}">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<!--Use a StackPanel instead of a ItemsStackPanel to workaround https://github.com/unoplatform/uno/issues/2136-->
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemContainerTransitions>
<TransitionCollection />
</ListView.ItemContainerTransitions>
</winui:NavigationViewList>
<winui:ItemsRepeaterScrollHost
AutomationProperties.LandmarkType="Navigation"
Grid.Column="3"
ScrollViewer.HorizontalScrollMode="Disabled"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollMode="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Hidden">
<ScrollViewer
HorizontalScrollMode="Disabled"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollMode="Disabled"
VerticalScrollBarVisibility="Hidden">
<winui:ItemsRepeater
x:Name="TopNavMenuItemsHost"
ItemTemplate="{TemplateBinding MenuItemTemplateSelector}"
AutomationProperties.LandmarkType="Navigation"
AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"
AutomationProperties.AccessibilityView = "Content">
<winui:ItemsRepeater.Layout>
<winui:StackLayout Orientation="Horizontal"/>
</winui:ItemsRepeater.Layout>
</winui:ItemsRepeater>
</ScrollViewer>
</winui:ItemsRepeaterScrollHost>
<Button
x:Name="TopNavOverflowButton"
@ -1631,11 +1162,18 @@
<Setter Property="Margin" Value="0,-4,0,0" />
</Style>
</Flyout.FlyoutPresenterStyle>
<winui:NavigationViewList x:Name="TopNavMenuItemsOverflowHost" ItemTemplate="{TemplateBinding MenuItemTemplate}" ItemTemplateSelector="{TemplateBinding MenuItemTemplateSelector}" ItemContainerStyle="{TemplateBinding MenuItemContainerStyle}" ItemContainerStyleSelector="{TemplateBinding MenuItemContainerStyleSelector}" SingleSelectionFollowsFocus="False" IsItemClickEnabled="True">
<ListView.ItemContainerTransitions>
<TransitionCollection />
</ListView.ItemContainerTransitions>
</winui:NavigationViewList>
<winui:ItemsRepeaterScrollHost>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<winui:ItemsRepeater
x:Name="TopNavMenuItemsOverflowHost"
ItemTemplate="{TemplateBinding MenuItemTemplateSelector}"
AutomationProperties.AccessibilityView = "Content">
<winui:ItemsRepeater.Layout>
<winui:StackLayout Orientation="Vertical"/>
</winui:ItemsRepeater.Layout>
</winui:ItemsRepeater>
</ScrollViewer>
</winui:ItemsRepeaterScrollHost>
</Flyout>
</Button.Flyout>
</Button>
@ -1667,9 +1205,7 @@
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Grid.Column="7" />
<!-- UNO TODO -->
<winui:NavigationViewItem x:Name="SettingsTopNavPaneItem" Grid.Column="8" Icon="Home" />
<!--<winui:NavigationViewItem x:Name="SettingsTopNavPaneItem" Style="{ThemeResource MUX_NavigationViewSettingsItemStyleWhenOnTopPane}" Grid.Column="8" Icon="Home" />-->
<winui:NavigationViewItem x:Name="SettingsTopNavPaneItem" Style="{ThemeResource MUX_NavigationViewSettingsItemStyleWhenOnTopPane}" Grid.Column="8" Icon="Home" />
</Grid>
@ -1765,7 +1301,25 @@
Grid.Row="4" />
<!-- Left nav list -->
<winui:NavigationViewList x:Name="MenuItemsHost" Grid.Row="6" SingleSelectionFollowsFocus="False" Margin="0,0,0,20" SelectionMode="Single" IsItemClickEnabled="True" HorizontalAlignment="Stretch" SelectedItem="{TemplateBinding SelectedItem}" ItemTemplate="{TemplateBinding MenuItemTemplate}" ItemTemplateSelector="{TemplateBinding MenuItemTemplateSelector}" ItemContainerStyle="{TemplateBinding MenuItemContainerStyle}" ItemContainerStyleSelector="{TemplateBinding MenuItemContainerStyleSelector}" />
<winui:ItemsRepeaterScrollHost
Grid.Row="6"
Margin="0,0,0,20"
HorizontalAlignment="Stretch"
VerticalAlignment="Top">
<ScrollViewer
TabNavigation="Once"
VerticalScrollBarVisibility="Auto">
<winui:ItemsRepeater
x:Name="MenuItemsHost"
ItemTemplate="{TemplateBinding MenuItemTemplateSelector}"
AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"
AutomationProperties.AccessibilityView = "Content">
<winui:ItemsRepeater.Layout>
<winui:StackLayout Orientation="Vertical"/>
</winui:ItemsRepeater.Layout>
</winui:ItemsRepeater>
</ScrollViewer>
</winui:ItemsRepeaterScrollHost>
<ContentControl
x:Name="FooterContentBorder"

Просмотреть файл

@ -58,6 +58,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.Styles
FallbackColor = Helpers.ColorHelper.ToColor("#FFDDDDDD")
}
});
#endif
}
#if !HAS_UNO

Просмотреть файл

@ -48,7 +48,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
// We can retrieve the total duration from the last timed keyframe, and then set
// this as the target duration and use it to normalize the keyframe progresses.
ArraySegment<KeyFrameInfo> keyFrames = this.keyFrames.GetArraySegment();
TimeSpan duration = keyFrames[keyFrames.Count - 1].GetTimedProgress(default);
TimeSpan duration = keyFrames.Array[keyFrames.Count - 1].GetTimedProgress(default);
return NormalizedKeyFrameAnimationBuilder<T>.GetAnimation(
targetHint,

Просмотреть файл

@ -4,6 +4,7 @@
using System;
using System.Runtime.CompilerServices;
using Microsoft.Toolkit.Extensions;
using Microsoft.Toolkit.Uwp.UI.Animations.Builders.Helpers;
using Windows.UI.Composition;
using Windows.UI.Xaml.Media.Animation;
@ -172,7 +173,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float GetNormalizedProgress(TimeSpan duration)
{
return (float)Math.Clamp(this.progress.TotalMilliseconds * 100 / duration.TotalMilliseconds, 0, 1);
return (float)MathEx.Clamp(this.progress.TotalMilliseconds * 100 / duration.TotalMilliseconds, 0, 1);
}
/// <inheritdoc/>

Просмотреть файл

@ -130,6 +130,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
private static void OnShowAnimationsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
#if !HAS_UNO
static void OnAnimationsChanged(IObservableVector<DependencyObject> sender, IVectorChangedEventArgs args)
{
var collection = (ImplicitAnimationSet)sender;
@ -199,6 +200,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
private static void OnAnimationsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
#if !HAS_UNO
static void OnAnimationsChanged(IObservableVector<DependencyObject> sender, IVectorChangedEventArgs args)
{
var collection = (ImplicitAnimationSet)sender;
@ -224,6 +226,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
ElementCompositionPreview.SetIsTranslationEnabled(element, true);
ElementCompositionPreview.GetElementVisual(element).ImplicitAnimations = collection.GetImplicitAnimationCollection();
}
#endif
}
}
}

Просмотреть файл

@ -4,6 +4,7 @@
using System;
using Windows.ApplicationModel;
using Windows.Foundation.Metadata;
using Windows.UI.Composition;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@ -18,6 +19,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// </summary>
public static class ItemsReorderAnimation
{
private static bool IsSupported { get; } = ApiInformation.IsMethodPresent("Windows.UI.Composition.Compositor", "CreateDropShadow");
/// <summary>
/// Identifies the attached "Duration" <see cref="DependencyProperty"/>.
/// </summary>
@ -63,7 +67,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
private static void OnDurationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (DesignMode.DesignModeEnabled)
if (DesignMode.DesignModeEnabled || !IsSupported)
{
return;
}

Просмотреть файл

@ -23,7 +23,7 @@
</ItemGroup>
<!-- BEGIN UNO SPECIFIC -->
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0.17763'">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Win2D.uwp" Version="1.25.0" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.1" />
@ -36,7 +36,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI" Version="3.0.0-dev.1549" />
<PackageReference Include="Uno.UI" Version="3.4.0" />
<Compile Remove="Effects\Blur.cs" />
<Compile Remove="Effects\Saturation.cs" />

Просмотреть файл

@ -4,4 +4,6 @@
using System.Runtime.CompilerServices;
#if !HAS_UNO
[assembly: InternalsVisibleTo("Microsoft.Toolkit.Uwp.UI.Media")]
#endif

Просмотреть файл

@ -11,7 +11,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <summary>
/// A base model representing an animation that can be used in XAML.
/// </summary>
public abstract class Animation : DependencyObject, ITimeline
public abstract partial class Animation : DependencyObject, ITimeline
{
/// <summary>
/// Gets or sets the optional initial delay for the animation.

Просмотреть файл

@ -10,6 +10,13 @@ using static Microsoft.Toolkit.Uwp.UI.Animations.AnimationExtensions;
namespace Microsoft.Toolkit.Uwp.UI.Animations
{
/// <summary>
/// A base model representing a key frame for Uno Platform compatibility
/// </summary>
public abstract partial class KeyFrame : DependencyObject
{
}
/// <summary>
/// A base model representing a typed keyframe that can be used in XAML.
/// </summary>
@ -18,7 +25,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// This can differ from <typeparamref name="TKeyFrame"/> to facilitate XAML parsing.
/// </typeparam>
/// <typeparam name="TKeyFrame">The actual type of keyframe values in use.</typeparam>
public abstract class KeyFrame<TValue, TKeyFrame> : DependencyObject, IKeyFrame<TKeyFrame>
public abstract partial class KeyFrame<TValue, TKeyFrame> : KeyFrame, IKeyFrame<TKeyFrame>
{
/// <summary>
/// Gets or sets the key time for the current keyframe. This is a normalized

Просмотреть файл

@ -12,7 +12,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <summary>
/// Base class to use when creating activities which accept a <see cref="Delay"/>.
/// </summary>
public abstract class Activity : DependencyObject, IActivity
public abstract partial class Activity : DependencyObject, IActivity
{
/// <summary>
/// Gets or sets the <see cref="TimeSpan"/> to wait before running the activity.

Просмотреть файл

@ -14,7 +14,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <summary>
/// A collection of animations that can be defined from XAML.
/// </summary>
public sealed class AnimationDictionary : DependencyObject, IList<AnimationSet>
public sealed partial class AnimationDictionary : DependencyObject, IList<AnimationSet>
{
/// <summary>
/// The underlying list of animations.

Просмотреть файл

@ -98,7 +98,12 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
CancellationTokenSource cancellationTokenSource = new();
#if HAS_UNO
this.cancellationTokenMap.Remove(element);
this.cancellationTokenMap.Add(element, cancellationTokenSource);
#else
this.cancellationTokenMap.AddOrUpdate(element, cancellationTokenSource);
#endif
return StartAsync(element, cancellationTokenSource.Token);
}

Просмотреть файл

@ -12,7 +12,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Behaviors
/// <summary>
/// An <see cref="IAction"/> implementation that can trigger a target <see cref="AnimationSet"/> instance.
/// </summary>
public sealed class StartAnimationAction : DependencyObject, IAction
public sealed partial class StartAnimationAction : DependencyObject, IAction
{
/// <summary>
/// Gets or sets the linked <see cref="AnimationSet"/> instance to invoke.

Просмотреть файл

@ -12,7 +12,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Behaviors
/// <summary>
/// An <see cref="IAction"/> implementation that can stop a target <see cref="AnimationSet"/> instance.
/// </summary>
public sealed class StopAnimationAction : DependencyObject, IAction
public sealed partial class StopAnimationAction : DependencyObject, IAction
{
/// <summary>
/// Gets or sets the linked <see cref="AnimationSet"/> instance to stop.

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFramework>uap10.0.17763</TargetFramework>
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<Title>Windows Community Toolkit UI Behaviors</Title>
<Description>
@ -28,4 +28,28 @@
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Animations\Microsoft.Toolkit.Uwp.UI.Animations.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI\Microsoft.Toolkit.Uwp.UI.csproj" />
</ItemGroup>
<!-- BEGIN UNO SPECIFIC -->
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.UI.Behaviors</PackageId>
<!-- Validation fails as the generated document is too big -->
<XamarinAndroidSupportSkipVerifyVersions>true</XamarinAndroidSupportSkipVerifyVersions>
</PropertyGroup>
<ItemGroup>
<PackageReference Remove="Microsoft.Xaml.Behaviors.Uwp.Managed" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI" Version="3.4.0" />
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.2-uno.74" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.17763'">
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.1" />
</ItemGroup>
<!-- END UNO SPECIFIC -->
</Project>

Просмотреть файл

@ -5,6 +5,7 @@
using System;
using System.Numerics;
using System.Threading.Tasks;
using Windows.Foundation.Metadata;
using Windows.UI;
using Windows.UI.Composition;
using Windows.UI.Xaml;
@ -27,6 +28,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private readonly SpriteVisual _shadowVisual;
private Border _border;
private static bool IsSupported { get; } = ApiInformation.IsMethodPresent("Windows.UI.Composition.Compositor", "CreateDropShadow");
/// <summary>
/// Initializes a new instance of the <see cref="DropShadowPanel"/> class.
/// </summary>
@ -34,7 +37,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{
this.DefaultStyleKey = typeof(DropShadowPanel);
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported)
{
Compositor compositor = ElementCompositionPreview.GetElementVisual(this).Compositor;
@ -93,7 +96,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private void OnSizeChanged(object sender, SizeChangedEventArgs e)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported)
{
UpdateShadowSize();
}
@ -103,7 +106,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{
UpdateShadowMask();
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported)
{
UpdateShadowSize();
}
@ -127,7 +130,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private void OnOffsetXChanged(double newValue)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && _dropShadow != null)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && _dropShadow != null)
{
UpdateShadowOffset((float)newValue, _dropShadow.Offset.Y, _dropShadow.Offset.Z);
}
@ -135,7 +138,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private void OnOffsetYChanged(double newValue)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && _dropShadow != null)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && _dropShadow != null)
{
UpdateShadowOffset(_dropShadow.Offset.X, (float)newValue, _dropShadow.Offset.Z);
}
@ -143,7 +146,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private void OnOffsetZChanged(double newValue)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && _dropShadow != null)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && _dropShadow != null)
{
UpdateShadowOffset(_dropShadow.Offset.X, _dropShadow.Offset.Y, (float)newValue);
}
@ -159,7 +162,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private void UpdateShadowMask()
{
if (DesignTimeHelpers.IsRunningInLegacyDesignerMode)
if (DesignTimeHelpers.IsRunningInLegacyDesignerMode || !IsSupported)
{
return;
}

Просмотреть файл

@ -209,9 +209,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
}
else
{
content = Window.Current.Content;
height = Window.Current.Bounds.Height;
width = Window.Current.Bounds.Width;
content = Windows.UI.Xaml.Window.Current.Content;
height = Windows.UI.Xaml.Window.Current.Bounds.Height;
width = Windows.UI.Xaml.Window.Current.Bounds.Width;
}
var ttv = TransformToVisual(content);
@ -311,7 +311,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
internal void CalculateBounds()
{
var ttv = TransformToVisual(ControlHelpers.IsXamlRootAvailable && XamlRoot != null ? XamlRoot.Content : Window.Current.Content);
var ttv = TransformToVisual(ControlHelpers.IsXamlRootAvailable && XamlRoot != null ? XamlRoot.Content : Windows.UI.Xaml.Window.Current.Content);
Point screenCoords = ttv.TransformPoint(new Point(0, 0));
_bounds.X = screenCoords.X;
_bounds.Y = screenCoords.Y;

Просмотреть файл

@ -15,6 +15,10 @@ using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
#if HAS_UNO
using Popup = Windows.UI.Xaml.Controls.Popup;
#endif
namespace Microsoft.Toolkit.Uwp.UI.Controls
{
/// <summary>
@ -188,7 +192,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
}
else
{
content = Window.Current.Content;
content = Windows.UI.Xaml.Window.Current.Content;
}
var ttv = TransformToVisual(content);
@ -366,6 +370,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
UIElement content;
double outerContentWidth;
double outerContentHeight;
#if !HAS_UNO
if (ControlHelpers.IsXamlRootAvailable && MenuFlyout.XamlRoot != null)
{
popups = VisualTreeHelper.GetOpenPopupsForXamlRoot(MenuFlyout.XamlRoot);
@ -374,11 +379,12 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
outerContentHeight = MenuFlyout.XamlRoot.Size.Height;
}
else
#endif
{
popups = VisualTreeHelper.GetOpenPopups(Window.Current);
content = Window.Current.Content;
outerContentWidth = Window.Current.Bounds.Width;
outerContentHeight = Window.Current.Bounds.Height;
popups = VisualTreeHelper.GetOpenPopups(Windows.UI.Xaml.Window.Current);
content = Windows.UI.Xaml.Window.Current.Content;
outerContentWidth = Windows.UI.Xaml.Window.Current.Bounds.Width;
outerContentHeight = Windows.UI.Xaml.Window.Current.Bounds.Height;
}
var popup = popups.FirstOrDefault(p => p.Child is MenuFlyoutPresenter);

Просмотреть файл

@ -45,4 +45,20 @@
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
</Target>
<!-- BEGIN UNO SPECIFIC -->
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.UI.Controls.Core</PackageId>
<!-- Validation fails as the generated document is too big -->
<XamarinAndroidSupportSkipVerifyVersions>true</XamarinAndroidSupportSkipVerifyVersions>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI"
Version="3.4.0" />
</ItemGroup>
<!-- END UNO SPECIFIC -->
</Project>

Просмотреть файл

@ -5,9 +5,11 @@
using System.Resources;
using System.Runtime.CompilerServices;
#if !HAS_UNO
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: InternalsVisibleTo("UnitTests.UWP")]
[assembly: InternalsVisibleTo("UnitTests.XamlIslands.UWPApp")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: NeutralResourcesLanguage("en-US")]
#endif

Просмотреть файл

@ -18,7 +18,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
[TemplatePart(Name = "PART_RibbonContent", Type = typeof(ContentControl))]
[TemplatePart(Name = "PART_RibbonContentBorder", Type = typeof(Border))]
[TemplatePart(Name = "PART_TabChangedStoryboard", Type = typeof(Storyboard))]
public class TabbedCommandBar : NavigationView
public partial class TabbedCommandBar : NavigationView
{
private ContentControl _ribbonContent = null;
private Border _ribbonContentBorder = null;

Просмотреть файл

@ -12,7 +12,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
/// </summary>
[TemplatePart(Name = "PrimaryItemsControl", Type = typeof(ItemsControl))]
[TemplatePart(Name = "MoreButton", Type = typeof(Button))]
public class TabbedCommandBarItem : CommandBar
public partial class TabbedCommandBarItem : CommandBar
{
private ItemsControl _primaryItemsControl;
private Button _moreButton;

Просмотреть файл

@ -230,7 +230,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Automation.Peers
}
}
string name = UI.Controls.Properties.Resources.DataGridRowAutomationPeer_ItemType;
string name = Controls.DG.Properties.Resources.DataGridRowAutomationPeer_ItemType;
#if DEBUG_AUTOMATION
System.Diagnostics.Debug.WriteLine("DataGridItemAutomationPeer.GetNameCore returns " + name);
#endif

Просмотреть файл

@ -795,7 +795,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{
_detailsElement.InvalidateMeasure();
}
#endif
bool currentAddItemIsDataContext = false;
#if FEATURE_IEDITABLECOLLECTIONVIEW

Просмотреть файл

@ -21,7 +21,7 @@
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
<PackageReference Include="Uno.UI" Version="3.0.0-dev.1549" />
<PackageReference Include="Uno.UI" Version="3.4.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'monoandroid10.0' or '$(TargetFramework)' == 'xamarinios10' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">

Просмотреть файл

@ -6,6 +6,7 @@ using System;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Globalization;
using Microsoft.Toolkit.Extensions;
using Microsoft.Toolkit.Uwp.Helpers;
using Microsoft.Toolkit.Uwp.UI.Controls.ColorPickerConverters;
using Windows.UI;
@ -225,7 +226,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
/// <param name="isRequired">Whether the element is required and will throw an exception if missing.</param>
/// <returns>The template child matching the given name and type.</returns>
private T GetTemplateChild<T>(string childName, bool isRequired = false)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : DependencyObject
#endif
{
T child = this.GetTemplateChild(childName) as T;
if ((child == null) && isRequired)
@ -885,26 +890,26 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{
case ColorChannel.Channel1:
{
hue = Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 360);
hue = MathEx.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 360);
break;
}
case ColorChannel.Channel2:
{
saturation = Math.Clamp((double.IsNaN(newValue) ? 0 : newValue) / 100, 0, 1);
saturation = MathEx.Clamp((double.IsNaN(newValue) ? 0 : newValue) / 100, 0, 1);
break;
}
case ColorChannel.Channel3:
{
value = Math.Clamp((double.IsNaN(newValue) ? 0 : newValue) / 100, 0, 1);
value = MathEx.Clamp((double.IsNaN(newValue) ? 0 : newValue) / 100, 0, 1);
break;
}
case ColorChannel.Alpha:
{
// Unlike color channels, default to no transparency
alpha = Math.Clamp((double.IsNaN(newValue) ? 100 : newValue) / 100, 0, 1);
alpha = MathEx.Clamp((double.IsNaN(newValue) ? 100 : newValue) / 100, 0, 1);
break;
}
}
@ -936,26 +941,26 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{
case ColorChannel.Channel1:
{
red = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
red = Convert.ToByte(MathEx.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
break;
}
case ColorChannel.Channel2:
{
green = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
green = Convert.ToByte(MathEx.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
break;
}
case ColorChannel.Channel3:
{
blue = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
blue = Convert.ToByte(MathEx.Clamp(double.IsNaN(newValue) ? 0 : newValue, 0, 255));
break;
}
case ColorChannel.Alpha:
{
// Unlike color channels, default to no transparency
alpha = Convert.ToByte(Math.Clamp(double.IsNaN(newValue) ? 255 : newValue, 0, 255));
alpha = Convert.ToByte(MathEx.Clamp(double.IsNaN(newValue) ? 255 : newValue, 0, 255));
break;
}
}

Просмотреть файл

@ -6,6 +6,7 @@ using System;
using System.IO;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading.Tasks;
using Microsoft.Toolkit.Extensions;
using Microsoft.Toolkit.Uwp.Helpers;
using Windows.UI;
using Windows.UI.Xaml.Controls;
@ -295,7 +296,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{
// Sweep hue
newRgbColor = Uwp.Helpers.ColorHelper.FromHsv(
Math.Clamp(channelValue, 0.0, 360.0),
MathEx.Clamp(channelValue, 0.0, 360.0),
baseHsvColor.S,
baseHsvColor.V,
baseHsvColor.A);
@ -305,7 +306,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
// Sweep red
newRgbColor = new Color
{
R = Convert.ToByte(Math.Clamp(channelValue, 0.0, 255.0)),
R = Convert.ToByte(MathEx.Clamp(channelValue, 0.0, 255.0)),
G = baseRgbColor.G,
B = baseRgbColor.B,
A = baseRgbColor.A
@ -322,7 +323,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
// Sweep saturation
newRgbColor = Uwp.Helpers.ColorHelper.FromHsv(
baseHsvColor.H,
Math.Clamp(channelValue, 0.0, 1.0),
MathEx.Clamp(channelValue, 0.0, 1.0),
baseHsvColor.V,
baseHsvColor.A);
}
@ -332,7 +333,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
newRgbColor = new Color
{
R = baseRgbColor.R,
G = Convert.ToByte(Math.Clamp(channelValue, 0.0, 255.0)),
G = Convert.ToByte(MathEx.Clamp(channelValue, 0.0, 255.0)),
B = baseRgbColor.B,
A = baseRgbColor.A
};
@ -349,7 +350,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
newRgbColor = Uwp.Helpers.ColorHelper.FromHsv(
baseHsvColor.H,
baseHsvColor.S,
Math.Clamp(channelValue, 0.0, 1.0),
MathEx.Clamp(channelValue, 0.0, 1.0),
baseHsvColor.A);
}
else
@ -359,7 +360,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{
R = baseRgbColor.R,
G = baseRgbColor.G,
B = Convert.ToByte(Math.Clamp(channelValue, 0.0, 255.0)),
B = Convert.ToByte(MathEx.Clamp(channelValue, 0.0, 255.0)),
A = baseRgbColor.A
};
}
@ -376,7 +377,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
baseHsvColor.H,
baseHsvColor.S,
baseHsvColor.V,
Math.Clamp(channelValue, 0.0, 1.0));
MathEx.Clamp(channelValue, 0.0, 1.0));
}
else
{
@ -386,7 +387,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
R = baseRgbColor.R,
G = baseRgbColor.G,
B = baseRgbColor.B,
A = Convert.ToByte(Math.Clamp(channelValue, 0.0, 255.0))
A = Convert.ToByte(MathEx.Clamp(channelValue, 0.0, 255.0))
};
}

Просмотреть файл

@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System;
using Microsoft.Toolkit.Extensions;
using Microsoft.Toolkit.Uwp.Helpers;
using Microsoft.Toolkit.Uwp.UI.Controls.ColorPickerConverters;
using Windows.Foundation;
@ -83,7 +84,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Primitives
{
case ColorChannel.Channel1:
{
var channelValue = Math.Clamp(sliderPercent * 360.0, 0.0, 360.0);
var channelValue = MathEx.Clamp(sliderPercent * 360.0, 0.0, 360.0);
hsvColor = new HsvColor()
{
@ -97,7 +98,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Primitives
case ColorChannel.Channel2:
{
var channelValue = Math.Clamp(sliderPercent * 1.0, 0.0, 1.0);
var channelValue = MathEx.Clamp(sliderPercent * 1.0, 0.0, 1.0);
hsvColor = new HsvColor()
{
@ -111,7 +112,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Primitives
case ColorChannel.Channel3:
{
var channelValue = Math.Clamp(sliderPercent * 1.0, 0.0, 1.0);
var channelValue = MathEx.Clamp(sliderPercent * 1.0, 0.0, 1.0);
hsvColor = new HsvColor()
{
@ -144,7 +145,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Primitives
};
}
byte channelValue = Convert.ToByte(Math.Clamp(sliderPercent * 255.0, 0.0, 255.0));
byte channelValue = Convert.ToByte(MathEx.Clamp(sliderPercent * 255.0, 0.0, 255.0));
switch (this.ColorChannel)
{

Просмотреть файл

@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System;
using Microsoft.Toolkit.Extensions;
using Microsoft.Toolkit.Uwp.Helpers;
using Windows.UI;
using Windows.UI.Xaml.Data;
@ -105,10 +106,10 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.ColorPickerConverters
}
return Uwp.Helpers.ColorHelper.FromHsv(
Math.Clamp(colorHue, 0.0, 360.0),
Math.Clamp(colorSaturation, 0.0, 1.0),
Math.Clamp(colorValue, 0.0, 1.0),
Math.Clamp(colorAlpha, 0.0, 1.0));
MathEx.Clamp(colorHue, 0.0, 360.0),
MathEx.Clamp(colorSaturation, 0.0, 1.0),
MathEx.Clamp(colorValue, 0.0, 1.0),
MathEx.Clamp(colorAlpha, 0.0, 1.0));
}
}

Просмотреть файл

@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.Toolkit.Extensions;
using System;
using Color = Windows.UI.Color; // Type can be changed to CoreColor, etc.
@ -168,8 +169,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
int shadeIndex)
{
return colorChart[
Math.Clamp(colorIndex, 0, colorChart.GetLength(0)),
Math.Clamp(shadeIndex, 0, colorChart.GetLength(1))];
MathEx.Clamp(colorIndex, 0, colorChart.GetLength(0)),
MathEx.Clamp(shadeIndex, 0, colorChart.GetLength(1))];
}
}
}

Просмотреть файл

@ -42,4 +42,21 @@
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
</Target>
<!-- BEGIN UNO SPECIFIC -->
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.UI.Controls.Input</PackageId>
<!-- Validation fails as the generated document is too big -->
<XamarinAndroidSupportSkipVerifyVersions>true</XamarinAndroidSupportSkipVerifyVersions>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI"
Version="3.4.0" />
</ItemGroup>
<!-- END UNO SPECIFIC -->
</Project>

Просмотреть файл

@ -5,9 +5,11 @@
using System.Resources;
using System.Runtime.CompilerServices;
#if !HAS_UNO
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: InternalsVisibleTo("UnitTests.UWP")]
[assembly: InternalsVisibleTo("UnitTests.XamlIslands.UWPApp")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: NeutralResourcesLanguage("en-US")]
#endif

Просмотреть файл

@ -73,19 +73,17 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
for (int i = 0; i < Children.Count; i++)
{
// UNO TODO
if (Children[i] is UIElement child)
var child = Children[i];
var rect = child.TransformToVisual(this).TransformBounds(new Rect(0, 0, child.DesiredSize.Width, child.DesiredSize.Height));
if (!(position.X >= rect.Left && position.X <= rect.Right && position.Y >= rect.Top && position.Y <= rect.Bottom))
{
var rect = child.TransformToVisual(this).TransformBounds(new Rect(0, 0, child.DesiredSize.Width, child.DesiredSize.Height));
if (!(position.X >= rect.Left && position.X <= rect.Right && position.Y >= rect.Top && position.Y <= rect.Bottom))
{
continue;
}
Carousel.SelectedIndex = i;
continue;
}
Carousel.SelectedIndex = i;
return;
}
}
@ -99,39 +97,36 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
for (int i = 0; i < Children.Count; i++)
{
// UNO TODO
if (Children[i] is UIElement item)
var item = Children[i];
var delta = Carousel.Orientation == Orientation.Horizontal ? e.Delta.Translation.X : e.Delta.Translation.Y;
var itemLength = Carousel.Orientation == Orientation.Horizontal ? item.DesiredSize.Width : item.DesiredSize.Height;
var proj = GetProjectionFromManipulation(item, delta);
ApplyProjection(item, proj);
// We have to take care of the first and last items when manipulating
if ((i == 0 && proj.Position > itemLength / 2) || (i == Children.Count - 1 && proj.Position < -itemLength))
{
var delta = Carousel.Orientation == Orientation.Horizontal ? e.Delta.Translation.X : e.Delta.Translation.Y;
var itemLength = Carousel.Orientation == Orientation.Horizontal ? item.DesiredSize.Width : item.DesiredSize.Height;
e.Handled = true;
e.Complete();
Carousel.SelectedIndex = i;
var proj = GetProjectionFromManipulation(item, delta);
ApplyProjection(item, proj);
// We have to take care of the first and last items when manipulating
if ((i == 0 && proj.Position > itemLength / 2) || (i == Children.Count - 1 && proj.Position < -itemLength))
// force refresh if we are already on the first / last item
if (previousIndex == i)
{
e.Handled = true;
e.Complete();
Carousel.SelectedIndex = i;
// force refresh if we are already on the first / last item
if (previousIndex == i)
{
UpdatePosition();
}
return;
UpdatePosition();
}
// Calculate the Z index to be sure selected item is over all others
var zindexItemIndex = delta > 0 ? Carousel.SelectedIndex - 1 : Carousel.SelectedIndex + 1;
var deltaFromSelectedIndex = Math.Abs(zindexItemIndex - i);
int zindex = (Children.Count * 100) - deltaFromSelectedIndex;
Canvas.SetZIndex(item, zindex);
return;
}
// Calculate the Z index to be sure selected item is over all others
var zindexItemIndex = delta > 0 ? Carousel.SelectedIndex - 1 : Carousel.SelectedIndex + 1;
var deltaFromSelectedIndex = Math.Abs(zindexItemIndex - i);
int zindex = (Children.Count * 100) - deltaFromSelectedIndex;
Canvas.SetZIndex(item, zindex);
}
e.Handled = true;
@ -150,29 +145,27 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
for (int i = 0; i < Children.Count - 1; i++)
{
// UNO TODO
if (Children[i] is UIElement child)
var child = Children[i];
PlaneProjection projection = child.Projection as PlaneProjection;
CompositeTransform compositeTransform = child.RenderTransform as CompositeTransform;
if (projection == null || compositeTransform == null)
{
PlaneProjection projection = child.Projection as PlaneProjection;
CompositeTransform compositeTransform = child.RenderTransform as CompositeTransform;
continue;
}
if (projection == null || compositeTransform == null)
{
continue;
}
var margin = Carousel.ItemMargin;
var size = Carousel.Orientation == Orientation.Horizontal ? desiredWidth : desiredHeight;
var left = Carousel.Orientation == Orientation.Horizontal ? compositeTransform.TranslateX : compositeTransform.TranslateY;
var right = left + size + margin;
var condition = translation < 0 ? (left > 0) : (right > 0);
var margin = Carousel.ItemMargin;
var size = Carousel.Orientation == Orientation.Horizontal ? desiredWidth : desiredHeight;
var left = Carousel.Orientation == Orientation.Horizontal ? compositeTransform.TranslateX : compositeTransform.TranslateY;
var right = left + size + margin;
var condition = translation < 0 ? (left > 0) : (right > 0);
if (condition)
{
Carousel.SelectedIndex = i;
hasBreak = true;
break;
}
if (condition)
{
Carousel.SelectedIndex = i;
hasBreak = true;
break;
}
}
@ -199,21 +192,19 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
for (int i = 0; i < Children.Count; i++)
{
// UNO TODO
if (Children[i] is UIElement item)
var item = Children[i];
PlaneProjection planeProjection = item.Projection as PlaneProjection;
if (planeProjection == null)
{
PlaneProjection planeProjection = item.Projection as PlaneProjection;
continue;
}
if (planeProjection == null)
{
continue;
}
// Get target projection
var props = GetProjectionFromSelectedIndex(i);
// Get target projection
var props = GetProjectionFromSelectedIndex(i);
// Apply projection
ApplyProjection(item, props, storyboard);
// Apply projection
ApplyProjection(item, props, storyboard);
// Z index and Opacity
var deltaFromSelectedIndex = Math.Abs(Carousel.SelectedIndex - i);

Просмотреть файл

@ -18,7 +18,7 @@
- OrbitView: Positions items in a circle around a center element and supports orbits and anchors.
</Description>
<PackageTags>BladeView Blade Carousel Expander GridSplitter HeaderedContent List Details ListDetails Orbit</PackageTags>
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls</RootNamespace>
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls.Layout</RootNamespace>
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
@ -52,4 +52,21 @@
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
</Target>
<!-- BEGIN UNO SPECIFIC -->
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.UI.Controls.Layout</PackageId>
<!-- Validation fails as the generated document is too big -->
<XamarinAndroidSupportSkipVerifyVersions>true</XamarinAndroidSupportSkipVerifyVersions>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI"
Version="3.4.0" />
</ItemGroup>
<!-- END UNO SPECIFIC -->
</Project>

Просмотреть файл

@ -69,7 +69,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
}
else
{
width = Window.Current.Bounds.Width;
width = Windows.UI.Xaml.Window.Current.Bounds.Width;
}
}
@ -81,7 +81,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
}
else
{
height = Window.Current.Bounds.Height;
height = Windows.UI.Xaml.Window.Current.Bounds.Height;
}
}

Просмотреть файл

@ -7,7 +7,7 @@
</Description>
<PackageTags>UWP Toolkit Windows Controls XAML Markdown MarkdownTextBlock</PackageTags>
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls</RootNamespace>
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls.Markdown</RootNamespace>
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
</PropertyGroup>
@ -17,8 +17,10 @@
<None Include="$(OutDir)\Design\$(MSBuildProjectName).Design*.dll;$(OutDir)\Design\$(MSBuildProjectName).Design*.pdb" Pack="true" PackagePath="lib\$(TargetFramework)\Design" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='uap10.0.17763'">
<PackageReference Include="ColorCode.UWP" Version="2.0.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Core\Microsoft.Toolkit.Uwp.UI.Controls.Core.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI\Microsoft.Toolkit.Uwp.UI.csproj" />
</ItemGroup>
@ -47,4 +49,28 @@
</ItemGroup>
<!--<Message Text="Files After: @(PackagingOutputs)" Importance="high" />-->
</Target>
<!-- BEGIN UNO SPECIFIC -->
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.UI.Controls.Markdown</PackageId>
<!-- Validation fails as the generated document is too big -->
<XamarinAndroidSupportSkipVerifyVersions>true</XamarinAndroidSupportSkipVerifyVersions>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI"
Version="3.4.0" />
<PackageReference Include="Uno.ColorCode.UWP"
Version="2.0.8-gd42a883502" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'monoandroid10.0' or '$(TargetFramework)' == 'xamarinios10' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<!-- END UNO SPECIFIC -->
</Project>

Просмотреть файл

@ -17,7 +17,7 @@
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0.17763'">
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="Win2D.uwp" Version="1.25.0" />
</ItemGroup>
@ -40,4 +40,31 @@
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
</Target>
<!-- BEGIN UNO SPECIFIC -->
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.UI.Controls.Media</PackageId>
<!-- Validation fails as the generated document is too big -->
<XamarinAndroidSupportSkipVerifyVersions>true</XamarinAndroidSupportSkipVerifyVersions>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI"
Version="3.4.0" />
<Page Remove="Eyedropper/**/*.xaml" />
<Page Remove="InfiniteCanvas/**/*.xaml" />
<Page Remove="ImageCropper/**/*.xaml" />
<Compile Remove="Eyedropper/**/*.cs" />
<Compile Remove="InfiniteCanvas/**/*.cs" />
<Compile Remove="ImageCropper/**/*.cs" />
<None Include="Eyedropper/**/*.*" />
<None Include="InfiniteCanvas/**/*.*" />
<None Include="ImageCropper/**/*.*" />
</ItemGroup>
<!-- END UNO SPECIFIC -->
</Project>

Просмотреть файл

@ -4,10 +4,11 @@
using System.Resources;
using System.Runtime.CompilerServices;
#if !HAS_UNO
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: InternalsVisibleTo("UnitTests.UWP")]
[assembly: InternalsVisibleTo("UnitTests.XamlIslands.UWPApp")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: NeutralResourcesLanguage("en-US")]
#endif

Просмотреть файл

@ -43,4 +43,20 @@
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
</Target>
<!-- BEGIN UNO SPECIFIC -->
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.UI.Controls.Primitives</PackageId>
<!-- Validation fails as the generated document is too big -->
<XamarinAndroidSupportSkipVerifyVersions>true</XamarinAndroidSupportSkipVerifyVersions>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI"
Version="3.4.0" />
</ItemGroup>
<!-- END UNO SPECIFIC -->
</Project>

Просмотреть файл

@ -6,15 +6,6 @@
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.UI.Controls</PackageId>
<!-- Validation fails as the generated document is too big -->
<XamarinAndroidSupportSkipVerifyVersions>true</XamarinAndroidSupportSkipVerifyVersions>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Primitives\Microsoft.Toolkit.Uwp.UI.Controls.Primitives.csproj" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Core\Microsoft.Toolkit.Uwp.UI.Controls.Core.csproj" />
@ -26,25 +17,24 @@
</ItemGroup>
<!-- BEGIN UNO SPECIFIC -->
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.UI.Controls</PackageId>
<!-- Validation fails as the generated document is too big -->
<XamarinAndroidSupportSkipVerifyVersions>true</XamarinAndroidSupportSkipVerifyVersions>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI"
Version="3.0.0-dev.1549" />
Version="3.4.0" />
<PackageReference Include="Uno.ColorCode.UWP"
Version="2.0.8-gd42a883502" />
<Page Remove="Eyedropper/**/*.xaml" />
<Page Remove="InfiniteCanvas/**/*.xaml" />
<Page Remove="ImageCropper/**/*.xaml" />
<Compile Remove="Eyedropper/**/*.cs" />
<Compile Remove="InfiniteCanvas/**/*.cs" />
<Compile Remove="ImageCropper/**/*.cs" />
<None Include="Eyedropper/**/*.*" />
<None Include="InfiniteCanvas/**/*.*" />
<None Include="ImageCropper/**/*.*" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.16299'">
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.17763'">
<PackageReference Include="ColorCode.UWP"
Version="2.0.6" />
<PackageReference Include="System.ValueTuple"

Просмотреть файл

@ -16,7 +16,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Media
/// <summary>
/// A base pipeline effect.
/// </summary>
public abstract class PipelineEffect : DependencyObject, IPipelineEffect
public abstract partial class PipelineEffect : DependencyObject, IPipelineEffect
{
/// <inheritdoc/>
public CompositionBrush? Brush { get; private set; }

Просмотреть файл

@ -32,7 +32,18 @@ namespace Microsoft.Toolkit.Uwp.UI.Media
throw new InvalidOperationException($"The key {key} already exists in the current pipeline");
}
#if HAS_UNO
var ret = new Dictionary<TKey, TValue>();
foreach(var pair in a.Concat(b))
{
ret.Add(pair.Key, pair.Value);
}
return ret;
#else
return new Dictionary<TKey, TValue>(a.Concat(b));
#endif
}
/// <summary>

Просмотреть файл

@ -41,7 +41,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Media
[Pure]
public static Uri ToAppxUri(this string path)
{
string prefix = $"ms-appx://{(path.StartsWith('/') ? string.Empty : "/")}";
string prefix = $"ms-appx://{(path.StartsWith("/") ? string.Empty : "/")}";
return new Uri($"{prefix}{path}");
}

Просмотреть файл

@ -6,7 +6,9 @@ using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
#if !HAS_UNO
[assembly: InternalsVisibleTo("UnitTests.UWP")]
#endif
namespace Microsoft.Toolkit.Uwp.UI.Media.Geometry.Core
{

Просмотреть файл

@ -38,7 +38,13 @@ namespace Microsoft.Toolkit.Uwp.UI.Media.Helpers.Cache
// Create a new instance when needed
var fallback = producer(compositor);
#if HAS_UNO
this.cache.Remove(compositor);
this.cache.Add(compositor, new WeakReference<T>(fallback));
#else
this.cache.AddOrUpdate(compositor, new WeakReference<T>(fallback));
#endif
return fallback;
}

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFramework>uap10.0.17763</TargetFramework>
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<Title>Windows Community Toolkit UI Media</Title>
<Description>
@ -46,7 +46,7 @@
<PackageId>Uno.Microsoft.Toolkit.Uwp.UI.Media</PackageId>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='uap10.0.17763'">
<PackageReference Include="Win2D.uwp" Version="1.25.0" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.3" />
</ItemGroup>
@ -54,4 +54,38 @@
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Animations\Microsoft.Toolkit.Uwp.UI.Animations.csproj" />
</ItemGroup>
<!-- BEGIN UNO SPECIFIC -->
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksOverride)</TargetFrameworks>
<NoWarn>$(NoWarn);Uno0001;NU1701</NoWarn>
<PackageId>Uno.Microsoft.Toolkit.Uwp.UI.Media</PackageId>
<!-- Validation fails as the generated document is too big -->
<XamarinAndroidSupportSkipVerifyVersions>true</XamarinAndroidSupportSkipVerifyVersions>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI" Version="3.4.0" />
<Compile Remove="Brushes\**\*.cs" />
<None Include="Brushes\**\*.cs" />
<Compile Remove="Geometry\**\*.cs" />
<None Include="Geometry\**\*.cs" />
<Compile Remove="Pipelines\**\*.cs" />
<None Include="Pipelines\**\*.cs" />
<Compile Remove="Effects\**\*.cs" />
<None Include="Effects\**\*.cs" />
<Compile Remove="Animations\**\*.cs" />
<None Include="Animations\**\*.cs" />
<Compile Remove="Visuals\**\*.cs" />
<None Include="Visuals\**\*.cs" />
<Compile Remove="Helpers\SurfaceLoader*.cs" />
<None Include="Helpers\SurfaceLoader*.cs" />
<Compile Remove="Enums\ImageBlendMode.cs" />
<None Include="Enums\ImageBlendMode.cs" />
<Compile Remove="Extensions\UIElementExtensions.cs" />
<None Include="Extensions\UIElementExtensions.cs" />
</ItemGroup>
<!-- END UNO SPECIFIC -->
</Project>

Просмотреть файл

@ -11,7 +11,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Media
/// <summary>
/// A type responsible for creating <see cref="Visual"/> instances to attach to target elements.
/// </summary>
public abstract class AttachedVisualFactoryBase : DependencyObject
public abstract partial class AttachedVisualFactoryBase : DependencyObject
{
/// <summary>
/// Creates a <see cref="Visual"/> to attach to the target element.

Просмотреть файл

@ -38,7 +38,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="element">The root element.</param>
/// <returns>The descendant that was found, or <see langword="null"/>.</returns>
public static T? FindDescendant<T>(this DependencyObject element)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
PredicateByAny<T> predicateByAny = default;
@ -66,7 +70,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="predicate">The predicatee to use to match the descendant nodes.</param>
/// <returns>The descendant that was found, or <see langword="null"/>.</returns>
public static T? FindDescendant<T>(this DependencyObject element, Func<T, bool> predicate)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
PredicateByFunc<T> predicateByFunc = new(predicate);
@ -83,7 +91,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="predicate">The predicatee to use to match the descendant nodes.</param>
/// <returns>The descendant that was found, or <see langword="null"/>.</returns>
public static T? FindDescendant<T, TState>(this DependencyObject element, TState state, Func<T, TState, bool> predicate)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
PredicateByFunc<T, TState> predicateByFunc = new(state, predicate);
@ -99,7 +111,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="predicate">The predicatee to use to match the descendant nodes.</param>
/// <returns>The descendant that was found, or <see langword="null"/>.</returns>
private static T? FindDescendant<T, TPredicate>(this DependencyObject element, ref TPredicate predicate)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
where TPredicate : struct, IPredicate<T>
{
int childrenCount = VisualTreeHelper.GetChildrenCount(element);
@ -148,7 +164,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="element">The root element.</param>
/// <returns>The descendant (or self) that was found, or <see langword="null"/>.</returns>
public static T? FindDescendantOrSelf<T>(this DependencyObject element)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
if (element is T result)
{
@ -182,7 +202,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="predicate">The predicatee to use to match the descendant nodes.</param>
/// <returns>The descendant (or self) that was found, or <see langword="null"/>.</returns>
public static T? FindDescendantOrSelf<T>(this DependencyObject element, Func<T, bool> predicate)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
if (element is T result && predicate(result))
{
@ -202,7 +226,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="predicate">The predicatee to use to match the descendant nodes.</param>
/// <returns>The descendant (or self) that was found, or <see langword="null"/>.</returns>
public static T? FindDescendantOrSelf<T, TState>(this DependencyObject element, TState state, Func<T, TState, bool> predicate)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
if (element is T result && predicate(result, state))
{
@ -262,7 +290,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="element">The starting element.</param>
/// <returns>The ascendant that was found, or <see langword="null"/>.</returns>
public static T? FindAscendant<T>(this DependencyObject element)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
PredicateByAny<T> predicateByAny = default;
@ -290,7 +322,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="predicate">The predicatee to use to match the ascendant nodes.</param>
/// <returns>The ascendant that was found, or <see langword="null"/>.</returns>
public static T? FindAscendant<T>(this DependencyObject element, Func<T, bool> predicate)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
PredicateByFunc<T> predicateByFunc = new(predicate);
@ -307,7 +343,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="predicate">The predicatee to use to match the ascendant nodes.</param>
/// <returns>The ascendant that was found, or <see langword="null"/>.</returns>
public static T? FindAscendant<T, TState>(this DependencyObject element, TState state, Func<T, TState, bool> predicate)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
PredicateByFunc<T, TState> predicateByFunc = new(state, predicate);
@ -323,7 +363,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="predicate">The predicatee to use to match the ascendant nodes.</param>
/// <returns>The ascendant that was found, or <see langword="null"/>.</returns>
private static T? FindAscendant<T, TPredicate>(this DependencyObject element, ref TPredicate predicate)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
where TPredicate : struct, IPredicate<T>
{
while (true)
@ -368,7 +412,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="element">The starting element.</param>
/// <returns>The ascendant (or self) that was found, or <see langword="null"/>.</returns>
public static T? FindAscendantOrSelf<T>(this DependencyObject element)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
if (element is T result)
{
@ -402,7 +450,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="predicate">The predicatee to use to match the ascendant nodes.</param>
/// <returns>The ascendant (or self) that was found, or <see langword="null"/>.</returns>
public static T? FindAscendantOrSelf<T>(this DependencyObject element, Func<T, bool> predicate)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
if (element is T result && predicate(result))
{
@ -422,7 +474,11 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="predicate">The predicatee to use to match the ascendant nodes.</param>
/// <returns>The ascendant (or self) that was found, or <see langword="null"/>.</returns>
public static T? FindAscendantOrSelf<T, TState>(this DependencyObject element, TState state, Func<T, TState, bool> predicate)
#if HAS_UNO
where T : class, DependencyObject
#else
where T : notnull, DependencyObject
#endif
{
if (element is T result && predicate(result, state))
{

Просмотреть файл

@ -38,7 +38,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Predicates
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Match(FrameworkElement element)
{
return element.Name.Equals(this.name, this.comparisonType);
// UNO TODO https://github.com/unoplatform/uno/issues/2240
return element.Name?.Equals(this.name, this.comparisonType) ?? false;
}
}
}

Просмотреть файл

@ -12,7 +12,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <summary>
/// A model containing options for configuring the Surface Dial support through <see cref="TextBoxExtensions"/>.
/// </summary>
public sealed class SurfaceDialOptions : DependencyObject
public sealed partial class SurfaceDialOptions : DependencyObject
{
/// <summary>
/// Gets an internal cached instance to avoid allocations from <see cref="TextBoxExtensions"/>.

Просмотреть файл

@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.Toolkit.Extensions;
using System;
using Windows.UI.Input;
using Windows.UI.Xaml;
@ -108,7 +109,7 @@ namespace Microsoft.Toolkit.Uwp.UI
if (options.EnableMinMaxValue)
{
number = Math.Clamp(number, options.MinValue, options.MaxValue);
number = MathEx.Clamp(number, options.MinValue, options.MaxValue);
}
}
else

Просмотреть файл

@ -9,6 +9,7 @@ using System.Numerics;
using Windows.UI.Composition;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Hosting;
using Windows.Foundation.Metadata;
namespace Microsoft.Toolkit.Uwp.UI
{
@ -17,6 +18,8 @@ namespace Microsoft.Toolkit.Uwp.UI
/// </summary>
public static class VisualExtensions
{
private static bool IsSupported { get; } = ApiInformation.IsMethodPresent("Windows.UI.Composition.Compositor", "CreateDropShadow");
/// <summary>
/// Converts a <see cref="string"/> to <see cref="Vector2"/>
/// </summary>
@ -188,7 +191,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <returns>A <see cref="Vector2"/> string representation of the <see cref="Visual.AnchorPoint"/></returns>
public static string GetAnchorPoint(DependencyObject obj)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
return GetAnchorPointForElement(element);
}
@ -203,7 +206,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="value">The string representation of the <see cref="Vector2"/> to be set</param>
public static void SetAnchorPoint(DependencyObject obj, string value)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
SetAnchorPointForElement(value, element);
}
@ -218,7 +221,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <returns>A <see cref="Vector3"/> string representation of the <see cref="Visual.CenterPoint"/></returns>
public static string GetCenterPoint(DependencyObject obj)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
return GetCenterPointForElement(element);
}
@ -233,7 +236,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="value">The string representation of the <see cref="Vector3"/> to be set</param>
public static void SetCenterPoint(DependencyObject obj, string value)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
SetCenterPointForElement(value, element);
}
@ -248,7 +251,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <returns>A <see cref="Vector3"/> string representation of the <see cref="Visual.Offset"/></returns>
public static string GetOffset(DependencyObject obj)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
return GetOffsetForElement(element);
}
@ -263,7 +266,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="value">The string representation of the <see cref="Vector3"/> to be set</param>
public static void SetOffset(DependencyObject obj, string value)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
SetOffsetForElement(value, element);
}
@ -278,7 +281,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <returns>The <see cref="Visual.Opacity"/> of the <see cref="UIElement"/></returns>
public static double GetOpacity(DependencyObject obj)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
return GetOpacityForElement(element);
}
@ -293,7 +296,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="value">The opacity to be set between 0.0 and 1.0</param>
public static void SetOpacity(DependencyObject obj, double value)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
SetOpacityForElement(value, element);
}
@ -308,7 +311,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <returns>The <see cref="Visual.RotationAngle"/> of the <see cref="UIElement"/></returns>
public static double GetRotationAngle(DependencyObject obj)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
return GetRotationAngleForElement(element);
}
@ -323,7 +326,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="value">The rotation in radians</param>
public static void SetRotationAngle(DependencyObject obj, double value)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
SetRotationAngleForElement(value, element);
}
@ -338,7 +341,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <returns>The <see cref="Visual.RotationAngleInDegrees"/> of the <see cref="UIElement"/></returns>
public static double GetRotationAngleInDegrees(DependencyObject obj)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
return GetRotationAngleInDegreesForElement(element);
}
@ -353,7 +356,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="value">The rotation in degrees</param>
public static void SetRotationAngleInDegrees(DependencyObject obj, double value)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
SetRotationAngleInDegreesForElement(value, element);
}
@ -368,7 +371,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <returns>A <see cref="Vector3"/> string representation of the <see cref="Visual.RotationAxis"/></returns>
public static string GetRotationAxis(DependencyObject obj)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
return GetRotationAxisForElement(element);
}
@ -383,7 +386,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="value">The string representation of the <see cref="Vector3"/> to be set</param>
public static void SetRotationAxis(DependencyObject obj, string value)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
SetRotationAxisForElement(value, element);
}
@ -398,7 +401,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <returns>A <see cref="Vector3"/> string representation of the <see cref="Visual.Scale"/></returns>
public static string GetScale(DependencyObject obj)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
return GetScaleForElement(element);
}
@ -413,7 +416,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="value">The string representation of the <see cref="Vector3"/> to be set</param>
public static void SetScale(DependencyObject obj, string value)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
SetScaleForElement(value, element);
}
@ -428,7 +431,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <returns>A <see cref="Vector2"/> string representation of the <see cref="Visual.Size"/></returns>
public static string GetSize(DependencyObject obj)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
return GetSizeForElement(element);
}
@ -443,7 +446,7 @@ namespace Microsoft.Toolkit.Uwp.UI
/// <param name="value">The string representation of the <see cref="Vector2"/> to be set</param>
public static void SetSize(DependencyObject obj, string value)
{
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && obj is UIElement element)
if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && IsSupported && obj is UIElement element)
{
SetSizeForElement(value, element);
}
@ -609,6 +612,7 @@ namespace Microsoft.Toolkit.Uwp.UI
{
if (d is FrameworkElement element &&
!DesignTimeHelpers.IsRunningInLegacyDesignerMode &&
IsSupported &&
e.NewValue is string newValue)
{
Vector2 center = newValue.ToVector2();

Просмотреть файл

@ -10,7 +10,9 @@ using Windows.System;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
#if !HAS_UNO
[assembly: InternalsVisibleTo("UnitTests.XamlIslands.UWPApp")]
#endif
namespace Microsoft.Toolkit.Uwp.UI.Helpers
{
@ -69,6 +71,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Helpers
if (ApiInformation.IsPropertyPresent("Windows.UI.ViewManagement.AccessibilitySettings", "HighContrast"))
{
IsHighContrast = _accessible.HighContrast;
}
DispatcherQueue = dispatcherQueue ?? DispatcherQueue.GetForCurrentThread();

Просмотреть файл

@ -57,12 +57,12 @@
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI"
Version="3.0.0-dev.1549" />
Version="3.4.0" />
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.Uwp.Managed"
Version="2.0.2-uno.74" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='uap10.0.16299'">
<ItemGroup Condition="'$(TargetFramework)'=='uap10.0.17763'">
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed"
Version="2.0.1" />
</ItemGroup>

Просмотреть файл

@ -23,7 +23,7 @@
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' or '$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
<PackageReference Include="Uno.UI"
Version="3.0.0-dev.1549" />
Version="3.4.0" />
</ItemGroup>
<!-- END UNO SPECIFIC -->

Просмотреть файл

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
namespace Microsoft.Toolkit.Extensions
{
public static class MathEx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double Clamp(double value, double min, double max)
{
if (min > max)
{
throw new InvalidOperationException();
}
if (value < min)
{
return min;
}
if (value > max)
{
return max;
}
return value;
}
public static int Clamp(int value, int min, int max)
{
if (min > max)
{
throw new InvalidOperationException();
}
if (value < min)
{
return min;
}
if (value > max)
{
return max;
}
return value;
}
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу