Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. WPF TreeView Style

WPF TreeView Style

Scheduled Pinned Locked Moved WPF
csharpdatabasewpf
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    Ok, I finally got my treeview with hyperlinks working. Thanks SledgeHammer! I now have the following

    <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="TextBlock.TextDecorations" Value="Underline"/>
                    <Setter Property="Foreground" Value="RoyalBlue" />
                </Trigger>
                <Trigger Property="IsMouseOver" Value="False">
                    <Setter Property="TextBlock.TextDecorations" Value="{x:Null}"/>
                    <Setter Property="Foreground" Value="RoyalBlue" />
                </Trigger>
            </Style.Triggers>
        
    
        
            
    
                
                    
                    
    
                        
                            
                        
    
                    
    
                
    
            
    
        
    
    
    
    
    
        
    
            
    
            
                
                    <Setter </x-turndown>
    
    C 1 Reply Last reply
    0
    • K Kevin Marois

      Ok, I finally got my treeview with hyperlinks working. Thanks SledgeHammer! I now have the following

      <Style.Triggers>
                  <Trigger Property="IsMouseOver" Value="True">
                      <Setter Property="TextBlock.TextDecorations" Value="Underline"/>
                      <Setter Property="Foreground" Value="RoyalBlue" />
                  </Trigger>
                  <Trigger Property="IsMouseOver" Value="False">
                      <Setter Property="TextBlock.TextDecorations" Value="{x:Null}"/>
                      <Setter Property="Foreground" Value="RoyalBlue" />
                  </Trigger>
              </Style.Triggers>
          
      
          
              
      
                  
                      
                      
      
                          
                              
                          
      
                      
      
                  
      
              
      
          
      
      
      
      
      
          
      
              
      
              
                  
                      <Setter </x-turndown>
      
      C Offline
      C Offline
      Cracked Down
      wrote on last edited by
      #2

      you can do this using the following steps.

      .
      .
      .
      <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />

      .
      .
      .

      and in the treeview

      and in the datatemplate add a key

      I would like note one thing about managing resources. All the related resources should be added in the resource dictionary. In your case I would like to suggest that, have separate resource dictionary e.g. "NavigationTreeResources.xaml" for TreeView and add your DataTemplates and style in it. Adding the resources in Windows makes the windows.xaml huge as well as restrict the scope of the resources to current :) window. Hope this information helps to solve your problem

      Happy Coding :-D:-D

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups