Skip to content

Commit

Permalink
Merge pull request #1 from windows-toolkit/master
Browse files Browse the repository at this point in the history
Merge from master repo
  • Loading branch information
vgromfeld authored Mar 13, 2020
2 parents ef65272 + afed92f commit 7fc6df7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
MinAngle="@[MinAngle:Slider:210:0-360]"
MaxAngle="@[MaxAngle:Slider:150:0-360]"
Unit="units"
ValueStringFormat="@[ValueStringFormat:String:N0]"
NeedleWidth="@[NeedleWidth:Slider:4:1-10]"
NeedleLength="@[NeedleLength:Slider:100:20-100]"
TickLength="@[TickLength:Slider:10:0-30]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class RadialGauge : RangeBase
/// Identifies the ValueStringFormat dependency property.
/// </summary>
public static readonly DependencyProperty ValueStringFormatProperty =
DependencyProperty.Register(nameof(ValueStringFormat), typeof(string), typeof(RadialGauge), new PropertyMetadata("N0"));
DependencyProperty.Register(nameof(ValueStringFormat), typeof(string), typeof(RadialGauge), new PropertyMetadata("N0", (s, e) => OnValueChanged(s)));

/// <summary>
/// Identifies the TickSpacing dependency property.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
FontSize="20"
FontWeight="SemiBold"
Foreground="{TemplateBinding Foreground}"
Text="{TemplateBinding Value}"
TextAlignment="Center" />
<TextBlock Margin="0"
FontSize="16"
Expand Down
8 changes: 2 additions & 6 deletions Microsoft.Toolkit.Uwp/Deferred/EventHandlerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

Expand All @@ -16,8 +14,6 @@ namespace Microsoft.Toolkit.Uwp.Deferred
/// </summary>
public static class EventHandlerExtensions
{
private static readonly Task CompletedTask = Task.FromResult(0);

/// <summary>
/// Use to invoke an async <see cref="EventHandler{TEventArgs}"/> using <see cref="DeferredEventArgs"/>.
/// </summary>
Expand Down Expand Up @@ -46,7 +42,7 @@ public static Task InvokeAsync<T>(this EventHandler<T> eventHandler, object send
{
if (eventHandler == null)
{
return CompletedTask;
return Task.CompletedTask;
}

var tasks = eventHandler.GetInvocationList()
Expand All @@ -59,7 +55,7 @@ public static Task InvokeAsync<T>(this EventHandler<T> eventHandler, object send

var deferral = eventArgs.GetCurrentDeferralAndReset();

return deferral?.WaitForCompletion(cancellationToken) ?? CompletedTask;
return deferral?.WaitForCompletion(cancellationToken) ?? Task.CompletedTask;
})
.ToArray();

Expand Down
6 changes: 2 additions & 4 deletions Microsoft.Toolkit.Uwp/Deferred/TypedEventHandlerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ namespace Microsoft.Toolkit.Uwp.Deferred
/// </summary>
public static class TypedEventHandlerExtensions
{
private static readonly Task CompletedTask = Task.FromResult(0);

/// <summary>
/// Use to invoke an async <see cref="TypedEventHandler{TSender, TResult}"/> using <see cref="DeferredEventArgs"/>.
/// </summary>
Expand Down Expand Up @@ -47,7 +45,7 @@ public static Task InvokeAsync<S, R>(this TypedEventHandler<S, R> eventHandler,
{
if (eventHandler == null)
{
return CompletedTask;
return Task.CompletedTask;
}

var tasks = eventHandler.GetInvocationList()
Expand All @@ -60,7 +58,7 @@ public static Task InvokeAsync<S, R>(this TypedEventHandler<S, R> eventHandler,

var deferral = eventArgs.GetCurrentDeferralAndReset();

return deferral?.WaitForCompletion(cancellationToken) ?? CompletedTask;
return deferral?.WaitForCompletion(cancellationToken) ?? Task.CompletedTask;
})
.ToArray();

Expand Down

0 comments on commit 7fc6df7

Please sign in to comment.