Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Merge branch '4.5.0' into fix-8777
Browse files Browse the repository at this point in the history
  • Loading branch information
samhouts committed Jan 17, 2020
2 parents cb4943c + 61a9f3d commit dcd6ef0
Show file tree
Hide file tree
Showing 33 changed files with 1,294 additions and 98 deletions.
8 changes: 6 additions & 2 deletions .nuspec/Xamarin.Forms.targets
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,18 @@
</CompileDependsOn>
</PropertyGroup>

<Target Name="XamlC" AfterTargets="AfterCompile" Inputs="$(IntermediateOutputPath)$(TargetFileName)" Outputs="$(IntermediateOutputPath)XamlC.stamp" Condition=" '$(DesignTimeBuild)' != 'True' ">
<Target Name="XamlC" AfterTargets="AfterCompile" Inputs="$(IntermediateOutputPath)$(TargetFileName)" Outputs="$(IntermediateOutputPath)XamlC.stamp" Condition=" '$(DesignTimeBuild)' != 'True'">
<PropertyGroup>
<_XFXamlCValidateOnly>$(XFXamlCValidateOnly)</_XFXamlCValidateOnly>
<_XFXamlCValidateOnly Condition="'$(BuildingForLiveUnitTesting)' == 'True' ">True</_XFXamlCValidateOnly>
</PropertyGroup>
<XamlCTask
Assembly = "$(IntermediateOutputPath)$(TargetFileName)"
ReferencePath = "@(ReferencePath)"
OptimizeIL = "true"
DebugSymbols = "$(DebugSymbols)"
DebugType = "$(DebugType)"
ValidateOnly = "$(XFXamlCValidateOnly)"
ValidateOnly = "$(_XFXamlCValidateOnly)"
KeepXamlResources = "$(XFKeepXamlResources)" />
<Touch Files="$(IntermediateOutputPath)XamlC.stamp" AlwaysCreate="True" />
<ItemGroup>
Expand Down
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>
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");
}
}
}
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>
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; }
}
}
}
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");
})
}
}
};
}
}
}
}

0 comments on commit dcd6ef0

Please sign in to comment.