-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
7,171 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
...sApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlClearPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. --> | ||
<local:TestPage | ||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls" | ||
x:Class="MUXControlsTestApp.SwipeControlClearPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:MUXControlsTestApp" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
|
||
<Grid> | ||
<Grid.Resources> | ||
<muxc:SwipeItems x:Name="DefaultSwipeItemsHorizontal" > | ||
<muxc:SwipeItem Background="Orange" BehaviorOnInvoked="RemainOpen"></muxc:SwipeItem> | ||
</muxc:SwipeItems> | ||
<muxc:SwipeItem x:Name="DefaultSwipeItemHorizontal" Background="Orange" BehaviorOnInvoked="RemainOpen"></muxc:SwipeItem> | ||
<muxc:SwipeItems x:Name="DefaultSwipeItemsVertical"> | ||
<muxc:SwipeItem Background="Orange" BehaviorOnInvoked="RemainOpen"></muxc:SwipeItem> | ||
</muxc:SwipeItems> | ||
<muxc:SwipeItem x:Name="DefaultSwipeItemVertical" Background="Orange" BehaviorOnInvoked="RemainOpen"></muxc:SwipeItem> | ||
</Grid.Resources> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"></RowDefinition> | ||
</Grid.RowDefinitions> | ||
|
||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" ></ColumnDefinition> | ||
<ColumnDefinition Width="Auto" ></ColumnDefinition> | ||
</Grid.ColumnDefinitions> | ||
|
||
<Grid Grid.Row="0" Grid.Column="0" Margin="20"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="100"></RowDefinition> | ||
<RowDefinition Height="20"></RowDefinition> | ||
<RowDefinition Height="100"></RowDefinition> | ||
</Grid.RowDefinitions> | ||
|
||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="120"></ColumnDefinition> | ||
<ColumnDefinition Width="0"></ColumnDefinition> | ||
<ColumnDefinition Width="120"></ColumnDefinition> | ||
</Grid.ColumnDefinitions> | ||
<ListView Grid.Row="0" Grid.Column="0" x:Name="leftSwipe" SelectionMode="None"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate> | ||
<muxc:SwipeControl LeftItems="{StaticResource DefaultSwipeItemsHorizontal}"> | ||
<Grid Background="#F25022" Width="100" Height="100" /> | ||
</muxc:SwipeControl> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
<ListView Grid.Row="0" Grid.Column="2" x:Name="topSwipe" SelectionMode="None"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate> | ||
<muxc:SwipeControl TopItems="{StaticResource DefaultSwipeItemsVertical}"> | ||
<Grid Background="#7FBA00" Width="100" Height="100" /> | ||
</muxc:SwipeControl> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
<ListView Grid.Row="2" Grid.Column="0" x:Name="rightSwipe" SelectionMode="None"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate> | ||
<muxc:SwipeControl RightItems="{StaticResource DefaultSwipeItemsHorizontal}"> | ||
<Grid Background="#00A4EF" Width="100" Height="100" /> | ||
</muxc:SwipeControl> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
<ListView Grid.Row="2" Grid.Column="2" x:Name="bottomSwipe" SelectionMode="None"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate> | ||
<muxc:SwipeControl BottomItems="{StaticResource DefaultSwipeItemsVertical}"> | ||
<Grid Background="#FFB900" Width="100" Height="100"/> | ||
</muxc:SwipeControl> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
|
||
|
||
|
||
</Grid> | ||
|
||
<StackPanel Grid.Row="0" Grid.Column="1"> | ||
<Button Click="AddSwipeItemsButton_Click" x:Name="AddItemsButton" AutomationProperties.Name="AddItemsButton" Margin="0,0,0,8">Add SwipeItems</Button> | ||
<Button Click="ClearSwipeItemsButton_Click" x:Name="ClearItemsButton" AutomationProperties.Name="ClearItemsButton" Margin="0,0,0,8">Clear SwipeItems</Button> | ||
<TextBlock x:Name="SwipeItemsChildSum" AutomationProperties.Name="SwipeItemsChildSum" ></TextBlock> | ||
</StackPanel> | ||
|
||
</Grid> | ||
</local:TestPage> |
50 changes: 50 additions & 0 deletions
50
...p/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlClearPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System; | ||
using Windows.UI.Xaml; | ||
|
||
namespace MUXControlsTestApp | ||
{ | ||
/// <summary> | ||
/// Test page used for clearing existing SwipeControls | ||
/// </summary> | ||
public sealed partial class SwipeControlClearPage : TestPage | ||
{ | ||
private string[] items = new string[] { "some text" }; | ||
|
||
public SwipeControlClearPage() | ||
{ | ||
this.InitializeComponent(); | ||
SwipeItemsChildSum.Text = (DefaultSwipeItemsHorizontal.Count + DefaultSwipeItemsVertical.Count).ToString(); | ||
|
||
leftSwipe.ItemsSource = items; | ||
topSwipe.ItemsSource = items; | ||
rightSwipe.ItemsSource = items; | ||
bottomSwipe.ItemsSource = items; | ||
} | ||
|
||
public void AddSwipeItemsButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
DefaultSwipeItemsHorizontal.Clear(); | ||
DefaultSwipeItemsVertical.Clear(); | ||
|
||
DefaultSwipeItemsHorizontal.Mode = Microsoft.UI.Xaml.Controls.SwipeMode.Reveal; | ||
DefaultSwipeItemsHorizontal.Add(DefaultSwipeItemHorizontal); | ||
|
||
// Using swipecontrol inside datatemplate prevents us from setting that: | ||
// Swipecontrol is in horizontal mode, can not add vertical swipe items... | ||
//DefaultSwipeItemsVertical.Mode = Microsoft.UI.Xaml.Controls.SwipeMode.Reveal; | ||
//DefaultSwipeItemsVertical.Add(DefaultSwipeItemVertical); | ||
|
||
SwipeItemsChildSum.Text = (DefaultSwipeItemsHorizontal.Count + DefaultSwipeItemsVertical.Count).ToString(); | ||
} | ||
public void ClearSwipeItemsButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
DefaultSwipeItemsHorizontal.Clear(); | ||
DefaultSwipeItemsVertical.Clear(); | ||
SwipeItemsChildSum.Text = (DefaultSwipeItemsHorizontal.Count + DefaultSwipeItemsVertical.Count).ToString(); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.