Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ControlTemplate and Binding problem
Message
De
26/12/2009 13:55:31
 
 
À
26/12/2009 04:39:18
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01440313
Message ID:
01440700
Vues:
30
>Hi,
>Thank you for this. But - it doesn't work - it displays exactly the behaviour that I am seeing:
>
>Without the ControlTemplate clicking on the ExpanderButton in the TreeViewItem will expand the node in the tree and also fire the accessor on MyDataItem.IsExpanded.
>
>With the ControlTemplate in place then neither happens.....
>
>At least you have a reproducible case - and your test code is far simpler that the real version I'm working on so I'm going to play with that,
>
>Oh and, FWIW, you're using a different ControlTemplate to me (mine is the XP one - yours looks like Vista?)
>
>One other thing I've just noticed: If, with the ControlTemplate in place, you click on the ExpanderButton then the image toggles but the items aren't shown. Conversely, if you use the code behind button the items are shown but the ExpanderButton image doesn't change....
>
>
>Best,
>Viv

Well... that's why I guessed:

>>I don't get what's wrong<g>

Oh... those... I didn't hook those up. Let me take a look at my code and see how it's done.

Edit: On the toggle button:
<ToggleButton IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press" Name="Expander">
BTW I grabbed the template for AERO from ShowMeTheTemplate. Where did you get yours? The above should be the same in both, and seems to be working for me. I was just double clicking to test instead of using the expanders.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform