Click here to Skip to main content
15,886,829 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: How to add all recommended icon sizes to WPF desktop application? Pin
Matt T Heffron14-Apr-14 13:44
professionalMatt T Heffron14-Apr-14 13:44 
QuestionHow to get TreeView SelectedItem/Value? Pin
BeeDev11-Apr-14 10:52
BeeDev11-Apr-14 10:52 
AnswerRe: How to get TreeView SelectedItem/Value? Pin
SledgeHammer0111-Apr-14 12:14
SledgeHammer0111-Apr-14 12:14 
GeneralRe: How to get TreeView SelectedItem/Value? Pin
BeeDev14-Apr-14 3:48
BeeDev14-Apr-14 3:48 
GeneralRe: How to get TreeView SelectedItem/Value? Pin
SledgeHammer0114-Apr-14 4:53
SledgeHammer0114-Apr-14 4:53 
AnswerRe: How to get TreeView SelectedItem/Value? Pin
Mycroft Holmes11-Apr-14 13:41
professionalMycroft Holmes11-Apr-14 13:41 
AnswerRe: How to get TreeView SelectedItem/Value? Pin
USAFHokie8016-Apr-14 8:55
USAFHokie8016-Apr-14 8:55 
AnswerRe: Overlay Tree view expander icon on the content Pin
SledgeHammer018-Apr-14 13:26
SledgeHammer018-Apr-14 13:26 
The +/- is a styled ToggleButton (ControlTemplate\Grid\ToggleButton).

The content is a normal styled ContentPresenter(s) hosted in an ItemsPresenter (ControlTemplate\Grid\ItemsPresenter). An ItemsPresenter is a collection of Items. For the TreeView, these are additional ItemsPresenter(s) to do the hierarchy.

If I was going to do what you want to do, I'd remove the ToggleButton from the TreeViewItem style (to hide it) and place it in the item template (item template is != item style). You'll notice the trigger for HasItems sets the visibility to HIDDEN if it doesn't have items vs. COLLAPSED so the tree doesn't get misaligned.

From the ItemTemplate you'd use the same bindings pretty much. Except the DataTemplate would be something like

<DataTemplate>
<Grid>
<Button ... HorizontalAlignment="Left" VerticalAlignment="Top" />
<ToggleButton ... HorizontalAlignment="Left" VerticalAlignment="Top" />
</Grid>
</DataTemplate>

Just an FYI, this will give you what you want visually, but not from a usability stand point (maybe). You won't be able to click on the button in the upper left corner where the +/- is.
GeneralRe: Overlay Tree view expander icon on the content Pin
SledgeHammer019-Apr-14 4:02
SledgeHammer019-Apr-14 4:02 
GeneralRe: Overlay Tree view expander icon on the content Pin
SledgeHammer019-Apr-14 4:04
SledgeHammer019-Apr-14 4:04 
QuestionSetting BitmapImage.UriSource in a XAML file read with XamlReader [VB][WPF] Pin
Jayme655-Apr-14 22:08
Jayme655-Apr-14 22:08 
QuestionHow can we integrate HTML Help files with Table Of Contents into an WPF application developing (C#.NET.) Pin
Adarsh Balachandran4-Apr-14 23:15
Adarsh Balachandran4-Apr-14 23:15 
AnswerRe: How can we integrate HTML Help files with Table Of Contents into an WPF application developing (C#.NET.) Pin
Gerry Schmitz7-Apr-14 12:04
mveGerry Schmitz7-Apr-14 12:04 
AnswerRe: DataTemplate selection using a property Pure XAML Pin
SledgeHammer013-Apr-14 13:13
SledgeHammer013-Apr-14 13:13 
QuestionUser Control Confusion Pin
Kevin Marois3-Apr-14 8:25
professionalKevin Marois3-Apr-14 8:25 
AnswerRe: User Control Confusion Pin
Richard Deeming3-Apr-14 10:23
mveRichard Deeming3-Apr-14 10:23 
GeneralRe: User Control Confusion Pin
Kevin Marois3-Apr-14 11:14
professionalKevin Marois3-Apr-14 11:14 
QuestionWPF Ribbon Control Pin
Sujit Keng2-Apr-14 21:51
Sujit Keng2-Apr-14 21:51 
AnswerRe: WPF Ribbon Control Pin
Naz_Firdouse8-Apr-14 3:07
Naz_Firdouse8-Apr-14 3:07 
QuestionToolTip is not fully visible Pin
SRKSHOME2-Apr-14 0:42
SRKSHOME2-Apr-14 0:42 
QuestionBind Grid Row's IsExpanded To Row's Data Object Pin
Kevin Marois31-Mar-14 12:41
professionalKevin Marois31-Mar-14 12:41 
QuestionUser Control Question Pin
Kevin Marois25-Mar-14 8:05
professionalKevin Marois25-Mar-14 8:05 
AnswerRe: User Control Question Pin
_Maxxx_2-Apr-14 18:39
professional_Maxxx_2-Apr-14 18:39 
GeneralRe: User Control Question Pin
Kevin Marois2-Apr-14 18:49
professionalKevin Marois2-Apr-14 18:49 
GeneralRe: User Control Question Pin
_Maxxx_2-Apr-14 19:36
professional_Maxxx_2-Apr-14 19:36 

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.