Click here to Skip to main content
13,701,732 members

Silverlight / WPF

 
GeneralRe: WPF Tab Styling Question #2 Pin
Pete O'Hanlon1-Jan-13 23:08
protectorPete O'Hanlon1-Jan-13 23:08 
GeneralRe: WPF Tab Styling Question #2 Pin
Kevin Marois2-Jan-13 15:41
memberKevin Marois2-Jan-13 15:41 
GeneralRe: WPF Tab Styling Question #2 Pin
Pete O'Hanlon2-Jan-13 21:05
protectorPete O'Hanlon2-Jan-13 21:05 
GeneralRe: WPF Tab Styling Question #2 Pin
Kevin Marois2-Jan-13 21:40
memberKevin Marois2-Jan-13 21:40 
QuestionWPF TabItem Styling Question Pin
Kevin Marois30-Dec-12 11:16
memberKevin Marois30-Dec-12 11:16 
AnswerRe: WPF TabItem Styling Question Pin
Pete O'Hanlon30-Dec-12 11:40
protectorPete O'Hanlon30-Dec-12 11:40 
GeneralRe: WPF TabItem Styling Question Pin
Kevin Marois30-Dec-12 15:16
memberKevin Marois30-Dec-12 15:16 
QuestionList Item Fore & Back Colors Pin
Kevin Marois29-Dec-12 7:52
memberKevin Marois29-Dec-12 7:52 
[UPDATE] Found it..



I have a listbox with hyperlinks as the list items. But the selected item is a blue bar with white text. I'd like to remove the highlighting. Here's what I have so far:

<UserControl.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="..\Resources.xaml"/>
        </ResourceDictionary.MergedDictionaries>

        <Style TargetType="{x:Type TreeViewItem}">
            <Style.Triggers>
                <Trigger Property="IsMouseCaptureWithin" Value="True">
                    <Setter Property="IsSelected" Value="True" />
                </Trigger>
                <Trigger Property="IsKeyboardFocusWithin" Value="True">
                    <Setter Property="IsSelected" Value="True" />
                </Trigger>
            </Style.Triggers>
        </Style>

        <DataTemplate DataType="{x:Type models:JobModel}">
            <StackPanel Orientation="Horizontal"

                        Margin="2">
                <Image Source="/FMG.UI.WPF;component/Media/Images/job_72.png"

					    Height="16"

					    Width="16"

                        Margin="0,0,3,0"/>
                <controls:TextBlockEx>
                    <Hyperlink Style="{StaticResource linkStyle}"

                                Command="{Binding SelectedJob, Mode=TwoWay}">
                        <TextBlock Text="{Binding JobNumber}"/>
                    </Hyperlink>
                </controls:TextBlockEx>
            </StackPanel>
        </DataTemplate>

    </ResourceDictionary>
</UserControl.Resources>


and

<ListBox Grid.Row="1"

            Grid.Column="0"

            ItemsSource="{Binding Jobs}"

            SelectedItem="{Binding SelectedJob}"

            BorderThickness="1"

            BorderBrush="#6593CF"

            Margin="-1,0,-1,-1">

    <ListBox.Resources>
        <Style TargetType="{x:Type ListBoxItem}">
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Foreground" Value="Red"/>
                    <Setter Property="Background" Value="Transparent"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </ListBox.Resources>

</ListBox>


Can someone show me how to remove the selected item's fore & back color so it ddoesn't appear selected?

Thanks
If it's not broken, fix it until it is

QuestionMVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
Member 137073829-Dec-12 1:58
memberMember 137073829-Dec-12 1:58 
AnswerRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
SledgeHammer0129-Dec-12 7:22
memberSledgeHammer0129-Dec-12 7:22 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
Member 137073829-Dec-12 15:44
memberMember 137073829-Dec-12 15:44 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
SledgeHammer0129-Dec-12 16:26
memberSledgeHammer0129-Dec-12 16:26 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
Member 137073829-Dec-12 17:00
memberMember 137073829-Dec-12 17:00 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
SledgeHammer0129-Dec-12 17:25
memberSledgeHammer0129-Dec-12 17:25 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
Member 137073829-Dec-12 19:02
memberMember 137073829-Dec-12 19:02 
Questionmm Pin
Aishwarya aishu28-Dec-12 0:44
memberAishwarya aishu28-Dec-12 0:44 
AnswerRe: mm Pin
Richard MacCutchan28-Dec-12 5:59
mvpRichard MacCutchan28-Dec-12 5:59 
Generalsiverlight Pin
Aishwarya aishu28-Dec-12 0:42
memberAishwarya aishu28-Dec-12 0:42 
GeneralRe: siverlight Pin
Richard MacCutchan28-Dec-12 5:57
mvpRichard MacCutchan28-Dec-12 5:57 
QuestionDataTrigger bind to a Property Pin
mbv80023-Dec-12 17:01
membermbv80023-Dec-12 17:01 
AnswerRe: DataTrigger bind to a Property Pin
Pete O'Hanlon23-Dec-12 19:17
protectorPete O'Hanlon23-Dec-12 19:17 
AnswerRe: DataTrigger bind to a Property Pin
Wayne Gaylard23-Dec-12 19:39
mentorWayne Gaylard23-Dec-12 19:39 
QuestionWPF Adorner Issues Pin
John Simmons / outlaw programmer17-Dec-12 10:52
mvpJohn Simmons / outlaw programmer17-Dec-12 10:52 
AnswerRe: WPF Adorner Issues Pin
SledgeHammer0118-Dec-12 4:49
memberSledgeHammer0118-Dec-12 4:49 
GeneralRe: WPF Adorner Issues Pin
John Simmons / outlaw programmer20-Dec-12 9:09
mvpJohn Simmons / outlaw programmer20-Dec-12 9:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180906.1 | Last Updated 19 Sep 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid