Click here to Skip to main content
13,200,593 members (54,809 online)

Silverlight / WPF

 
QuestionBlurry Borderline In FlowDocument Pin
FocusedWolf6-Nov-12 10:46
memberFocusedWolf6-Nov-12 10:46 
AnswerRe: Blurry Borderline In FlowDocument Pin
Gerry Schmitz7-Nov-12 13:13
memberGerry Schmitz7-Nov-12 13:13 
AnswerRe: Blurry Borderline In FlowDocument Pin
FocusedWolf7-Nov-12 16:00
memberFocusedWolf7-Nov-12 16:00 
QuestionBinding in a WPF TreeViewItem Pin
John Simmons / outlaw programmer6-Nov-12 8:16
mvpJohn Simmons / outlaw programmer6-Nov-12 8:16 
I want my treeview items to change their appearance based on other properties within the object being represented by the treeview item. I've done the following within the treeview zaml:

<TreeView.Resources>
    <Style TargetType="{x:Type TreeViewItem}">
        <Setter Property="Foreground" Value="{Binding Path=IsValid, Converter={StaticResource StatusInvalidConverter}}" />
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid>
                        <Border Grid.Column="0" x:Name="PART_ItemBorder" ... >
                            <StackPanel Orientation="Horizontal">
                                <Label Content="{Binding}"  />
 
                                /// my custom stuff is here
                                <Label Content="(NOT USED)" 
                                       Visibility="{Binding Path=IsReferenced, Converter={StaticResource MyConverter}}" 
                                       Foreground="Red" />
                        
                            </StackPanel>
                        </Border>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</TreeView.Resources>


I'm getting the following notification in the output window when I run the app in debug mode:

System.Windows.Data Error: 40 : BindingExpression path error: 'IsReferenced' property not found on 'object' ''String' (HashCode=1540110492)'. BindingExpression:Path=IsReferenced; DataItem='String' (HashCode=1540110492); target element is 'Label' (Name=''); target property is 'Visibility' (type 'Visibility')<br />

".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997


AnswerRe: Binding in a WPF TreeViewItem Pin
Pete O'Hanlon6-Nov-12 8:29
protectorPete O'Hanlon6-Nov-12 8:29 
GeneralRe: Binding in a WPF TreeViewItem Pin
John Simmons / outlaw programmer6-Nov-12 8:54
mvpJohn Simmons / outlaw programmer6-Nov-12 8:54 
GeneralRe: Binding in a WPF TreeViewItem Pin
Pete O'Hanlon6-Nov-12 9:00
protectorPete O'Hanlon6-Nov-12 9:00 
GeneralRe: Binding in a WPF TreeViewItem Pin
John Simmons / outlaw programmer6-Nov-12 9:22
mvpJohn Simmons / outlaw programmer6-Nov-12 9:22 
GeneralRe: Binding in a WPF TreeViewItem Pin
Pete O'Hanlon6-Nov-12 9:29
protectorPete O'Hanlon6-Nov-12 9:29 
GeneralRe: Binding in a WPF TreeViewItem Pin
John Simmons / outlaw programmer6-Nov-12 9:37
mvpJohn Simmons / outlaw programmer6-Nov-12 9:37 

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.


Advertise | Privacy |
Web02 | 2.8.171020.1 | Last Updated 23 Oct 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid