Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@
BackgroundColor="LightGray"
TextColor="Black" />
</StackLayout>
<CarouselView
<!-- This functionality failed in CarouselView2. Reference: https://github.com/dotnet/maui/issues/28972 -->
<!-- TODO: Replace CarouselView1 with CarouselView once the issues mentioned in the GitHub issue are resolved. -->
<local:CarouselView1
x:Name="carousel"
Grid.Row="5"
Grid.ColumnSpan="2"
Expand All @@ -84,7 +86,7 @@
ItemsSource="{Binding Items}"
Position="{Binding Position}"
CurrentItem="{Binding Selected}">
<CarouselView.ItemTemplate>
<local:CarouselView1.ItemTemplate>
<DataTemplate x:DataType="local:CarouselItem">
<Border
x:Name="frame"
Expand Down Expand Up @@ -115,8 +117,8 @@
</Grid>
</Border>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
</local:CarouselView1.ItemTemplate>
</local:CarouselView1>
</Grid>
</ContentPage.Content>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Maui.Controls.Sample"
x:Class="Maui.Controls.Sample.Issues.CarouselViewPositionVisibility"
Title="Issue 12848">
<StackLayout>
Expand All @@ -10,21 +11,23 @@
BackgroundColor="Black"
TextColor="White"
Text="Swipe the CarouselView to select the item numbered 2. Then, tap the Hide Button to hide the Carousel and the Show Button to show the Carousel again. If the position of the Carousel is the same as before hiding, the test has passed."/>
<CarouselView
<!-- This functionality failed in CarouselView2. Reference: https://github.com/dotnet/maui/issues/29308 -->
<!-- TODO: Replace CarouselView1 with CarouselView once the issues mentioned in the GitHub issue are resolved. -->
<local:CarouselView1
AutomationId="TestCarouselView"
x:Name="carousel"
HorizontalOptions="Center"
HeightRequest="500"
ItemsSource="{Binding}">
<CarouselView.ItemTemplate>
<local:CarouselView1.ItemTemplate>
<DataTemplate>
<Label
Text="{Binding}"
FontSize="96"
HorizontalTextAlignment="Center"/>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
</local:CarouselView1.ItemTemplate>
</local:CarouselView1>
<Label
AutomationId="CarouselPosition"
Text="{Binding Source={x:Reference carousel}, Path=Position}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Maui.Controls.Sample"
x:Class="Maui.Controls.Sample.Issues.CarouselViewUpdateCurrentItem"
BackgroundColor="Blue">
<ContentPage.Resources>
Expand Down Expand Up @@ -59,7 +60,9 @@
AutomationId="searchBar" Grid.Row="2" x:Name="matchSearch"
BindingContext="{Binding CarouselCurrentItem}" Text="{Binding Title, Mode=OneWay}"
Placeholder="Title" WidthRequest="300" />
<CarouselView
<!-- This functionality failed in CarouselView2. Reference: https://github.com/dotnet/maui/issues/29312 -->
<!-- TODO: Replace CarouselView1 with CarouselView once the issues mentioned in the GitHub issue are resolved. -->
<local:CarouselView1
Grid.Row="3" x:Name="cv"
ItemsSource="{Binding Items}"
CurrentItem="{Binding CarouselCurrentItem}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Maui.Controls.Sample"
x:Class="Maui.Controls.Sample.Issues.CarouselViewUpdatePosition">
<ContentPage.Content>
<StackLayout
Expand All @@ -11,29 +12,31 @@
BackgroundColor="Black"
TextColor="White"
Text="Tap the Button. If the item selected in the CarouselView is Item 4, the test has passed."/>
<CarouselView
<!-- This functionality failed in CarouselView2. Reference: https://github.com/dotnet/maui/issues/29309 -->
<!-- TODO: Replace CarouselView1 with CarouselView once the issues mentioned in the GitHub issue are resolved. -->
<local:CarouselView1
x:Name="carousel"
IsSwipeEnabled="True"
Position="3"
IsVisible="False">
<CarouselView.ItemTemplate>
<local:CarouselView1.ItemTemplate>
<DataTemplate>
<Label
Text="{Binding}"
FontSize="Large"
HorizontalOptions="CenterAndExpand"/>
</DataTemplate>
</CarouselView.ItemTemplate>
<CarouselView.ItemsSource>
</local:CarouselView1.ItemTemplate>
<local:CarouselView1.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Item 1</x:String>
<x:String>Item 2</x:String>
<x:String>Item 3</x:String>
<x:String>Item 4</x:String>
<x:String>Item 5</x:String>
</x:Array>
</CarouselView.ItemsSource>
</CarouselView>
</local:CarouselView1.ItemsSource>
</local:CarouselView1>
<Button
AutomationId="AppearButton"
Text="Appear"
Expand Down
19 changes: 11 additions & 8 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue25192.xaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Maui.Controls.Sample"
x:Class="Maui.Controls.Sample.Issues.Issue25192">
<Grid>
<CarouselView Margin="2,9,2,20"
<!-- This functionality failed in CarouselView2. Reference: https://github.com/dotnet/maui/issues/27025 -->
<!-- TODO: Replace CarouselView1 with CarouselView once the issues mentioned in the GitHub issue are resolved. -->
<local:CarouselView1 Margin="2,9,2,20"
HeightRequest="180"
Loop="False"
PeekAreaInsets="20"
VerticalOptions="End"
HorizontalScrollBarVisibility="Never">
<CarouselView.ItemsSource>
<local:CarouselView1.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Item1</x:String>
<x:String>Item2</x:String>
<x:String>Item3</x:String>
</x:Array>
</CarouselView.ItemsSource>
<CarouselView.ItemsLayout>
</local:CarouselView1.ItemsSource>
<local:CarouselView1.ItemsLayout>
<LinearItemsLayout ItemSpacing="5"
Orientation="Horizontal"
SnapPointsAlignment="Center"
SnapPointsType="MandatorySingle"/>
</CarouselView.ItemsLayout>
<CarouselView.ItemTemplate>
</local:CarouselView1.ItemsLayout>
<local:CarouselView1.ItemTemplate>
<DataTemplate
x:DataType="{x:Null}">
<Border BackgroundColor="Red"
Expand Down Expand Up @@ -100,7 +103,7 @@
</Grid>
</Border>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
</local:CarouselView1.ItemTemplate>
</local:CarouselView1>
</Grid>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ protected override void Init()
SnapPointsType = SnapPointsType.MandatorySingle,
SnapPointsAlignment = SnapPointsAlignment.Center
};

var carouselView = new CarouselView
// This functionality failed in CarouselView2. Reference: https://github.com/dotnet/maui/issues/29310
// TODO: Replace CarouselView1 with CarouselView once the issues are resolved.
var carouselView = new CarouselView1
{
AutomationId = "carouselView",
ItemsLayout = itemsLayout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ protected override void Init()
SnapPointsType = SnapPointsType.MandatorySingle,
SnapPointsAlignment = SnapPointsAlignment.Center
};

var carouselView = new CarouselView

// This functionality failed in CarouselView2. Reference: https://github.com/dotnet/maui/issues/29310
// TODO: Replace CarouselView1 with CarouselView once the issues mentioned in the GitHub issue are resolved.
var carouselView = new CarouselView1
{
AutomationId = "carouselView",
ItemsLayout = itemsLayout,
Expand Down
Loading