Skip to content

How to make the first(primary) selected item in listbox multiple mode different in style? #7987

Closed Answered by CodingOctocat
CodingOctocat asked this question in Q&A
Discussion options

You must be logged in to vote

I did a different approach and it worked fine, I added a PrimarySelectedItem (impl INotifyPropertyChange) to the VM:

<TextBlock.Style>
    <Style TargetType="{x:Type TextBlock}">
        <Setter Property="FontWeight" Value="Normal" />

        <Style.Triggers>
            <DataTrigger Value="{StaticResource True}">
                <DataTrigger.Binding>
                    <MultiBinding Converter="{StaticResource ValueEqualsMultiConverter}">
                        <Binding Path="." />
                        <Binding Path="DataContext.PrimarySelectedItem"
                                 RelativeSource="{RelativeSource AncestorType={x:Type ListBox}}" />
                    </MultiBinding>…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by CodingOctocat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant