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

WPF

 
AnswerRe: Setting an expiry date for WPF Theme DLL Pin
SledgeHammer0126-Nov-11 16:18
SledgeHammer0126-Nov-11 16:18 
GeneralRe: Setting an expiry date for WPF Theme DLL Pin
Prasoon Chaudhary27-Nov-11 4:30
Prasoon Chaudhary27-Nov-11 4:30 
GeneralRe: Setting an expiry date for WPF Theme DLL Pin
SledgeHammer0127-Nov-11 7:53
SledgeHammer0127-Nov-11 7:53 
GeneralRe: Setting an expiry date for WPF Theme DLL Pin
Prasoon Chaudhary27-Nov-11 18:09
Prasoon Chaudhary27-Nov-11 18:09 
QuestionWPF TreeView DataTemplate - Select Visual Parent Pin
Kevin Marois25-Nov-11 8:48
professionalKevin Marois25-Nov-11 8:48 
AnswerRe: WPF TreeView DataTemplate - Select Visual Parent Pin
SledgeHammer0126-Nov-11 10:12
SledgeHammer0126-Nov-11 10:12 
GeneralRe: WPF TreeView DataTemplate - Select Visual Parent Pin
Kevin Marois26-Nov-11 11:02
professionalKevin Marois26-Nov-11 11:02 
GeneralRe: WPF TreeView DataTemplate - Select Visual Parent Pin
Kevin Marois28-Nov-11 11:44
professionalKevin Marois28-Nov-11 11:44 
Turns out this works only to a point....

I have a hierarcy of objects like:

Product
    | Category
         | Part


Until the user first clicks a Part node in the tree, the controls in the Part template do not "know" about the underlying data source. Once a Part node is clicked, then I am able to determine the data object bound to it. In other words, the XAML you provided only seems to work after a part not is initially selected.

Also related to this, the WPF treeview's SelectedItem property is read-only, so it does not show up in the XAML intellisense.. I'm not sure why/how the WPF developers ever thought this would be a good design. So, since I cannot bind to the selected item, I really have no way of determining what node was selected without using the SelectedItemChanged event (I'm using MVVM).

Bottom line, I'm still stuck with:

1. Can't tell what node is selected
2. Can't tell from the button or textbox what the node's data object is.

[UPDATE]
I just changed the XAML you gave me to

<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>


I added the "IsMouseCaptureWithin" and it seems to be working. Stay tuned.
Everything makes sense in someone's mind


modified 28-Nov-11 18:03pm.

GeneralRe: WPF TreeView DataTemplate - Select Visual Parent Pin
SledgeHammer0128-Nov-11 12:02
SledgeHammer0128-Nov-11 12:02 
GeneralRe: WPF TreeView DataTemplate - Select Visual Parent Pin
Kevin Marois28-Nov-11 12:25
professionalKevin Marois28-Nov-11 12:25 
GeneralRe: WPF TreeView DataTemplate - Select Visual Parent Pin
SledgeHammer0128-Nov-11 12:36
SledgeHammer0128-Nov-11 12:36 
QuestionCross-field validation Pin
Geysser24-Nov-11 4:39
Geysser24-Nov-11 4:39 
AnswerRe: Cross-field validation Pin
Pete O'Hanlon24-Nov-11 10:24
mvePete O'Hanlon24-Nov-11 10:24 
GeneralRe: Cross-field validation Pin
Geysser24-Nov-11 17:58
Geysser24-Nov-11 17:58 
GeneralRe: Cross-field validation Pin
Wayne Gaylard24-Nov-11 18:41
professionalWayne Gaylard24-Nov-11 18:41 
GeneralRe: Cross-field validation Pin
Geysser24-Nov-11 20:24
Geysser24-Nov-11 20:24 
GeneralRe: Cross-field validation Pin
Pete O'Hanlon24-Nov-11 22:11
mvePete O'Hanlon24-Nov-11 22:11 
GeneralRe: Cross-field validation Pin
Geysser24-Nov-11 23:33
Geysser24-Nov-11 23:33 
QuestionDataTemplate Binding Question Pin
Kevin Marois23-Nov-11 7:02
professionalKevin Marois23-Nov-11 7:02 
AnswerRe: DataTemplate Binding Question Pin
SledgeHammer0123-Nov-11 11:30
SledgeHammer0123-Nov-11 11:30 
Questionsilverlight version Pin
arkiboys23-Nov-11 6:18
arkiboys23-Nov-11 6:18 
AnswerRe: silverlight version Pin
Mark Salsbery23-Nov-11 8:57
Mark Salsbery23-Nov-11 8:57 
QuestionOpenDialog Pin
Dammie223-Nov-11 5:56
Dammie223-Nov-11 5:56 
AnswerRe: OpenDialog Pin
Pete O'Hanlon23-Nov-11 6:01
mvePete O'Hanlon23-Nov-11 6:01 
QuestionRe: OpenDialog Pin
Dammie223-Nov-11 6:11
Dammie223-Nov-11 6:11 

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.