Skip to content
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
24 changes: 15 additions & 9 deletions dev/TabView/TabViewListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,7 @@ TabViewListView::TabViewListView()

void TabViewListView::OnSelectedIndexPropertyChanged(const winrt::DependencyObject& sender, const winrt::DependencyProperty& args)
{
winrt::VisualStateManager::GoToState(
*this,
(SelectedIndex() == 0) ? L"LeftBottomBorderLineShort" : L"LeftBottomBorderLineNormal",
false /*useTransitions*/);

winrt::VisualStateManager::GoToState(
*this,
(SelectedIndex() == (int)(Items().Size() - 1)) ? L"RightBottomBorderLineShort" : L"RightBottomBorderLineNormal",
false /*useTransitions*/);
UpdateBottomBorderVisualState();
}

// IItemsControlOverrides
Expand Down Expand Up @@ -60,6 +52,7 @@ void TabViewListView::OnItemsChanged(winrt::IInspectable const& item)
const auto internalTabView = winrt::get_self<TabView>(tabView);
internalTabView->OnItemsChanged(item);
}
UpdateBottomBorderVisualState();
}

void TabViewListView::PrepareContainerForItemOverride(const winrt::DependencyObject& element, const winrt::IInspectable& item)
Expand Down Expand Up @@ -92,3 +85,16 @@ void TabViewListView::OnContainerContentChanging(const winrt::IInspectable& send
internalTabView->UpdateTabContent();
}
}

void TabViewListView::UpdateBottomBorderVisualState()
{
winrt::VisualStateManager::GoToState(
*this,
(SelectedIndex() == 0) ? L"LeftBottomBorderLineShort" : L"LeftBottomBorderLineNormal",
false /*useTransitions*/);

winrt::VisualStateManager::GoToState(
*this,
(SelectedIndex() == (int)(Items().Size() - 1)) ? L"RightBottomBorderLineShort" : L"RightBottomBorderLineNormal",
false /*useTransitions*/);
}
1 change: 1 addition & 0 deletions dev/TabView/TabViewListView.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ class TabViewListView :
private:
void OnContainerContentChanging(const winrt::IInspectable& sender, const winrt::ContainerContentChangingEventArgs& args);
void OnSelectedIndexPropertyChanged(const winrt::DependencyObject& sender, const winrt::DependencyProperty& args);
void UpdateBottomBorderVisualState();
};