Click here to Skip to main content
15,888,461 members
Home / Discussions / WPF
   

WPF

 
QuestionWPF Style Question Pin
Kevin Marois15-Nov-10 7:08
professionalKevin Marois15-Nov-10 7:08 
AnswerRe: WPF Style Question Pin
#realJSOP15-Nov-10 8:03
mve#realJSOP15-Nov-10 8:03 
GeneralRe: WPF Style Question Pin
Kevin Marois15-Nov-10 8:05
professionalKevin Marois15-Nov-10 8:05 
GeneralRe: WPF Style Question [modified] Pin
SledgeHammer0115-Nov-10 8:55
SledgeHammer0115-Nov-10 8:55 
GeneralRe: WPF Style Question Pin
Kevin Marois15-Nov-10 12:13
professionalKevin Marois15-Nov-10 12:13 
GeneralRe: WPF Style Question Pin
SledgeHammer0115-Nov-10 13:29
SledgeHammer0115-Nov-10 13:29 
GeneralRe: WPF Style Question Pin
Kevin Marois16-Nov-10 4:37
professionalKevin Marois16-Nov-10 4:37 
GeneralRe: WPF Style Question Pin
SledgeHammer0116-Nov-10 14:06
SledgeHammer0116-Nov-10 14:06 
Oh... duh... sorry, I didn't read your question closely enough Smile | :) . Two things...

1) your TargetType actually needs to be "{x:Type TreeViewItem}"

2) doing the IsSelected thing will actually be a little tricky... if you examine the stock TreeViewItem template, you'll find a template trigger is doing it:

<Trigger Property="IsSelected" Value="true">
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
</Trigger>

So, unfortunately, that is "overriding" your trigger because the border "Bd" sits on top of the item. What you did works for IsMouseOver (on non selected items) because Bd is transparent in that case and the TreeViewItem background shows through.

You'd need to replace the entire template for TreeViewItem just to get to that sucker Frown | :(
GeneralRe: WPF Style Question Pin
SledgeHammer0116-Nov-10 14:10
SledgeHammer0116-Nov-10 14:10 
Questionexecute code on Server-side - Silverlight Pin
jadughar14-Nov-10 19:40
jadughar14-Nov-10 19:40 
AnswerRe: execute code on Server-side - Silverlight Pin
Vimalsoft(Pty) Ltd14-Nov-10 20:10
professionalVimalsoft(Pty) Ltd14-Nov-10 20:10 
AnswerRe: execute code on Server-side - Silverlight Pin
Abhinav S14-Nov-10 20:40
Abhinav S14-Nov-10 20:40 
GeneralRe: execute code on Server-side - Silverlight Pin
jadughar14-Nov-10 21:07
jadughar14-Nov-10 21:07 
QuestionMouse Move - how to determine span of move (i.e. delta x and delta y) Pin
devvvy14-Nov-10 16:10
devvvy14-Nov-10 16:10 
AnswerRe: Mouse Move - how to determine span of move (i.e. delta x and delta y) Pin
Dr.Walt Fair, PE14-Nov-10 16:23
professionalDr.Walt Fair, PE14-Nov-10 16:23 
QuestionXenApp vs WPF Popup (repaint problem when Popup Minimized") Pin
devvvy14-Nov-10 15:43
devvvy14-Nov-10 15:43 
QuestionData Trigger Problem Pin
carrigart13-Nov-10 15:13
carrigart13-Nov-10 15:13 
QuestionAccordion add/remove Items at runtime Pin
ekimpl13-Nov-10 0:47
ekimpl13-Nov-10 0:47 
AnswerRe: Accordion add/remove Items at runtime Pin
Mycroft Holmes13-Nov-10 11:58
professionalMycroft Holmes13-Nov-10 11:58 
GeneralRe: Accordion add/remove Items at runtime Pin
ekimpl13-Nov-10 20:59
ekimpl13-Nov-10 20:59 
AnswerRe: Accordion add/remove Items at runtime Pin
Abhinav S13-Nov-10 16:38
Abhinav S13-Nov-10 16:38 
GeneralRe: Accordion add/remove Items at runtime Pin
ekimpl13-Nov-10 21:15
ekimpl13-Nov-10 21:15 
GeneralRe: Accordion add/remove Items at runtime Pin
ekimpl14-Nov-10 5:56
ekimpl14-Nov-10 5:56 
QuestionMultiple xap files after rename Pin
Mycroft Holmes12-Nov-10 16:38
professionalMycroft Holmes12-Nov-10 16:38 
AnswerRe: Multiple xap files after rename Pin
Mycroft Holmes13-Nov-10 21:06
professionalMycroft Holmes13-Nov-10 21:06 

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.