Skip to content

Commit

Permalink
Update TabViewPage and related types in sample project (CommunityTool…
Browse files Browse the repository at this point in the history
…kit#121)

* Remove the original csharp only implementation of `TabViewPage` and replaced it with a XAML with code-behind implementation.
* Add `TabViewViewModel` for the `TabView` sample page.
  • Loading branch information
ChaplinMarchais committed Jan 30, 2022
1 parent fc815ed commit 43228da
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 16 deletions.
16 changes: 0 additions & 16 deletions samples/CommunityToolkit.Maui.Sample/Pages/Views/TabViewPage.cs

This file was deleted.

46 changes: 46 additions & 0 deletions samples/CommunityToolkit.Maui.Sample/Pages/Views/TabViewPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" ?>
<pages:BasePage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:pages="clr-namespace:CommunityToolkit.Maui.Sample.Pages"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/tookit"
xmlns:tv="clr-namespace:CommunityToolkit.Maui.Views.TabView;assembly=CommunityToolkit.Maui"
x:Class="CommunityToolkit.Maui.Sample.Pages.Views.TabViewPage">
<Grid>
<tv:TabView
TabStripPlacement="Bottom"
TabStripBackgroundColor="Blue"
TabStripHeight="60"
TabIndicatorColor="Yellow"
TabContentBackgroundColor="Yellow">

<tv:TabViewItem
Icon="triangle.png"
Text="Tab 1"
TextColor="White"
TextColorSelected="Yellow"
FontSize="12">
<Grid
BackgroundColor="Gray">
<Label
HorizontalOptions="Center"
VerticalOptions="Center"
Text="TabContent1" />
</Grid>
</tv:TabViewItem>

<tv:TabViewItem
Icon="circle.png"
Text="Tab 2"
TextColor="White"
TextColorSelected="Yellow"
FontSize="12">
<Grid>
<Label
HorizontalOptions="Center"
VerticalOptions="Center"
Text="TabContent2" />
</Grid>
</tv:TabViewItem>
</tv:TabView>
</Grid>
</pages:BasePage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using CommunityToolkit.Maui.Sample.Pages;

namespace CommunityToolkit.Maui.Sample;

public partial class TabViewPage : BasePage
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
public partial class TabViewViewModel : BaseViewModel
{
}

0 comments on commit 43228da

Please sign in to comment.