Fixed AccentTabGallery FabTabGallery naming confusing

There were two Xaml files that were almost identical and had the class names and file names reversed, this meant that when you opened the menu item for FabTabGallery the content was actually in AccentTabGallery.xaml. AccentTabGallery.xaml did not have a code behind.

Deleted FabTabGallery.xaml and Renamed AccentTabGalley.xaml to FabTabGallery.xaml to bring everything into line.
This commit is contained in:
Lachlan Gordon 2020-06-17 12:08:26 +10:00
Родитель 77a5c07065
Коммит 9fc727a59c
2 изменённых файлов: 11 добавлений и 180 удалений

Просмотреть файл

@ -1,176 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Xamarin.Forms.TabView;assembly=Xamarin.Forms.TabView"
x:Class="TabView.Sample.Views.FabTabGallery"
Title="FAB Tab Gallery">
<ContentPage.Resources>
<ResourceDictionary>
<x:String x:Key="IconPlay">&#xf40a;</x:String>
<x:String x:Key="IconDownload">&#xf1da;</x:String>
<ControlTemplate
x:Key="TabItemTemplate">
<Grid
RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image
Grid.Row="0"
VerticalOptions="Center"
HorizontalOptions="Center"
WidthRequest="24"
HeightRequest="24"
Margin="6"
Source="{TemplateBinding CurrentIcon}" />
<Label
Grid.Row="1"
HorizontalOptions="Center"
FontSize="{TemplateBinding FontSize}"
Text="{TemplateBinding Text}"
TextColor="{TemplateBinding CurrentTextColor}" />
</Grid>
</ControlTemplate>
<ControlTemplate
x:Key="FabTabItemTemplate">
<Grid>
<ImageButton
InputTransparent="True"
Source="{TemplateBinding CurrentIcon}"
Padding="10"
HorizontalOptions="Center"
BackgroundColor="#FF0000"
HeightRequest="60"
WidthRequest="60"
Margin="6">
<ImageButton.CornerRadius>
<OnPlatform x:TypeArguments="x:Int32">
<On Platform="iOS" Value="30"/>
<On Platform="Android" Value="60"/>
<On Platform="UWP" Value="24"/>
</OnPlatform>
</ImageButton.CornerRadius>
</ImageButton>
</Grid>
</ControlTemplate>
<Style
x:Key="TabItemStyle"
TargetType="controls:TabViewItem">
<Setter
Property="FontSize"
Value="12" />
<Setter
Property="TextColor"
Value="#979797" />
<Setter
Property="TextColorSelected"
Value="#FF0000" />
</Style>
<Style
x:Key="CustomTabStyle"
TargetType="controls:TabView">
<Setter
Property="IsTabTransitionEnabled"
Value="True" />
<Setter
Property="TabStripBackgroundColor"
Value="#E6F9F9F9" />
<Setter
Property="TabStripHeight"
Value="48" />
<Setter
Property="TabContentBackgroundColor"
Value="#F5F5F5" />
<Setter
Property="TabStripPlacement"
Value="Bottom" />
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<Grid>
<controls:TabView
Style="{StaticResource CustomTabStyle}">
<controls:TabViewItem
Text="Tab 1"
ControlTemplate="{StaticResource TabItemTemplate}"
Style="{StaticResource TabItemStyle}">
<controls:TabViewItem.Icon>
<FontImageSource
FontFamily="{DynamicResource MaterialFontFamily}"
Glyph="{StaticResource IconPlay}"
Size="24"
Color="#979797" />
</controls:TabViewItem.Icon>
<controls:TabViewItem.IconSelected>
<FontImageSource
FontFamily="{DynamicResource MaterialFontFamily}"
Glyph="{StaticResource IconPlay}"
Size="24"
Color="#FF0000" />
</controls:TabViewItem.IconSelected>
<Grid
BackgroundColor="LawnGreen">
<Label
HorizontalOptions="Center"
VerticalOptions="Center"
Text="TabContent1" />
</Grid>
</controls:TabViewItem>
<controls:TabViewItem
Text="Tab 2"
ControlTemplate="{StaticResource FabTabItemTemplate}"
Style="{StaticResource TabItemStyle}">
<controls:TabViewItem.Icon>
<FontImageSource
FontFamily="{DynamicResource MaterialFontFamily}"
Glyph="{StaticResource IconPlay}"
Size="24"
Color="#FFFFFF" />
</controls:TabViewItem.Icon>
<Grid
BackgroundColor="LightSkyBlue">
<Label
HorizontalOptions="Center"
VerticalOptions="Center"
Text="TabContent2" />
</Grid>
</controls:TabViewItem>
<controls:TabViewItem
Text="Tab 3"
ControlTemplate="{StaticResource TabItemTemplate}"
Style="{StaticResource TabItemStyle}">
<controls:TabViewItem.Icon>
<FontImageSource
FontFamily="{DynamicResource MaterialFontFamily}"
Glyph="{StaticResource IconDownload}"
Size="24"
Color="#979797" />
</controls:TabViewItem.Icon>
<controls:TabViewItem.IconSelected>
<FontImageSource
FontFamily="{DynamicResource MaterialFontFamily}"
Glyph="{StaticResource IconDownload}"
Size="24"
Color="#FF0000" />
</controls:TabViewItem.IconSelected>
<Grid
BackgroundColor="LightCoral">
<Label
HorizontalOptions="Center"
VerticalOptions="Center"
Text="TabContent3" />
</Grid>
</controls:TabViewItem>
</controls:TabView>
</Grid>
</ContentPage.Content>
</ContentPage>

Просмотреть файл

@ -3,7 +3,7 @@
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Xamarin.Forms.TabView;assembly=Xamarin.Forms.TabView"
x:Class="TabView.Sample.Views.AccentTabGallery"
x:Class="TabView.Sample.Views.FabTabGallery"
Title="FAB Tab Gallery">
<ContentPage.Resources>
<ResourceDictionary>
@ -44,11 +44,18 @@
Source="{TemplateBinding CurrentIcon}"
Padding="10"
HorizontalOptions="Center"
BackgroundColor="{TemplateBinding CurrentTextColor}"
CornerRadius="60"
BackgroundColor="#FF0000"
HeightRequest="60"
WidthRequest="60"
Margin="6" />
Margin="6">
<ImageButton.CornerRadius>
<OnPlatform x:TypeArguments="x:Int32">
<On Platform="iOS" Value="30"/>
<On Platform="Android" Value="60"/>
<On Platform="UWP" Value="24"/>
</OnPlatform>
</ImageButton.CornerRadius>
</ImageButton>
</Grid>
</ControlTemplate>