HandyOrg / HandyOrg/HandyControl

[Feature request]希望TabContrl使用绑定的TableItem可以通过ShowCloseButton关闭

Open
#496 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

:factory: enhancement
Dominant language
C#
Stars
7.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

使用场景如下:
某些TabItem我需要在首项显示,且固定不可关闭。
通过如下代码结构
<hc:TabControl> <hc:TabItem ShowCloseButton="False" Header="Home"/> <hc:TabItem ShowCloseButton="True" Header="TabItem1"/> </hc:TabControl>
但是通过绑定的方式,却不能实现
<hc:TabControl IsAnimationEnabled="True" ShowCloseButton="True" ShowOverflowButton="True" IsScrollable="True" ItemsSource="{Binding OpenMainMenuList}" SelectedItem="{Binding CurrentSelectedMainMenu}"> <hc:TabControl.ItemTemplate> <DataTemplate> <Grid hc:TabItem.ShowCloseButton="False"> <Grid.ColumnDefinitions> <ColumnDefinition Width="auto" MinWidth="24"/> <ColumnDefinition/> </Grid.ColumnDefinitions> <TextBlock Grid.Column="1" Text="{Binding TargetControlTitle}" TextTrimming="CharacterEllipsis"></TextBlock> </Grid> </DataTemplate> </hc:TabControl.ItemTemplate> <hc:TabControl.ContentTemplate> <DataTemplate> <hc:ScrollViewer Background="{DynamicResource MainWindowContentForegroundDrawingBrush}"> <ContentPresenter Name="PresenterMain" Content="{Binding TargetContrlObject}"/> <!--<TextBlock Text="{Binding Name}"/>--> </hc:ScrollViewer> </DataTemplate> </hc:TabControl.ContentTemplate> </hc:TabControl>
image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TabControl and its item-generation logic, then inspect how the ItemTemplate applies hc:TabItem.ShowCloseButton to bound items. Verify the behavior with an ItemsSource containing both fixed and closable tabs; done means each bound item can control its own close-button visibility while the control-level default remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.