Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace TabPage with TabView #3

Merged
merged 5 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 35 additions & 36 deletions CS/CreateTabItemsManually/TabPage_CreateItems/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
<dxn:TabPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:dxn="clr-namespace:DevExpress.Maui.Navigation;assembly=DevExpress.Maui.Navigation"
xmlns:dxc="clr-namespace:DevExpress.Maui.Controls;assembly=DevExpress.Maui.Controls"
xmlns:local="clr-namespace:TabPage_CreateItems"
x:Class="TabPage_CreateItems.MainPage"
HeaderPanelPosition="Bottom"
>
<ContentPage.Resources>
<Color x:Key="mail_blue">#1e88e5</Color>
<Color x:Key="calendar_green">#43a047</Color>
<Color x:Key="people_red">#e53935</Color>
</ContentPage.Resources>
<dxc:TabView HeaderPanelPosition="Bottom"
ItemHeaderWidth="*"
IsSelectedItemIndicatorVisible="False"
ItemHeaderTextColor="#757575"
ItemHeaderIconColor="#757575">
<dxn:TabPage.Resources>
<Color x:Key="mail_blue">#1e88e5</Color>
<Color x:Key="calendar_green">#43a047</Color>
<Color x:Key="people_red">#e53935</Color>
</dxn:TabPage.Resources>
<dxn:TabPageItem SelectedHeaderTextColor="{StaticResource mail_blue}"
SelectedHeaderIconColor="{StaticResource mail_blue}">
<dxn:TabPageItem.Content>
<ContentPage Title="Mail" IconImageSource="email">
<dxc:TabViewItem SelectedHeaderTextColor="{StaticResource mail_blue}"
SelectedHeaderIconColor="{StaticResource mail_blue}"
HeaderText="Mail" HeaderIcon="email">
<dxc:TabViewItem.Content>
<Label Text="Mail List Here"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand"/>
</ContentPage>
</dxn:TabPageItem.Content>
</dxn:TabPageItem>
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand"/>
</dxc:TabViewItem.Content>
</dxc:TabViewItem>

<dxn:TabPageItem SelectedHeaderTextColor="{StaticResource calendar_green}"
SelectedHeaderIconColor="{StaticResource calendar_green}">
<dxn:TabPageItem.Content>
<ContentPage Title="Calendar" IconImageSource="calendar">
<dxc:TabViewItem SelectedHeaderTextColor="{StaticResource calendar_green}"
SelectedHeaderIconColor="{StaticResource calendar_green}"
HeaderText="Calendar" HeaderIcon="calendar">
<dxc:TabViewItem.Content>
<Label Text="Calendar Here"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand"/>
</ContentPage>
</dxn:TabPageItem.Content>
</dxn:TabPageItem>

<dxn:TabPageItem SelectedHeaderTextColor="{StaticResource people_red}"
SelectedHeaderIconColor="{StaticResource people_red}">
<dxn:TabPageItem.Content>
<ContentPage Title="People" IconImageSource="people">
<Label Text="People Here"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand"/>
</ContentPage>
</dxn:TabPageItem.Content>
</dxn:TabPageItem>
</dxn:TabPage>
</dxc:TabViewItem.Content>
</dxc:TabViewItem>

<dxc:TabViewItem SelectedHeaderTextColor="{StaticResource people_red}"
SelectedHeaderIconColor="{StaticResource people_red}"
HeaderText="People" HeaderIcon="people">
<dxc:TabViewItem.Content>
<Label Text="People Here"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand"/>
</dxc:TabViewItem.Content>
</dxc:TabViewItem>
</dxc:TabView>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using Microsoft.Maui.Controls;
using DevExpress.Maui.Navigation;

namespace TabPage_CreateItems {
public partial class MainPage : TabPage {
public partial class MainPage : ContentPage {
public MainPage() {
InitializeComponent();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DevExpress.Maui.Navigation" Version="22.1.1-pre-*" />
<PackageReference Include="DevExpress.Maui.Controls" Version="22.1.1-pre-*" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<dxn:TabPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:dxn="clr-namespace:DevExpress.Maui.Navigation;assembly=DevExpress.Maui.Navigation"
xmlns:local="clr-namespace:TabPage_GenerateItems"
x:Class="TabPage_GenerateItems.MainPage"
ItemsSource="{Binding CarModelsByBrand}"
xmlns:dxc="clr-namespace:DevExpress.Maui.Controls;assembly=DevExpress.Maui.Controls"
>
<ContentPage.Resources>
<local:BoolToColorConverter x:Key="boolToColorConverter" TrueSource="White" FalseSource="#90FFFFFF"/>
</ContentPage.Resources>
<ContentPage.BindingContext>
<local:MainViewModel/>
</ContentPage.BindingContext>
<dxc:TabView ItemsSource="{Binding CarModelsByBrand}"
SelectedItemIndex="{Binding SelectedIndex, Mode=TwoWay}"
ItemHeaderMinWidth="90"
ItemHeaderMaxWidth="360"
Expand All @@ -13,14 +20,8 @@
HeaderPanelShadowRadius="3"
IsSelectedItemIndicatorVisible="True"
SelectedItemIndicatorColor="White">
<dxn:TabPage.Resources>
<local:BoolToColorConverter x:Key="boolToColorConverter" TrueSource="White" FalseSource="#90FFFFFF"/>
</dxn:TabPage.Resources>
<dxn:TabPage.BindingContext>
<local:MainViewModel/>
</dxn:TabPage.BindingContext>
<dxn:TabPage.ItemHeaderTemplate>
<DataTemplate>
<dxc:TabView.ItemHeaderTemplate>
<DataTemplate>
<Label
x:Name="label"
Margin="16,48,16,16"
Expand All @@ -30,21 +31,20 @@
Text="{Binding BrandName}"
HorizontalTextAlignment="Center"
Padding="5,0"/>
</DataTemplate>
</dxn:TabPage.ItemHeaderTemplate>
<dxn:TabPage.ItemTemplate>
<DataTemplate>
<ContentPage>
<ListView ItemsSource="{Binding CarModels}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
</DataTemplate>
</dxc:TabView.ItemHeaderTemplate>
<dxc:TabView.ItemTemplate>
<DataTemplate>

<CollectionView ItemsSource="{Binding CarModels}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Label Padding="5" Text="{Binding FullName}" />
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
</DataTemplate>
</dxn:TabPage.ItemTemplate>
</dxn:TabPage>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>

</DataTemplate>
</dxc:TabView.ItemTemplate>
</dxc:TabView>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
using System.Globalization;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
using DevExpress.Maui.Navigation;

namespace TabPage_GenerateItems {
public partial class MainPage : TabPage {
public partial class MainPage : ContentPage {
public MainPage() {
InitializeComponent();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
<MauiFont Include="Resources\Fonts\*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DevExpress.Maui.Navigation" Version="22.1.1-pre-*" />
<ItemGroup>
<PackageReference Include="DevExpress.Maui.Controls" Version="22.1.1-pre-*" />
</ItemGroup>

<PropertyGroup>
Expand Down