Skip to content

Commit

Permalink
Merge pull request #18738 from ajpinedam/dev/ajpm/ios.image.test
Browse files Browse the repository at this point in the history
test: Image inside scroll manual test
  • Loading branch information
ajpinedam authored Nov 13, 2024
2 parents ceed158 + b58de0f commit c50901c
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/SamplesApp/UITests.Shared/UITests.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -3670,6 +3670,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ImageTests\Image_ScrollView_ChangeView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ImageTests\Image_Stretch_Alignment_Bigger.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -7667,6 +7671,9 @@
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\GridTestsControl\Grid_MinWidth_MaxWidth.xaml.cs">
<DependentUpon>Grid_MinWidth_MaxWidth.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ImageTests\Image_ScrollView_ChangeView.xaml.cs">
<DependentUpon>Image_ScrollView_ChangeView.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ImageTests\Image_Stretch_Alignment_Bigger.xaml.cs">
<DependentUpon>Image_Stretch_Alignment_Bigger.xaml</DependentUpon>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Page
x:Class="Uno.UI.Samples.UITests.ImageTests.Image_ScrollView_ChangeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="using:Uno.UI.Samples.UITests.ImageTests"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<ScrollViewer ZoomMode="Enabled" x:Name="scrollViewer">
<Image Source="https://images.pexels.com/photos/3651611/pexels-photo-3651611.jpeg"
ImageOpened="Image_OnImageOpened"/>
</ScrollViewer>
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using Uno.UI.Samples.Controls;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

namespace Uno.UI.Samples.UITests.ImageTests
{
[Sample("Image",
IsManualTest = true,
Description = "The sample showcases an image inside an scrollviewer. When the image is loaded, the scrollviewer changes its zoom factor.")]
public sealed partial class Image_ScrollView_ChangeView : Page
{
public Image_ScrollView_ChangeView()
{
this.InitializeComponent();
}

private void Image_OnImageOpened(object sender, RoutedEventArgs e)
{
scrollViewer.ChangeView(0, 0, 0.5f);
}
}
}

0 comments on commit c50901c

Please sign in to comment.