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

Commit

Permalink
Add some null checks (#1033)
Browse files Browse the repository at this point in the history
Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com>
Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
  • Loading branch information
4 people committed Mar 18, 2021
1 parent b15c187 commit 0285677
Showing 1 changed file with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -958,11 +958,27 @@ void UpdateIsTabStripVisible(bool isTabStripVisible)

void UpdateTabContentHeight(double tabContentHeight) => contentContainer.HeightRequest = tabContentHeight;

void UpdateTabIndicatorColor(Color tabIndicatorColor) => tabStripIndicator.BackgroundColor = tabIndicatorColor;
void UpdateTabIndicatorColor(Color tabIndicatorColor)
{
if (tabStripIndicator != null)
tabStripIndicator.BackgroundColor = tabIndicatorColor;
}

void UpdateTabIndicatorHeight(double tabIndicatorHeight) => tabStripIndicator.HeightRequest = tabIndicatorHeight;
void UpdateTabIndicatorHeight(double tabIndicatorHeight)
{
if (tabStripIndicator != null)
{
tabStripIndicator.HeightRequest = tabIndicatorHeight;
}
}

void UpdateTabIndicatorWidth(double tabIndicatorWidth) => tabStripIndicator.WidthRequest = tabIndicatorWidth;
void UpdateTabIndicatorWidth(double tabIndicatorWidth)
{
if (tabStripIndicator != null)
{
tabStripIndicator.WidthRequest = tabIndicatorWidth;
}
}

void UpdateTabIndicatorView(View tabIndicatorView)
{
Expand Down Expand Up @@ -991,9 +1007,21 @@ void UpdateTabIndicatorPlacement(TabIndicatorPlacement tabIndicatorPlacement)
UpdateTabIndicatorMargin();
}

void UpdateIsSwipeEnabled(bool isSwipeEnabled) => contentContainer.IsSwipeEnabled = isSwipeEnabled;
void UpdateIsSwipeEnabled(bool isSwipeEnabled)
{
if (contentContainer != null)
{
contentContainer.IsSwipeEnabled = isSwipeEnabled;
}
}

void UpdateIsTabTransitionEnabled(bool isTabTransitionEnabled) => contentContainer.IsScrollAnimated = isTabTransitionEnabled;
void UpdateIsTabTransitionEnabled(bool isTabTransitionEnabled)
{
if (contentContainer != null)
{
contentContainer.IsScrollAnimated = isTabTransitionEnabled;
}
}

void UpdateTabIndicatorPosition(int tabViewItemIndex)
{
Expand Down

0 comments on commit 0285677

Please sign in to comment.