Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TagContainer通过ItemsSource绑定生成的Tag的ShowCloseButton属性默认为True #1355

Closed
xiaoheigege opened this issue Feb 21, 2023 · 1 comment
Labels
🏭 enhancement New feature or request

Comments

@xiaoheigege
Copy link

在用TagContainer绑定生成Tag时 这些Tag的ShowCloseButton属性默认为true,希望可以给TagContainer添加一个属性用来指示生成的Tag是否允许删除,从而匹配不同的需求

@NaBian NaBian added the 🏭 enhancement New feature or request label Mar 18, 2023
@aierong
Copy link

aierong commented Apr 4, 2023

绑定一下,就可以实现你要的:

<hc:TagContainer Width="420" Margin="11" Padding="5" ItemContainerStyle="{StaticResource TagCustomStyle}" ItemsSource="{Binding Students}" />

<UserControl.Resources> <Style x:Key="TagCustomStyle" BasedOn="{StaticResource TagBaseStyle}" TargetType="hc:Tag"> <Setter Property="Content" Value="{Binding Name}" /> <Setter Property="Margin" Value="5" /> <Setter Property="IsSelected" Value="{Binding IsSelected}" /> <Setter Property="ShowCloseButton" Value="{Binding ShowCloseButton}" /> </Style> </UserControl.Resources>

@NaBian NaBian closed this as completed in 6245453 Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏭 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants