Skip to content

Commit d8e2570

Browse files
committed
Renamed IsLeftSwipeEnabled -> IsRightCommandEnabled and IsRightSwipeEnabled -> IsLeftCommandEnabled.
1 parent 71f3aac commit d8e2570

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/SlidableListItem/SlidableListItemCode.bind

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
LeftForeground ="@[LeftForeground:Brush:White]"
2424
RightForeground ="@[RightForeground:Brush:White]"
2525
ActivationWidth="@[ActivationWidth:Slider:100:50-250]"
26-
IsRightSwipeEnabled="@[IsRightSwipeEnabled:Bool:true]"
27-
IsLeftSwipeEnabled="@[IsLeftSwipeEnabled:Bool:true]"
26+
IsLeftCommandEnabled="@[IsLeftCommandEnabled:Bool:true]"
27+
IsRightCommandEnabled="@[IsRightCommandEnabled:Bool:true]"
2828
IsOffsetLimited="@[IsOffsetLimited:Bool:true]"
2929
MouseSlidingEnabled="@[MouseSlidingEnabled:Bool:true]"
3030
IsPointerReleasedOnSwipingHandled="@[IsPointerReleasedOnSwipingHandled:Bool:false]"

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/SlidableListItem/SlidableListItemPage.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
LeftForeground ="{Binding DataContext.LeftForeground.Value, ElementName=Root, Mode=OneWay}"
2626
RightForeground ="{Binding DataContext.RightForeground.Value, ElementName=Root, Mode=OneWay}"
2727
MouseSlidingEnabled="{Binding DataContext.MouseSlidingEnabled.Value, ElementName=Root, Mode=OneWay}"
28-
IsRightSwipeEnabled="{Binding DataContext.IsRightSwipeEnabled.Value, ElementName=Root, Mode=OneWay}"
29-
IsLeftSwipeEnabled="{Binding DataContext.IsLeftSwipeEnabled.Value, ElementName=Root, Mode=OneWay}"
28+
IsLeftCommandEnabled="{Binding DataContext.IsLeftCommandEnabled.Value, ElementName=Root, Mode=OneWay}"
29+
IsRightCommandEnabled="{Binding DataContext.IsRightCommandEnabled.Value, ElementName=Root, Mode=OneWay}"
3030
LeftCommand="{x:Bind ToggleFavorite}"
3131
RightCommand="{Binding DeleteItem, ElementName=Page, Mode=OneWay}"
3232
RightCommandParameter="{Binding}"

Microsoft.Toolkit.Uwp.UI.Controls/SlidableListItem/SlidableListItem.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ public class SlidableListItem : ContentControl
4646
DependencyProperty.Register(nameof(IsOffsetLimited), typeof(bool), typeof(SlidableListItem), new PropertyMetadata(true));
4747

4848
/// <summary>
49-
/// Identifies the <see cref="IsLeftSwipeEnabled"/> property
49+
/// Identifies the <see cref="IsRightCommandEnabled"/> property
5050
/// </summary>
51-
public static readonly DependencyProperty IsLeftSwipeEnabledProperty =
52-
DependencyProperty.Register(nameof(IsLeftSwipeEnabled), typeof(bool), typeof(SlidableListItem), new PropertyMetadata(true));
51+
public static readonly DependencyProperty IsRightCommandEnabledProperty =
52+
DependencyProperty.Register(nameof(IsRightCommandEnabled), typeof(bool), typeof(SlidableListItem), new PropertyMetadata(true));
5353

5454
/// <summary>
55-
/// Identifies the <see cref="IsRightSwipeEnabled"/> property
55+
/// Identifies the <see cref="IsLeftCommandEnabled"/> property
5656
/// </summary>
57-
public static readonly DependencyProperty IsRightSwipeEnabledProperty =
58-
DependencyProperty.Register(nameof(IsRightSwipeEnabled), typeof(bool), typeof(SlidableListItem), new PropertyMetadata(true));
57+
public static readonly DependencyProperty IsLeftCommandEnabledProperty =
58+
DependencyProperty.Register(nameof(IsLeftCommandEnabled), typeof(bool), typeof(SlidableListItem), new PropertyMetadata(true));
5959

6060
/// <summary>
6161
/// Identifies the <see cref="ActivationWidth"/> property
@@ -239,7 +239,7 @@ private void ContentGrid_PointerReleased(object sender, PointerRoutedEventArgs e
239239

240240
private void ContentGrid_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
241241
{
242-
if ((!MouseSlidingEnabled && e.PointerDeviceType == PointerDeviceType.Mouse) || (!IsRightSwipeEnabled && !IsLeftSwipeEnabled))
242+
if ((!MouseSlidingEnabled && e.PointerDeviceType == PointerDeviceType.Mouse) || (!IsLeftCommandEnabled && !IsRightCommandEnabled))
243243
{
244244
return;
245245
}
@@ -304,7 +304,7 @@ private void ContentGrid_ManipulationStarted(object sender, ManipulationStartedR
304304
/// </summary>
305305
private void ContentGrid_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
306306
{
307-
if ((!MouseSlidingEnabled && e.PointerDeviceType == PointerDeviceType.Mouse) || (!IsRightSwipeEnabled && !IsLeftSwipeEnabled))
307+
if ((!MouseSlidingEnabled && e.PointerDeviceType == PointerDeviceType.Mouse) || (!IsLeftCommandEnabled && !IsRightCommandEnabled))
308308
{
309309
return;
310310
}
@@ -346,7 +346,7 @@ private void ContentGrid_ManipulationDelta(object sender, ManipulationDeltaRoute
346346
if (newTranslationX > 0)
347347
{
348348
// Swiping from left to right
349-
if (!IsRightSwipeEnabled)
349+
if (!IsLeftCommandEnabled)
350350
{
351351
// If swipe is not enabled, only allow swipe a very short distance
352352
if (newTranslationX > 0)
@@ -387,7 +387,7 @@ private void ContentGrid_ManipulationDelta(object sender, ManipulationDeltaRoute
387387
else
388388
{
389389
// Swiping from right to left
390-
if (!IsLeftSwipeEnabled)
390+
if (!IsRightCommandEnabled)
391391
{
392392
// If swipe is not enabled, only allow swipe a very short distance
393393
if (newTranslationX < 0)
@@ -541,21 +541,21 @@ public bool IsOffsetLimited
541541
}
542542

543543
/// <summary>
544-
/// Gets or sets a value indicating whether swiping left is enabled or not.
544+
/// Gets or sets a value indicating whether right command is enabled or not.
545545
/// </summary>
546-
public bool IsLeftSwipeEnabled
546+
public bool IsRightCommandEnabled
547547
{
548-
get { return (bool)GetValue(IsLeftSwipeEnabledProperty); }
549-
set { SetValue(IsLeftSwipeEnabledProperty, value); }
548+
get { return (bool)GetValue(IsRightCommandEnabledProperty); }
549+
set { SetValue(IsRightCommandEnabledProperty, value); }
550550
}
551551

552552
/// <summary>
553-
/// Gets or sets a value indicating whether swiping right is enabled or not.
553+
/// Gets or sets a value indicating whether left command is enabled or not.
554554
/// </summary>
555-
public bool IsRightSwipeEnabled
555+
public bool IsLeftCommandEnabled
556556
{
557-
get { return (bool)GetValue(IsRightSwipeEnabledProperty); }
558-
set { SetValue(IsRightSwipeEnabledProperty, value); }
557+
get { return (bool)GetValue(IsLeftCommandEnabledProperty); }
558+
set { SetValue(IsLeftCommandEnabledProperty, value); }
559559
}
560560

561561
/// <summary>

0 commit comments

Comments
 (0)