-
Notifications
You must be signed in to change notification settings - Fork 720
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12395 from Youssef1313/merge-master-into-breaking…
…-changes Merge master into breaking changes
- Loading branch information
Showing
150 changed files
with
6,171 additions
and
2,491 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
63 changes: 63 additions & 0 deletions
63
src/SamplesApp/UITests.Shared/Windows_UI_Input/SetProtectedCursor.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,63 @@ | ||
<Page x:Class="SamplesApp.Wasm.Windows_UI_Input.SetProtectedCursor" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="using:Uno.UI.Samples.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400" | ||
Background="Cyan" | ||
mc:Ignorable="d"> | ||
|
||
<Grid> | ||
<Grid.Resources> | ||
<Style TargetType="TextBlock"> | ||
<Setter Property="TextWrapping" | ||
Value="Wrap" /> | ||
</Style> | ||
</Grid.Resources> | ||
|
||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
|
||
<StackPanel Margin="20"> | ||
<TextBlock Text="Tests for all platforms. Note for Wasm, Uno.UI.FeatureConfiguration.Cursors.UseHandForInteraction will need to be set to false to match the expected behavior." /> | ||
<TextBlock Text="- Test 1: Hover the Button. Expected behavior: Cursor should show SizeWestEast cursor." /> | ||
<TextBlock Text="- Test 2: Hover the Button and move to hover the yellow area. Expected behavior: Cursor should show SizeWestEast cursor the entire time." /> | ||
<TextBlock Text="- Test 3: Hover the Button and move to hover the blue area. Expected behavior: Cursor should show SizeWestEast cursor first then show back the default Arrow cursor when hovering the blue area." /> | ||
<TextBlock Text="- Test 4: Hover the Button, press and keep pressing when moving to hover the blue area. Expected behavior: Cursor should show SizeWestEast cursor the entire time." /> | ||
<TextBlock Text="- Test 5: Hover the pink Border. Expected behavior: Cursor should show Wait cursor." /> | ||
<TextBlock Text="- Test 6: Hover the pink Border and move to hover the yellow area. Expected behavior: Cursor should show Wait cursor the entire time." /> | ||
<TextBlock Text="- Test 7: Hover the pink Border and move to hover the blue area. Expected behavior: Cursor should show Wait cursor first then show back the default Arrow cursor when hovering the blue area." /> | ||
<TextBlock Text="- Test 8: Hover the pink border, press and keep pressing when moving to hover the blue area. Expected behavior: Cursor should show Wait cursor the entire time." /> | ||
<TextBlock Margin="0,10,0,0" Text="Tests for Wasm only. Uno.UI.FeatureConfiguration.Cursors.UseHandForInteraction will need to be set to true to match the expected behavior." /> | ||
<TextBlock Text="- Test 1: Hover the Button. Expected behavior: Cursor should show Hand cursor." /> | ||
<TextBlock Text="- Test 2: Hover the Button and move to hover the yellow area. Expected behavior: Cursor should show Hand cursor the entire time." /> | ||
<TextBlock Text="- Test 3: Hover the Button and move to hover the blue area. Expected behavior: Cursor should show Hand cursor first then show back the default Arrow cursor when hovering the blue area." /> | ||
<TextBlock Text="- Test 4: Hover the Button, press and keep pressing when moving to hover the blue area. Expected behavior: Cursor should show Hand cursor the entire time." /> | ||
</StackPanel> | ||
|
||
<StackPanel Grid.Row="1" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Background="Yellow"> | ||
|
||
<Button Content="Test SizeWestEast Cursor" | ||
PointerEntered="ChangeButtonCursor" /> | ||
|
||
<Border PointerEntered="ChangeBorderCursor" | ||
PointerPressed="CaptureCursor" | ||
Height="80" | ||
Width="80" | ||
Background="DeepPink"> | ||
<TextBlock Text="Test Wait Cursor" | ||
TextAlignment="Center" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center" /> | ||
</Border> | ||
|
||
</StackPanel> | ||
</Grid> | ||
</Page> |
48 changes: 48 additions & 0 deletions
48
src/SamplesApp/UITests.Shared/Windows_UI_Input/SetProtectedCursor.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,48 @@ | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Uno.UI.Samples.Controls; | ||
using System.Collections.Generic; | ||
using System; | ||
using Windows.Foundation; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Input; | ||
|
||
#if !WINDOWS_UWP | ||
using Microsoft.UI.Input; | ||
#endif | ||
|
||
namespace SamplesApp.Wasm.Windows_UI_Input | ||
{ | ||
[SampleControlInfo("Windows.UI.Input", "SetProtectedCursor", isManualTest: true, description: "Demonstrates use of UIElement.ProtectedCursor / InputSystemCursor / InputSystemCursorShape")] | ||
public sealed partial class SetProtectedCursor : Page | ||
{ | ||
public SetProtectedCursor() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void ChangeButtonCursor(object sender, PointerRoutedEventArgs e) | ||
{ | ||
#if !WINDOWS_UWP | ||
var SizeWestEastCursor = InputSystemCursor.Create(InputSystemCursorShape.SizeWestEast); | ||
this.ProtectedCursor = SizeWestEastCursor; | ||
#endif | ||
} | ||
|
||
private void ChangeBorderCursor(object sender, PointerRoutedEventArgs e) | ||
{ | ||
#if !WINDOWS_UWP | ||
var waitCursor = InputSystemCursor.Create(InputSystemCursorShape.Wait); | ||
this.ProtectedCursor = waitCursor; | ||
#endif | ||
} | ||
|
||
private void CaptureCursor(object sender, PointerRoutedEventArgs e) | ||
{ | ||
#if !WINDOWS_UWP | ||
var border = (Border)sender; | ||
border.CapturePointer(e.Pointer); | ||
#endif | ||
} | ||
} | ||
} |
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
37 changes: 37 additions & 0 deletions
37
...sApp/UITests.Shared/Windows_UI_Xaml_Controls/ImageTests/SvgImageSource_FromMsAppData.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,37 @@ | ||
<Page x:Class="UITests.Windows_UI_Xaml_Controls.ImageTests.SvgImageSource_FromMsAppData" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Xaml_Controls.ImageTests" | ||
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.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
|
||
<StackPanel Spacing="4"> | ||
<ComboBox ItemsSource="{x:Bind Sources}" SelectedItem="{x:Bind SelectedSource, Mode=TwoWay}" Header="SVG image"> | ||
<ComboBox.ItemTemplate> | ||
<DataTemplate x:DataType="local:SampleSvgSource"> | ||
<TextBlock Text="{x:Bind Name}" /> | ||
</DataTemplate> | ||
</ComboBox.ItemTemplate> | ||
</ComboBox> | ||
<ComboBox ItemsSource="{x:Bind Stretches}" SelectedItem="{x:Bind SelectedStretch, Mode=TwoWay}" Header="Stretch" /> | ||
<TextBox Text="{x:Bind ImageWidth, Mode=TwoWay}" Header="Image width" /> | ||
<TextBox Text="{x:Bind ImageHeight, Mode=TwoWay}" Header="Image height" /> | ||
<TextBox Text="{x:Bind RasterizedWidth, Mode=TwoWay}" Header="Rasterized width" /> | ||
<TextBox Text="{x:Bind RasterizedHeight, Mode=TwoWay}" Header="Rasterized height" /> | ||
</StackPanel> | ||
|
||
<Grid Grid.Row="1"> | ||
<Border HorizontalAlignment="Center" VerticalAlignment="Center" BorderBrush="Black" BorderThickness="2"> | ||
<Image x:Name="ImageElement" /> | ||
</Border> | ||
</Grid> | ||
</Grid> | ||
</Page> |
Oops, something went wrong.