Skip to content

Commit

Permalink
feat(iOS): Add CommandBar Sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpinedam committed Jan 21, 2021
1 parent e60a0f9 commit 66e661b
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/SamplesApp/UITests.Shared/UITests.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -3769,6 +3769,18 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CommandBar\BackButtonTitle\CommandBar_Frame.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CommandBar\BackButtonTitle\CommandBar_Page1.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CommandBar\BackButtonTitle\CommandBar_Page2.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Helpers\BindableBase.cs" />
Expand Down Expand Up @@ -6633,6 +6645,15 @@
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CommandBar\Background\CommandBar_Background_Frame.xaml.cs">
<DependentUpon>CommandBar_Background_Frame.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CommandBar\BackButtonTitle\CommandBar_Frame.xaml.cs">
<DependentUpon>CommandBar_Frame.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CommandBar\BackButtonTitle\CommandBar_Page1.xaml.cs">
<DependentUpon>CommandBar_Page1.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CommandBar\BackButtonTitle\CommandBar_Page2.xaml.cs">
<DependentUpon>CommandBar_Page2.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)Assets\0_leading_number_asset.png" />
Expand Down Expand Up @@ -6752,6 +6773,7 @@
<Folder Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\Repeater\WinUI\Samples\" />
<Folder Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\TimePicker\Model\" />
<Folder Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CommandBar\Background\" />
<Folder Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CommandBar\BackButtonTitle\" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Input\CaptureTests\OverlappedControls.xaml.cs">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<UserControl x:Class="UITests.Windows_UI_Xaml_Controls.CommandBar.BackButtonTitle.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.BackButtonTitle"
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}" />

<Button x:Name="NavigateInitialButton"
Grid.Row="1"
Content="Navigate to first page"
Click="Navigate_Initial" />
</Grid>
</UserControl>
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.BackButtonTitle
{
[SampleControlInfo("CommandBar", "CommandBar_BackButtonTitle")]
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));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Page
x:Class="UITests.Windows_UI_Xaml_Controls.CommandBar.BackButtonTitle.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.BackButtonTitle"
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>

<StackPanel Grid.Row="1"
Spacing="10"
VerticalAlignment="Center">

<TextBlock Text="Main Page"
HorizontalAlignment="Center" />

<Button x:Name="NavigateToPage2Button"
Content="Navigate to Page 2"
Grid.Row="1"
Click="OnButtonClicked"
HorizontalAlignment="Center"/>
</StackPanel>
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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;

// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236

namespace UITests.Windows_UI_Xaml_Controls.CommandBar.BackButtonTitle
{
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));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Page
x:Class="UITests.Windows_UI_Xaml_Controls.CommandBar.BackButtonTitle.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.BackButtonTitle"
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="Page 2"
x:Name="Page2CommandBar" />

</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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.BackButtonTitle
{
public sealed partial class CommandBar_Page2 : Page
{
public CommandBar_Page2()
{
this.InitializeComponent();
}
}
}

0 comments on commit 66e661b

Please sign in to comment.