WPF Tree View Question

Page 1 of 1

1 Replies - 1450 Views - Last Post: 22 January 2011 - 11:14 AM Rate Topic: -----

#1 falcon eyes  Icon User is offline

  • D.I.C Head

Reputation: -4
  • View blog
  • Posts: 53
  • Joined: 16-April 07

WPF Tree View Question

Posted 20 January 2011 - 02:45 PM

Hi Every Body
I made C# WPF book reading organizer application, it include a Book class that store every thing about a certain book also a tree view control,i have added the Book instances to the tree view control,and i have also created data template for the Book objects as below
 <window.Resources>
        <DataTemplate DataType="{x:Type bookNS:Book}">
            <StackPanel Orientation="Horizontal" Background="White" >
                <Image Source="images\sBook.png" Margin="4"></Image>
                <Label VerticalAlignment="Center" Background="Wheat" Content="{Binding Path=BookName}" Margin="4" 
                           FontFamily="Times New Roman" FontWeight="UltraBold" Foreground="Black" FontStyle="Italic" >
                    <Label.Style>
                        <Style>
                            <Style.Triggers>
                                <Trigger Property="TreeViewItem.IsFocused" Value="true">
                                   <Setter Property="Label.Background" Value="White"></Setter>
                               </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Label.Style>
                </Label>
            </StackPanel>
        </DataTemplate>
    </window.Resources>


every thing is going fine except one thing and it's
i want when i navigate through the tree view by arrows keys or when click on book item in the tree view to change the background of the label Text in the data template of the book object,i have write the code for style trigger but it not work,so is any body have a any suggestions or knows why my code doesn't work
Edit/Delete Message


Is This A Good Question/Topic? 0
  • +

Replies To: WPF Tree View Question

#2 falcon eyes  Icon User is offline

  • D.I.C Head

Reputation: -4
  • View blog
  • Posts: 53
  • Joined: 16-April 07

Re: WPF Tree View Question

Posted 22 January 2011 - 11:14 AM

am i ask hard question?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1