falcon eyes 0 Newbie Poster

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 with the red color but it not work,so is any body have a any suggestions or knows why my code doesn't work
Reply With Quote

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.