Skip to content

Commit a8c3249

Browse files
Merge branch 'master' into test-app-service
2 parents f583ee4 + 9e4065f commit a8c3249

File tree

106 files changed

+2207
-2365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+2207
-2365
lines changed

Directory.Build.props

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
1515
<IsUwpProject Condition="'$(IsDesignProject)' != 'true'">$(MSBuildProjectName.Contains('Uwp'))</IsUwpProject>
1616
<IsSampleProject>$(MSBuildProjectName.Contains('Sample'))</IsSampleProject>
17-
<DefaultTargetPlatformVersion>19041</DefaultTargetPlatformVersion>
18-
<DefaultTargetPlatformMinVersion>17763</DefaultTargetPlatformMinVersion>
17+
<TargetPlatformBaseVersion>10.0</TargetPlatformBaseVersion>
18+
<TargetPlatformRevision>19041</TargetPlatformRevision>
19+
<TargetPlatformMinRevision>17763</TargetPlatformMinRevision>
1920
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\nupkg</PackageOutputPath>
2021
</PropertyGroup>
2122

@@ -88,7 +89,6 @@
8889
</Choose>
8990

9091
<PropertyGroup Condition="'$(IsUwpProject)' == 'true'">
91-
9292
<!-- 8002 is a strong named -> non-strong-named reference -->
9393
<!-- This is valid for platforms other than .NET Framework (and is needed for the UWP targets -->
9494
<NoWarn>$(NoWarn);8002</NoWarn>
@@ -103,4 +103,7 @@
103103
<Link>stylecop.json</Link>
104104
</AdditionalFiles>
105105
</ItemGroup>
106+
107+
<Import Project="$(MSBuildThisFileDirectory)build\Windows.Toolkit.VisualStudio.Design.props" Condition="'$(IsDesignProject)' == 'true'"/>
108+
106109
</Project>

Directory.Build.targets

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,20 @@
11
<Project>
2-
<Choose>
3-
<When Condition="'$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.17763' or '$(TargetFramework)' == 'native' or '$(TargetFramework)' == 'net461'">
4-
<!-- UAP versions for uap10.0 where TPMV isn't implied -->
5-
<PropertyGroup>
6-
<TargetPlatformVersion>10.0.$(DefaultTargetPlatformVersion).0</TargetPlatformVersion>
7-
<TargetPlatformMinVersion>10.0.$(DefaultTargetPlatformMinVersion).0</TargetPlatformMinVersion>
8-
</PropertyGroup>
92

10-
<PropertyGroup Condition="'$(DebugType)' == ''">
11-
<DebugType>Portable</DebugType>
12-
</PropertyGroup>
3+
<PropertyGroup>
4+
<UseUWP Condition="'$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.17763' or '$(TargetFramework)' == 'native' or '$(TargetFramework)' == 'net461'">true</UseUWP>
5+
</PropertyGroup>
136

14-
<ItemGroup>
15-
<SDKReference Condition="'$(UseWindowsDesktopSdk)' == 'true' " Include="WindowsDesktop, Version=$(TargetPlatformVersion)">
16-
<Name>Windows Desktop Extensions for the UWP</Name>
17-
</SDKReference>
18-
</ItemGroup>
19-
</When>
20-
</Choose>
21-
227
<Choose>
23-
<When Condition="'$(TargetFramework.Contains(`uap10.0`))' == 'false' and '$(TargetFramework)' != 'native' and '$(IsSampleProject)' != 'true'">
8+
<When Condition="!$(TargetFramework.Contains(`uap10.0`)) and '$(TargetFramework)' != 'native' and '$(IsSampleProject)' != 'true'">
249
<PropertyGroup>
2510
<SignAssembly>true</SignAssembly>
2611
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
2712
</PropertyGroup>
2813
</When>
2914
</Choose>
3015

16+
<Import Project="$(MSBuildThisFileDirectory)build\Windows.Toolkit.Uwp.Build.targets" Condition="'$(UseUWP)' == 'true'"/>
17+
3118
<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
3219
<ItemGroup>
3320
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
@@ -36,4 +23,5 @@
3623
</AssemblyAttribute>
3724
</ItemGroup>
3825
</Target>
26+
3927
</Project>

Microsoft.Toolkit.HighPerformance/Helpers/Internals/RuntimeHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static unsafe int ConvertLength<TFrom, TTo>(int length)
4242
}
4343
else if (sizeof(TFrom) == 1)
4444
{
45-
return length / sizeof(TTo);
45+
return (int)((uint)length / (uint)sizeof(TTo));
4646
}
4747
else
4848
{

Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazePointer.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Collections.Generic;
77
using System.Diagnostics;
88
using System.Linq;
9+
using System.Threading;
910
using System.Threading.Tasks;
1011
using Windows.Devices.Input.Preview;
1112
using Windows.Foundation;
@@ -298,20 +299,9 @@ internal int CursorRadius
298299
/// </summary>
299300
public bool IsAlwaysActivated { get; set; }
300301

301-
private static GazePointer _instance = null;
302+
private static ThreadLocal<GazePointer> _instance = new ThreadLocal<GazePointer>(() => new GazePointer());
302303

303-
internal static GazePointer Instance
304-
{
305-
get
306-
{
307-
if (_instance == null)
308-
{
309-
_instance = new GazePointer();
310-
}
311-
312-
return _instance;
313-
}
314-
}
304+
internal static GazePointer Instance => _instance.Value;
315305

316306
internal void AddRoot(int proxyId)
317307
{

Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
</Description>
1616
<PackageTags>notifications win10 windows 10 tile tiles toast toasts badge xml uwp c# csharp c++</PackageTags>
1717
<ExtrasImplicitPlatformPackageIsPrivate Condition=" '$(TargetFramework)' == 'native' ">true</ExtrasImplicitPlatformPackageIsPrivate>
18+
<DefaultTargetPlatformMinVersion>10240</DefaultTargetPlatformMinVersion>
19+
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
1820
</PropertyGroup>
1921

2022
<Choose>

Microsoft.Toolkit.Uwp.SampleApp/Controls/XamlCodeEditor.xaml.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public sealed partial class XamlCodeEditor : UserControl
2121
public static readonly DependencyProperty TextProperty =
2222
DependencyProperty.Register(nameof(Text), typeof(string), typeof(XamlCodeEditor), new PropertyMetadata(string.Empty));
2323

24+
private ThemeListener _themeListener = new ThemeListener();
25+
2426
public XamlCodeEditor()
2527
{
2628
this.InitializeComponent();
@@ -40,7 +42,7 @@ public async void ReportError(XamlExceptionRange error)
4042
// Highlight Error Line
4143
XamlCodeRenderer.Decorations.Add(new IModelDeltaDecoration(
4244
range,
43-
new IModelDecorationOptions() { IsWholeLine = true, ClassName = _errorStyle, HoverMessage = new string[] { error.Message }.ToMarkdownString() }));
45+
new IModelDecorationOptions() { IsWholeLine = true, ClassName = ErrorStyle, HoverMessage = new string[] { error.Message }.ToMarkdownString() }));
4446

4547
// Show Glyph Icon
4648
XamlCodeRenderer.Decorations.Add(new IModelDeltaDecoration(
@@ -121,10 +123,12 @@ public string Text
121123

122124
public DateTime TimeSampleEditedLast { get; private set; } = DateTime.MinValue;
123125

124-
private CssLineStyle _errorStyle = new CssLineStyle()
126+
private CssLineStyle ErrorStyle
125127
{
126-
BackgroundColor = new SolidColorBrush(Color.FromArgb(0x00, 0xFF, 0xD6, 0xD6))
127-
};
128+
get => _themeListener.CurrentTheme.Equals(ApplicationTheme.Light) ?
129+
new CssLineStyle() { BackgroundColor = new SolidColorBrush(Color.FromArgb(0x00, 0xFF, 0xD6, 0xD6)) } :
130+
new CssLineStyle() { BackgroundColor = new SolidColorBrush(Color.FromArgb(0x00, 0x66, 0x00, 0x00)) };
131+
}
128132

129133
private CssGlyphStyle _errorIconStyle = new CssGlyphStyle()
130134
{

Microsoft.Toolkit.Uwp.UI.Animations/Expressions/CompositionExtensions.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,26 @@ public static void SetMotion(this InteractionTrackerInertiaMotion modifier, Expr
221221
modifier.Motion = CreateExpressionAnimationFromNode(modifier.Compositor, expressionNode);
222222
}
223223

224+
/// <summary>
225+
/// Use the value of specified ExpressionNode to determine if this composition conditional value modifier should be chosen.
226+
/// </summary>
227+
/// <param name="modifier">The modifier.</param>
228+
/// <param name="expressionNode">The root ExpressionNode that represents the ExpressionAnimation.</param>
229+
public static void SetCondition(this CompositionConditionalValue modifier, ExpressionNode expressionNode)
230+
{
231+
modifier.Condition = CreateExpressionAnimationFromNode(modifier.Compositor, expressionNode);
232+
}
233+
234+
/// <summary>
235+
/// Use the value of specified ExpressionNode as the value for this composition conditional value
236+
/// </summary>
237+
/// <param name="modifier">The modifier.</param>
238+
/// <param name="expressionNode">The root ExpressionNode that represents the ExpressionAnimation.</param>
239+
public static void SetValue(this CompositionConditionalValue modifier, ExpressionNode expressionNode)
240+
{
241+
modifier.Value = CreateExpressionAnimationFromNode(modifier.Compositor, expressionNode);
242+
}
243+
224244
/// <summary>
225245
/// Creates the expression animation from node.
226246
/// </summary>

0 commit comments

Comments
 (0)