This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
33 changed files
with
1,294 additions
and
98 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
55 changes: 55 additions & 0 deletions
55
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8781.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,55 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue8781" | ||
xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
Title="Issue 8781"> | ||
<StackLayout | ||
Margin="20"> | ||
<Label | ||
BackgroundColor="Black" | ||
TextColor="White" | ||
Text="Open the SwipeView and verify that the SwipeItemView is rendered correctly."/> | ||
<Label | ||
Text="Questions" | ||
FontAttributes="Bold" | ||
HorizontalOptions="Center" /> | ||
<Label | ||
Text="Swipe right to answer the following questions." /> | ||
<SwipeView | ||
x:Name="swipeView" | ||
BackgroundColor="Green" | ||
HeightRequest="70" | ||
WidthRequest="300"> | ||
<SwipeView.LeftItems> | ||
<SwipeItems> | ||
<SwipeItemView | ||
Command="{Binding CheckAnswerCommand}" | ||
CommandParameter="{Binding Source={x:Reference resultEntry}, Path=Text}"> | ||
<StackLayout | ||
BackgroundColor="White" | ||
WidthRequest="300"> | ||
<Entry | ||
x:Name="resultEntry" | ||
Placeholder="Enter answer" | ||
HorizontalOptions="CenterAndExpand" /> | ||
<Label | ||
Text="Check" | ||
FontAttributes="Bold" | ||
HorizontalOptions="Center" /> | ||
</StackLayout> | ||
</SwipeItemView> | ||
</SwipeItems> | ||
</SwipeView.LeftItems> | ||
<Grid | ||
HeightRequest="70" | ||
WidthRequest="300" | ||
BackgroundColor="LightGray"> | ||
<Label | ||
Text="What's 2+2?" | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" /> | ||
</Grid> | ||
</SwipeView> | ||
</StackLayout> | ||
</ContentPage> |
41 changes: 41 additions & 0 deletions
41
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8781.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,41 @@ | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.Xaml; | ||
using Xamarin.Forms.CustomAttributes; | ||
using System; | ||
|
||
#if UITEST | ||
using NUnit.Framework; | ||
using Xamarin.UITest; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[NUnit.Framework.Category(UITestCategories.CarouselView)] | ||
#endif | ||
#if APP | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 8781, "SwipeViewItem rendering issue on iOS", PlatformAffected.iOS)] | ||
public partial class Issue8781 : ContentPage | ||
{ | ||
public Issue8781() | ||
{ | ||
#if APP | ||
InitializeComponent(); | ||
#endif | ||
} | ||
|
||
async void OnIncorrectAnswerInvoked(object sender, EventArgs e) | ||
{ | ||
await DisplayAlert("Incorrect!", "Try again.", "OK"); | ||
} | ||
|
||
async void OnCorrectAnswerInvoked(object sender, EventArgs e) | ||
{ | ||
await DisplayAlert("Correct!", "The answer is 2.", "OK"); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8902.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,34 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<controls:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:d="http://xamarin.com/schemas/2014/forms/design" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
xmlns:controls="clr-namespace:Xamarin.Forms.Controls" | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue8902"> | ||
<controls:TestContentPage.Content> | ||
<CarouselView ItemsSource="{Binding Persons}"> | ||
<CarouselView.ItemsLayout> | ||
<LinearItemsLayout Orientation="Horizontal" | ||
SnapPointsType="MandatorySingle" /> | ||
</CarouselView.ItemsLayout> | ||
<CarouselView.ItemTemplate> | ||
<DataTemplate> | ||
<Frame> | ||
<StackLayout> | ||
<ContentView Margin="30" | ||
BackgroundColor="Gray" | ||
HorizontalOptions="Fill"> | ||
<Label FontSize="Large" | ||
Text="{Binding Name}" /> | ||
</ContentView> | ||
<Label HorizontalOptions="Center" | ||
Text="{Binding Age}" | ||
VerticalOptions="Center" /> | ||
</StackLayout> | ||
</Frame> | ||
</DataTemplate> | ||
</CarouselView.ItemTemplate> | ||
</CarouselView> | ||
</controls:TestContentPage.Content> | ||
</controls:TestContentPage> |
59 changes: 59 additions & 0 deletions
59
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8902.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,59 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using Xamarin.Forms; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.Xaml; | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 8902, "CarouselView Layout on orientation change", PlatformAffected.iOS)] | ||
public partial class Issue8902 : TestContentPage | ||
{ | ||
public Issue8902() | ||
{ | ||
#if APP | ||
InitializeComponent(); | ||
#endif | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
BindingContext = new Issue8902ViewModel(); | ||
} | ||
|
||
public class Issue8902ViewModel | ||
{ | ||
public Issue8902ViewModel() | ||
{ | ||
Persons = new List<Issue8902Person>(); | ||
Persons.Add(new Issue8902Person() | ||
{ | ||
Age = 38, | ||
Name = "User 1" | ||
}); | ||
Persons.Add(new Issue8902Person() | ||
{ | ||
Age = 22, | ||
Name = "User 2" | ||
}); | ||
Persons.Add(new Issue8902Person() | ||
{ | ||
Age = 51, | ||
Name = "User 3" | ||
}); | ||
} | ||
public List<Issue8902Person> Persons { get; set; } | ||
} | ||
|
||
public class Issue8902Person | ||
{ | ||
public string Name { get; set; } | ||
public int Age { get; set; } | ||
} | ||
} | ||
} |
152 changes: 152 additions & 0 deletions
152
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ShellModal.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,152 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
using System.Linq; | ||
using Xamarin.Forms.PlatformConfiguration; | ||
using Xamarin.Forms.PlatformConfiguration.iOSSpecific; | ||
using System.Threading; | ||
using System.ComponentModel; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.None, 0, "Shell Modal Behavior Test", | ||
PlatformAffected.All)] | ||
#if UITEST | ||
[NUnit.Framework.Category(UITestCategories.Shell)] | ||
#endif | ||
public class ShellModal : TestShell | ||
{ | ||
protected override void Init() | ||
{ | ||
Routing.RegisterRoute(nameof(ModalTestPage), typeof(ModalTestPage)); | ||
Routing.RegisterRoute(nameof(ModalNavigationTestPage), typeof(ModalNavigationTestPage)); | ||
|
||
AddContentPage(new ContentPage() | ||
{ | ||
Content = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Button() | ||
{ | ||
Text = "Push Modal", | ||
Command = new Command(async () => | ||
{ | ||
await GoToAsync(nameof(ModalNavigationTestPage)); | ||
}) | ||
}, | ||
new Button() | ||
{ | ||
Text = "Push Two Modals", | ||
Command = new Command(async () => | ||
{ | ||
await GoToAsync($"{nameof(ModalNavigationTestPage)}/{nameof(ModalNavigationTestPage)}"); | ||
}) | ||
}, | ||
new Button() | ||
{ | ||
Text = "Push Modal And Then A Page Onto That Modal Navigation Stack", | ||
Command = new Command(async () => | ||
{ | ||
await GoToAsync($"{nameof(ModalNavigationTestPage)}/{nameof(ModalTestPage)}"); | ||
}) | ||
}, | ||
new Button() | ||
{ | ||
Text = "Goto Different Tab And Push Modal", | ||
Command = new Command(async () => | ||
{ | ||
await GoToAsync("///OtherTab/ModalNavigationTestPage"); | ||
}) | ||
} | ||
} | ||
} | ||
}, title: "MainContent"); | ||
|
||
AddTopTab("OtherTab"); | ||
} | ||
|
||
[Preserve(AllMembers = true)] | ||
[QueryProperty("IsModal", "IsModal")] | ||
public class ModalNavigationTestPage : NavigationPage | ||
{ | ||
public ModalNavigationTestPage() : base(new ModalTestPage()) | ||
{ | ||
IsModal = "true"; | ||
} | ||
public string IsModal | ||
{ | ||
set | ||
{ | ||
if(Convert.ToBoolean(value)) | ||
Shell.SetPresentationMode(this, PresentationMode.Modal); | ||
else | ||
Shell.SetPresentationMode(this, PresentationMode.Animated); | ||
} | ||
} | ||
|
||
protected override void OnAppearing() | ||
{ | ||
base.OnAppearing(); | ||
} | ||
|
||
protected override void OnDisappearing() | ||
{ | ||
base.OnDisappearing(); | ||
} | ||
} | ||
|
||
[Preserve(AllMembers = true)] | ||
public class ModalTestPage : ContentPage | ||
{ | ||
public ModalTestPage() | ||
{ | ||
Content = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() | ||
{ | ||
Text = "Hello I am a modal page" | ||
}, | ||
new Button() | ||
{ | ||
Text = "Clicking me should go back to the MainContent Page", | ||
Command = new Command(async () => | ||
{ | ||
await Shell.Current.GoToAsync("//MainContent"); | ||
}) | ||
}, | ||
new Button() | ||
{ | ||
Text = "Push Another Modal Page", | ||
Command = new Command(async () => | ||
{ | ||
await Shell.Current.GoToAsync($"{nameof(ModalNavigationTestPage)}?IsModal=true"); | ||
}) | ||
}, | ||
new Button() | ||
{ | ||
Text = "Push Content Page Onto Visible Modal Navigation Stack", | ||
Command = new Command(async () => | ||
{ | ||
await Shell.Current.GoToAsync($"{nameof(ModalTestPage)}?IsModal=false"); | ||
}) | ||
} | ||
} | ||
}; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.