How to customize TabView in WinUI3

C CB 175 Reputation points
2024-06-28T02:26:12.2266667+00:00

How to customize TabView in WinUI3 as follows:

  1. Set the header of the selected tab to bold font and red background, and the header of the unselected tab to yellow background.
  2. Leave some space between each tab header.
  3. Add a red dividing line between the head of the tab and the content area below, with the width of the line equal to the width of the entire TabView.
  4. Add a red rectangular box to the outermost layer of each tab's content area, so that the content is displayed within the rectangular box.

To my knowledge, implementing these may require modifying the control template, but I am not familiar with it. I hope those who know can provide a complete XAML example.

Furthermore, how to achieve the following functions:

How to make the display text of the tab header editable after clicking, and cannot input or paste certain special characters such as slashes during editing, losing focus or completing editing after entering, just like changing the name of a Windows file/folder.

Windows development | Windows App SDK
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.