forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
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
7 changed files
with
263 additions
and
8 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
32 changes: 32 additions & 0 deletions
32
...lesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/LongTitle/CommandBar_Frame.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,32 @@ | ||
<UserControl x:Class="UITests.Windows_UI_Xaml_Controls.CommandBar.LongTitle.CommandBar_Frame" | ||
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.CommandBar.LongTitle" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:xamarin="http://uno.ui/xamarin" | ||
mc:Ignorable="d xamarin" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
|
||
<Frame x:Name="HostFrame" | ||
xamarin:Style="{StaticResource NativeDefaultFrame}" /> | ||
|
||
<Grid Grid.Row="1"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<Button x:Name="NavigateInitialButton" | ||
Content="Navigate to first page" | ||
Click="Navigate_Initial" /> | ||
</Grid> | ||
</Grid> | ||
</UserControl> |
35 changes: 35 additions & 0 deletions
35
...App/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/LongTitle/CommandBar_Frame.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,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using UITests.Windows_UI_Xaml_Controls.CommandBar.Native_Frame; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 | ||
|
||
namespace UITests.Windows_UI_Xaml_Controls.CommandBar.LongTitle | ||
{ | ||
[SampleControlInfo("CommandBar", "CommandBar_LongTitle_Navigation")] | ||
public sealed partial class CommandBar_Frame : UserControl | ||
{ | ||
public CommandBar_Frame() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void Navigate_Initial(object sender, RoutedEventArgs args) | ||
{ | ||
HostFrame.Navigate(typeof(CommandBar_Page1)); | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...lesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/LongTitle/CommandBar_Page1.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,56 @@ | ||
<Page | ||
x:Class="UITests.Windows_UI_Xaml_Controls.CommandBar.LongTitle.CommandBar_Page1" | ||
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.CommandBar.LongTitle" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:xamarin="http://uno.ui/xamarin" | ||
mc:Ignorable="d xamarin" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
|
||
<CommandBar x:Name="Page1CommandBar"> | ||
<CommandBar.Content> | ||
<Border VerticalAlignment="Center" | ||
Height="44" | ||
HorizontalAlignment="Center"> | ||
<TextBlock Text="This is supposed to be a very long text used to overflow the CommandBar title and validate how it behaves on navigation and will try to make it very long in case this is run on an iPad" | ||
Foreground="Black" | ||
TextTrimming="CharacterEllipsis" | ||
TextWrapping="NoWrap" /> | ||
</Border> | ||
</CommandBar.Content> | ||
<CommandBar.PrimaryCommands> | ||
<AppBarButton Content="Click" /> | ||
</CommandBar.PrimaryCommands> | ||
</CommandBar> | ||
|
||
<StackPanel Grid.Row="1" | ||
Spacing="10" | ||
VerticalAlignment="Center"> | ||
|
||
<TextBlock Text="Main Page" | ||
HorizontalAlignment="Center" /> | ||
|
||
<Button x:Name="NavigateToPage2Button" | ||
Content="Navigate to Page 2" | ||
Click="OnButtonClicked" | ||
HorizontalAlignment="Center"/> | ||
|
||
<Button x:Name="CalculateSize" | ||
Content="Calculate TitleView Size" | ||
Click="OnCalculateSizeClicked" | ||
HorizontalAlignment="Center"/> | ||
|
||
<TextBlock x:Name="Result" | ||
HorizontalAlignment="Center" /> | ||
</StackPanel> | ||
</Grid> | ||
</Page> |
47 changes: 47 additions & 0 deletions
47
...App/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/LongTitle/CommandBar_Page1.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,47 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Windows.UI; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Media; | ||
|
||
#if __IOS__ | ||
using UIKit; | ||
using Uno.UI.Controls; | ||
#endif | ||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 | ||
|
||
namespace UITests.Windows_UI_Xaml_Controls.CommandBar.LongTitle | ||
{ | ||
public sealed partial class CommandBar_Page1 : Page | ||
{ | ||
public CommandBar_Page1() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
public async void OnButtonClicked(object sender, RoutedEventArgs e) | ||
{ | ||
Frame.Navigate(typeof(CommandBar_Page2)); | ||
} | ||
|
||
public async void OnCalculateSizeClicked(object sender, RoutedEventArgs e) | ||
{ | ||
#if __IOS__ | ||
UIView parent = this; | ||
while (parent.HasParent()) | ||
{ | ||
parent = parent.Superview; | ||
} | ||
|
||
var titleView = parent.FindFirstChild<TitleView>(); | ||
var titleViewParent = titleView.Superview; | ||
|
||
//When the error occurs the TitleView Frame.Width get bigger than its parent Frame.Width | ||
//making the TitleView overlap any AppBarButton of the CommandBar | ||
Result.Text = titleView.Frame.Width > titleViewParent.Frame.Width ? "FAILED" : "PASSED"; | ||
#endif | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...lesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/LongTitle/CommandBar_Page2.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,30 @@ | ||
<Page | ||
x:Class="UITests.Windows_UI_Xaml_Controls.CommandBar.LongTitle.CommandBar_Page2" | ||
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.CommandBar.LongTitle" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
|
||
<CommandBar Content="Title on Page 2" | ||
x:Name="Page2CommandBar" /> | ||
|
||
<StackPanel Grid.Row="1" | ||
VerticalAlignment="Center"> | ||
<Button x:Name="GoBackButton" | ||
Content="Go Back" | ||
Click="OnButtonClicked" | ||
HorizontalAlignment="Center"/> | ||
</StackPanel> | ||
|
||
</Grid> | ||
</Page> |
34 changes: 34 additions & 0 deletions
34
...App/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/LongTitle/CommandBar_Page2.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,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
|
||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 | ||
|
||
namespace UITests.Windows_UI_Xaml_Controls.CommandBar.LongTitle | ||
{ | ||
public sealed partial class CommandBar_Page2 : Page | ||
{ | ||
public CommandBar_Page2() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
public void OnButtonClicked(object sender, object args) | ||
{ | ||
Frame.GoBack(); | ||
} | ||
} | ||
} |