Click here to Skip to main content
15,867,756 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF Tab Styling Question #2 Pin
Pete O'Hanlon1-Jan-13 23:08
subeditorPete O'Hanlon1-Jan-13 23:08 
GeneralRe: WPF Tab Styling Question #2 Pin
Kevin Marois2-Jan-13 15:41
professionalKevin Marois2-Jan-13 15:41 
GeneralRe: WPF Tab Styling Question #2 Pin
Pete O'Hanlon2-Jan-13 21:05
subeditorPete O'Hanlon2-Jan-13 21:05 
GeneralRe: WPF Tab Styling Question #2 Pin
Kevin Marois2-Jan-13 21:40
professionalKevin Marois2-Jan-13 21:40 
QuestionWPF TabItem Styling Question Pin
Kevin Marois30-Dec-12 11:16
professionalKevin Marois30-Dec-12 11:16 
AnswerRe: WPF TabItem Styling Question Pin
Pete O'Hanlon30-Dec-12 11:40
subeditorPete O'Hanlon30-Dec-12 11:40 
GeneralRe: WPF TabItem Styling Question Pin
Kevin Marois30-Dec-12 15:16
professionalKevin Marois30-Dec-12 15:16 
QuestionList Item Fore & Back Colors Pin
Kevin Marois29-Dec-12 7:52
professionalKevin 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
Member 137073829-Dec-12 1:58 
AnswerRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
SledgeHammer0129-Dec-12 7:22
SledgeHammer0129-Dec-12 7:22 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
Member 137073829-Dec-12 15:44
Member 137073829-Dec-12 15:44 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
SledgeHammer0129-Dec-12 16:26
SledgeHammer0129-Dec-12 16:26 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
Member 137073829-Dec-12 17:00
Member 137073829-Dec-12 17:00 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
SledgeHammer0129-Dec-12 17:25
SledgeHammer0129-Dec-12 17:25 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
Member 137073829-Dec-12 19:02
Member 137073829-Dec-12 19:02 
Questionmm Pin
Aishwarya aishu28-Dec-12 0:44
Aishwarya aishu28-Dec-12 0:44 
AnswerRe: mm Pin
Richard MacCutchan28-Dec-12 5:59
mveRichard MacCutchan28-Dec-12 5:59 
Generalsiverlight Pin
Aishwarya aishu28-Dec-12 0:42
Aishwarya aishu28-Dec-12 0:42 
GeneralRe: siverlight Pin
Richard MacCutchan28-Dec-12 5:57
mveRichard MacCutchan28-Dec-12 5:57 
QuestionDataTrigger bind to a Property Pin
mbv80023-Dec-12 17:01
mbv80023-Dec-12 17:01 
AnswerRe: DataTrigger bind to a Property Pin
Pete O'Hanlon23-Dec-12 19:17
subeditorPete O'Hanlon23-Dec-12 19:17 
AnswerRe: DataTrigger bind to a Property Pin
Wayne Gaylard23-Dec-12 19:39
professionalWayne Gaylard23-Dec-12 19:39 
QuestionWPF Adorner Issues Pin
#realJSOP17-Dec-12 10:52
mve#realJSOP17-Dec-12 10:52 
AnswerRe: WPF Adorner Issues Pin
SledgeHammer0118-Dec-12 4:49
SledgeHammer0118-Dec-12 4:49 
GeneralRe: WPF Adorner Issues Pin
#realJSOP20-Dec-12 9:09
mve#realJSOP20-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.