Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Fix tab view item font family (ios and uwp) (#1979)
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoNembrini committed Aug 14, 2023
1 parent 65b048e commit 5a6062f
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 1 deletion.
30 changes: 30 additions & 0 deletions samples/XCT.Sample/Pages/TestCases/Issue1978.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8" ?>
<pages:BasePage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:pages="clr-namespace:Xamarin.CommunityToolkit.Sample.Pages"
xmlns:vm="clr-namespace:Xamarin.CommunityToolkit.Sample.ViewModels.TestCases"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
x:Class="Xamarin.CommunityToolkit.Sample.Pages.TestCases.Issue1978Page">
<pages:BasePage.BindingContext>
<vm:Issue1978ViewModel />
</pages:BasePage.BindingContext>
<ContentPage.Content>
<xct:TabView>
<xct:TabViewItem Text="&#xf09d;"
TextColor="Green"
FontSize="24" FontSizeSelected="28"
FontFamily="FARegular"
IsSelected="True">
<Label Text="TabViewItem text should be an icon."
HorizontalTextAlignment="Center" />
</xct:TabViewItem>
<xct:TabViewItem Text="&#xf09d;"
TextColor="Black"
FontSize="24" FontSizeSelected="28"
FontFamily="FARegular">
<Label Text="TabViewItem text should be an icon."
HorizontalTextAlignment="Center" />
</xct:TabViewItem>
</xct:TabView>
</ContentPage.Content>
</pages:BasePage>
13 changes: 13 additions & 0 deletions samples/XCT.Sample/Pages/TestCases/Issue1978.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Xamarin.Forms.Xaml;

namespace Xamarin.CommunityToolkit.Sample.Pages.TestCases
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Issue1978Page : BasePage
{
public Issue1978Page()
{
InitializeComponent();
}
}
}
9 changes: 9 additions & 0 deletions samples/XCT.Sample/ViewModels/TestCases/Issue1978ViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Xamarin.CommunityToolkit.Sample.ViewModels.TestCases
{
public class Issue1978ViewModel : BaseViewModel
{
public Issue1978ViewModel()
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ public class TestCasesGalleryViewModel : BaseGalleryViewModel
new SectionModel(
typeof(Issue1900Page),
"BadgeView Issue GitHub #1900",
"BadgeView default text")
"BadgeView default text"),

new SectionModel(
typeof(Issue1978Page),
"TabView Issue GitHub #1978",
"TabView font family")
};
}
}
3 changes: 3 additions & 0 deletions samples/XCT.Sample/Xamarin.CommunityToolkit.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<EmbeddedResource Update="Pages\TestCases\Issue1900.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Pages\TestCases\Issue1978.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Pages\TestCases\Popups\PopupModalPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ protected override void OnParentSet()
text.SetBinding(Label.TextColorProperty, "CurrentTextColor");
text.SetBinding(Label.FontSizeProperty, "CurrentFontSize");
text.SetBinding(Label.FontAttributesProperty, "CurrentFontAttributes");
text.SetBinding(Label.FontFamilyProperty, "CurrentFontFamily");

badge.SetBinding(TabBadgeView.BackgroundColorProperty, "CurrentBadgeBackgroundColor");
badge.SetBinding(TabBadgeView.BorderColorProperty, "CurrentBadgeBorderColor");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ protected override void OnParentSet()
text.SetBinding(Label.TextColorProperty, "CurrentTextColor");
text.SetBinding(Label.FontSizeProperty, "CurrentFontSize");
text.SetBinding(Label.FontAttributesProperty, "CurrentFontAttributes");
text.SetBinding(Label.FontFamilyProperty, "CurrentFontFamily");

badge.SetBinding(TabBadgeView.BackgroundColorProperty, "CurrentBadgeBackgroundColor");
badge.SetBinding(TabBadgeView.TextProperty, "BadgeText");
Expand Down

0 comments on commit 5a6062f

Please sign in to comment.