-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
20 changed files
with
344 additions
and
45 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
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
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,58 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using CommunityToolkit.Mvvm.Input; | ||
using DemoApp.Views; | ||
|
||
namespace DemoApp.ViewModels; | ||
|
||
public partial class DemoTabsViewModel : BaseViewModel | ||
{ | ||
#region Constructors | ||
|
||
public DemoTabsViewModel( | ||
INavigationService navigationService) | ||
: base(navigationService) | ||
{ | ||
} | ||
|
||
#endregion Constructors | ||
|
||
#region Commands | ||
|
||
/// <summary> | ||
/// Navigate back to the homepage. | ||
/// </summary> | ||
[RelayCommand] | ||
private async Task GoBack() | ||
{ | ||
await navigationService.Pop(); | ||
} | ||
|
||
/// <summary> | ||
/// Navigate to Alpha tab page. | ||
/// </summary> | ||
[RelayCommand] | ||
private async Task SwitchToAlphaTabPage() | ||
{ | ||
await navigationService.SelectTab<AlphaTabPage>(); | ||
} | ||
|
||
/// <summary> | ||
/// Navigate to Beta tab page. | ||
/// </summary> | ||
[RelayCommand] | ||
private async Task SwitchToBetaTabPage() | ||
{ | ||
await navigationService.SelectTab<BetaTabPage>(); | ||
} | ||
|
||
/// <summary> | ||
/// Navigate to Charlie tab page. | ||
/// </summary> | ||
[RelayCommand] | ||
private async Task SwitchToCharlieTabPage() | ||
{ | ||
await navigationService.SelectTab<CharlieTabPage>(); | ||
} | ||
|
||
#endregion Commands | ||
} |
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
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,46 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage | ||
x:Class="DemoApp.Views.AlphaTabPage" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:burkus="http://burkus.co.uk" | ||
xmlns:vm="clr-namespace:DemoApp.ViewModels" | ||
Title="Alpha" | ||
x:DataType="vm:DemoTabsViewModel"> | ||
<ScrollView> | ||
<Grid | ||
Margin="15" | ||
MaximumWidthRequest="600" | ||
RowDefinitions="*,Auto,Auto,*" | ||
RowSpacing="10"> | ||
<Label | ||
Grid.Row="0" | ||
FontAttributes="Bold" | ||
FontSize="20" | ||
HorizontalOptions="CenterAndExpand" | ||
Text="Alpha" | ||
VerticalOptions="CenterAndExpand" /> | ||
<Button | ||
Grid.Row="1" | ||
Margin="0,20,0,0" | ||
Command="{Binding SwitchToBetaTabPageCommand}" | ||
MaximumWidthRequest="300" | ||
Text="Switch to Beta" | ||
VerticalOptions="Start" /> | ||
<Button | ||
Grid.Row="2" | ||
Margin="0,20,0,0" | ||
Command="{Binding SwitchToCharlieTabPageCommand}" | ||
MaximumWidthRequest="300" | ||
Text="Switch to Charlie" | ||
VerticalOptions="Start" /> | ||
<Button | ||
Grid.Row="3" | ||
Margin="0,20,0,0" | ||
Command="{Binding GoBackCommand}" | ||
MaximumWidthRequest="300" | ||
Text="Go Back" | ||
VerticalOptions="Start" /> | ||
</Grid> | ||
</ScrollView> | ||
</ContentPage> |
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,9 @@ | ||
namespace DemoApp.Views; | ||
|
||
public partial class AlphaTabPage : ContentPage | ||
{ | ||
public AlphaTabPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
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,46 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage | ||
x:Class="DemoApp.Views.BetaTabPage" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:burkus="http://burkus.co.uk" | ||
xmlns:vm="clr-namespace:DemoApp.ViewModels" | ||
Title="Beta" | ||
x:DataType="vm:DemoTabsViewModel"> | ||
<ScrollView> | ||
<Grid | ||
Margin="15" | ||
MaximumWidthRequest="600" | ||
RowDefinitions="*,Auto,Auto,*" | ||
RowSpacing="10"> | ||
<Label | ||
Grid.Row="0" | ||
FontAttributes="Bold" | ||
FontSize="20" | ||
HorizontalOptions="CenterAndExpand" | ||
Text="Beta" | ||
VerticalOptions="CenterAndExpand" /> | ||
<Button | ||
Grid.Row="1" | ||
Margin="0,20,0,0" | ||
Command="{Binding SwitchToAlphaTabPageCommand}" | ||
MaximumWidthRequest="300" | ||
Text="Switch to Alpha" | ||
VerticalOptions="Start" /> | ||
<Button | ||
Grid.Row="2" | ||
Margin="0,20,0,0" | ||
Command="{Binding SwitchToCharlieTabPageCommand}" | ||
MaximumWidthRequest="300" | ||
Text="Switch to Charlie" | ||
VerticalOptions="Start" /> | ||
<Button | ||
Grid.Row="3" | ||
Margin="0,20,0,0" | ||
Command="{Binding GoBackCommand}" | ||
MaximumWidthRequest="300" | ||
Text="Go Back" | ||
VerticalOptions="Start" /> | ||
</Grid> | ||
</ScrollView> | ||
</ContentPage> |
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,9 @@ | ||
namespace DemoApp.Views; | ||
|
||
public partial class BetaTabPage : ContentPage | ||
{ | ||
public BetaTabPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
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,46 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage | ||
x:Class="DemoApp.Views.CharlieTabPage" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:burkus="http://burkus.co.uk" | ||
xmlns:vm="clr-namespace:DemoApp.ViewModels" | ||
Title="Charlie" | ||
x:DataType="vm:DemoTabsViewModel"> | ||
<ScrollView> | ||
<Grid | ||
Margin="15" | ||
MaximumWidthRequest="600" | ||
RowDefinitions="*,Auto,Auto,*" | ||
RowSpacing="10"> | ||
<Label | ||
Grid.Row="0" | ||
FontAttributes="Bold" | ||
FontSize="20" | ||
HorizontalOptions="CenterAndExpand" | ||
Text="Charlie" | ||
VerticalOptions="CenterAndExpand" /> | ||
<Button | ||
Grid.Row="1" | ||
Margin="0,20,0,0" | ||
Command="{Binding SwitchToAlphaTabPageCommand}" | ||
MaximumWidthRequest="300" | ||
Text="Switch to Alpha" | ||
VerticalOptions="Start" /> | ||
<Button | ||
Grid.Row="2" | ||
Margin="0,20,0,0" | ||
Command="{Binding SwitchToBetaTabPageCommand}" | ||
MaximumWidthRequest="300" | ||
Text="Switch to Beta" | ||
VerticalOptions="Start" /> | ||
<Button | ||
Grid.Row="3" | ||
Margin="0,20,0,0" | ||
Command="{Binding GoBackCommand}" | ||
MaximumWidthRequest="300" | ||
Text="Go Back" | ||
VerticalOptions="Start" /> | ||
</Grid> | ||
</ScrollView> | ||
</ContentPage> |
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,9 @@ | ||
namespace DemoApp.Views; | ||
|
||
public partial class CharlieTabPage : ContentPage | ||
{ | ||
public CharlieTabPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
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,15 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<TabbedPage | ||
x:Class="DemoApp.Views.DemoTabsPage" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:burkus="http://burkus.co.uk" | ||
xmlns:views="clr-namespace:DemoApp.Views;assembly=DemoApp" | ||
xmlns:vm="clr-namespace:DemoApp.ViewModels" | ||
Title="Tabbed Page" | ||
x:DataType="vm:DemoTabsViewModel" | ||
BindingContext="{burkus:ResolveBindingContext x:TypeArguments=vm:DemoTabsViewModel}"> | ||
<views:AlphaTabPage Title="Alpha" /> | ||
<views:BetaTabPage Title="Beta" /> | ||
<views:CharlieTabPage Title="Charlie" /> | ||
</TabbedPage> |
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,9 @@ | ||
namespace DemoApp.Views; | ||
|
||
public partial class DemoTabsPage : TabbedPage | ||
{ | ||
public DemoTabsPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
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.