-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(NavigationBar): Add lightweight styling to Navigation bar
- Loading branch information
1 parent
5b5f620
commit 8ef594d
Showing
9 changed files
with
2,479 additions
and
2,575 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
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
77 changes: 77 additions & 0 deletions
77
...no.Toolkit.Samples.Shared/Content/NestedSamples/FluentNavigationBarSampleNestedPage1.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,77 @@ | ||
<Page | ||
x:Class="Uno.Toolkit.Samples.Content.NestedSamples.FluentNavigationBarSampleNestedPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:ios="http://uno.ui/ios" | ||
xmlns:local="using:Uno.Toolkit.Samples.Content.NestedSamples" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
mc:Ignorable="d ios"> | ||
|
||
<Grid> | ||
|
||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<utu:NavigationBar | ||
Content="First Page" | ||
MainCommandMode="Action" | ||
Style="{StaticResource DefaultNavigationBar}"> | ||
<utu:NavigationBar.MainCommand> | ||
<AppBarButton | ||
Click="NavigateBack" | ||
Label="Close" | ||
Style="{StaticResource DefaultAppBarButtonStyle}"> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="ms-appx:///Assets/CloseIcon.png" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
</utu:NavigationBar.MainCommand> | ||
<utu:NavigationBar.PrimaryCommands> | ||
<AppBarButton | ||
Command="{Binding Primary1CountCommand}" | ||
Label="More" | ||
Style="{StaticResource DefaultAppBarButtonStyle}"> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="ms-appx:///Assets/MaterialIcon_Small.png" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
<AppBarButton | ||
Command="{Binding Primary2CountCommand}" | ||
Label="More" | ||
Style="{StaticResource DefaultAppBarButtonStyle}"> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="ms-appx:///Assets/AppleIcon_Small.png" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
</utu:NavigationBar.PrimaryCommands> | ||
<utu:NavigationBar.SecondaryCommands> | ||
<AppBarButton | ||
Command="{Binding Secondary1CountCommand}" | ||
Label="More" | ||
Style="{StaticResource DefaultAppBarButtonStyle}" /> | ||
<AppBarButton | ||
Command="{Binding Secondary2CountCommand}" | ||
Label="More" | ||
Style="{StaticResource DefaultAppBarButtonStyle}" /> | ||
<AppBarButton | ||
Command="{Binding Secondary3CountCommand}" | ||
Label="More" | ||
Style="{StaticResource DefaultAppBarButtonStyle}" /> | ||
</utu:NavigationBar.SecondaryCommands> | ||
</utu:NavigationBar> | ||
<StackPanel | ||
Grid.Row="1" | ||
VerticalAlignment="Stretch" | ||
Background="Yellow" | ||
BorderBrush="Red" | ||
BorderThickness="20" | ||
Spacing="8"> | ||
<Button Click="NavigateBack" Content="Exit sample" /> | ||
<Button Click="NavigateToNextPage" Content="Navigate To Second Page ****************for Fluent-**************" /> | ||
</StackPanel> | ||
</Grid> | ||
</Page> |
34 changes: 34 additions & 0 deletions
34
...Toolkit.Samples.Shared/Content/NestedSamples/FluentNavigationBarSampleNestedPage1.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.Toolkit.UI; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
#if IS_WINUI | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
#else | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
#endif | ||
|
||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 | ||
|
||
namespace Uno.Toolkit.Samples.Content.NestedSamples; | ||
|
||
/// <summary> | ||
/// An empty page that can be used on its own or navigated to within a Frame. | ||
/// </summary> | ||
public sealed partial class FluentNavigationBarSampleNestedPage : Page | ||
{ | ||
public FluentNavigationBarSampleNestedPage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void NavigateToNextPage(object sender, RoutedEventArgs e) => Frame.Navigate(typeof(FluentNavigationBarSampleNestedPage2)); | ||
|
||
private void NavigateBack(object sender, RoutedEventArgs e) => Shell.GetForCurrentView().BackNavigateFromNestedSample(); | ||
} |
41 changes: 41 additions & 0 deletions
41
...no.Toolkit.Samples.Shared/Content/NestedSamples/FluentNavigationBarSampleNestedPage2.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,41 @@ | ||
<Page | ||
x:Class="Uno.Toolkit.Samples.Content.NestedSamples.FluentNavigationBarSampleNestedPage2" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Uno.Toolkit.Samples.Content.NestedSamples" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
mc:Ignorable="d"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<utu:NavigationBar Content="Second Page" Style="{StaticResource DefaultNavigationBar}"> | ||
<utu:NavigationBar.PrimaryCommands> | ||
<AppBarButton Label="More" Style="{StaticResource DefaultAppBarButtonStyle}" /> | ||
<AppBarButton Label="More" Style="{StaticResource DefaultAppBarButtonStyle}" /> | ||
</utu:NavigationBar.PrimaryCommands> | ||
<utu:NavigationBar.SecondaryCommands> | ||
<AppBarButton Label="More" Style="{StaticResource DefaultAppBarButtonStyle}" /> | ||
<AppBarButton Label="More" Style="{StaticResource DefaultAppBarButtonStyle}" /> | ||
<AppBarButton Label="More" Style="{StaticResource DefaultAppBarButtonStyle}" /> | ||
</utu:NavigationBar.SecondaryCommands> | ||
</utu:NavigationBar> | ||
<StackPanel | ||
Grid.Row="1" | ||
Padding="16,0" | ||
VerticalAlignment="Center" | ||
Spacing="8"> | ||
<TextBlock> | ||
You can use the back button located on the left side of the CommandBar | ||
to navigate back. | ||
</TextBlock> | ||
|
||
<Button Click="NavigateBack" Content="Navigate Back" /> | ||
</StackPanel> | ||
</Grid> | ||
</Page> |
27 changes: 27 additions & 0 deletions
27
...Toolkit.Samples.Shared/Content/NestedSamples/FluentNavigationBarSampleNestedPage2.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,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.Toolkit.UI; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
#if IS_WINUI | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
#else | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
#endif | ||
|
||
namespace Uno.Toolkit.Samples.Content.NestedSamples; | ||
|
||
public sealed partial class FluentNavigationBarSampleNestedPage2 : Page | ||
{ | ||
public FluentNavigationBarSampleNestedPage2() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void NavigateBack(object sender, RoutedEventArgs e) => Frame.GoBack(); | ||
} |
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
Oops, something went wrong.