Click here to Skip to main content
15,917,808 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 2:26
mvePete O'Hanlon29-May-12 2:26 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 2:35
Adam_Dev29-May-12 2:35 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 2:49
mvePete O'Hanlon29-May-12 2:49 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 2:51
Adam_Dev29-May-12 2:51 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 3:10
mvePete O'Hanlon29-May-12 3:10 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 3:21
Adam_Dev29-May-12 3:21 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 3:30
mvePete O'Hanlon29-May-12 3:30 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 3:46
Adam_Dev29-May-12 3:46 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 4:00
mvePete O'Hanlon29-May-12 4:00 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 4:22
Adam_Dev29-May-12 4:22 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 22:03
mvePete O'Hanlon29-May-12 22:03 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 22:10
Adam_Dev29-May-12 22:10 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 22:43
mvePete O'Hanlon29-May-12 22:43 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev30-May-12 0:51
Adam_Dev30-May-12 0:51 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon30-May-12 1:17
mvePete O'Hanlon30-May-12 1:17 
Questionthe wpf added winform controls Pin
dengzn28-May-12 22:43
dengzn28-May-12 22:43 
AnswerRe: the wpf added winform controls Pin
Pete O'Hanlon28-May-12 23:01
mvePete O'Hanlon28-May-12 23:01 
AnswerRe: the wpf added winform controls Pin
Cracked-Down29-May-12 0:36
Cracked-Down29-May-12 0:36 
QuestionDirectshow in silverlight Pin
ebrahim rajabloo28-May-12 3:16
ebrahim rajabloo28-May-12 3:16 
AnswerRe: Directshow in silverlight Pin
Abhinav S28-May-12 4:23
Abhinav S28-May-12 4:23 
GeneralRe: Directshow in silverlight Pin
ebrahim rajabloo28-May-12 17:41
ebrahim rajabloo28-May-12 17:41 
GeneralRe: Directshow in silverlight Pin
Pete O'Hanlon28-May-12 20:18
mvePete O'Hanlon28-May-12 20:18 
QuestionOperation could destabilize the runtime!!! Pin
ebrahim rajabloo26-May-12 22:19
ebrahim rajabloo26-May-12 22:19 
QuestionWPF HierarchicalDataTemplate Questions: Pin
Kevin Marois24-May-12 14:21
professionalKevin Marois24-May-12 14:21 
I have 2 questions...

I created a HierarchicalDataTemplate which is bound to a NodeModel

[Serializable]
public class NodeModel : ViewModelBase
{
    public Guid Id { get; set; }
    public string Caption { get; set; }
    public string Description { get; set; }
    public bool IsActive { get; set; }
    public ImageSource Image { get; set; }
    public bool IsExpanded { get; set; }
    public string FileName { get; set; }
    public NodeType Type { get; set; }
    public List<NodeModel> Children { get; set; }
}


the template:

<HierarchicalDataTemplate DataType="{x:Type models:NodeModel}"
                            ItemsSource="{Binding Path=Children}">
    <StackPanel Orientation="Horizontal"
                Margin="2">
            
        <Image Source="{Binding Image}"
                Height="16"
                Width="16"
                Margin="0,0,2,0" />

        <TextBlock Margin="0,0,5,0">
                <Hyperlink NavigateUri="{Binding Caption}"
                            Foreground="#0C2DAA"
                            Command="{Binding Path=DataContext.SelectedLinkCommand, 
                                    RelativeSource={RelativeSource FindAncestor, 
                                    AncestorType={ x:Type views:ProjectListView}}}">

                    <InlineUIContainer>
                        <TextBlock Text="{Binding Caption}" />
                    </InlineUIContainer>

                    <Hyperlink.Style>     
                        <Style TargetType="Hyperlink">       
                            <Style.Triggers>         
                                <Trigger Property="IsMouseOver"
                                            Value="False">
                                    <Setter Property="TextDecorations"
                                            Value="{x:Null}" />         
                                </Trigger>       
                            </Style.Triggers>     
                        </Style>   
                    </Hyperlink.Style> 

                </Hyperlink>
                
                <TextBlock.ToolTip>
                    <ToolTip>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <TextBlock FontWeight="Bold"
                                        Text="{Binding Path=Caption}"
                                        Grid.Row="0"
                                        Margin="0,0,0,3" />
                            <TextBlock FontStyle="Italic"
                                        Grid.Row="1"
                                        Text="{Binding Path=FileName}"
                                        Visibility="{Binding FileName, 
                                                    Converter={StaticResource StringToVisConverter}}" />
                            <TextBlock Text="{Binding Path=Description}"
                                        Grid.Row="2"
                                        Visibility="{Binding Description, 
                                                    Converter={StaticResource StringToVisConverter}}" />
                        </Grid>
                    </ToolTip>
                </TextBlock.ToolTip>
            </TextBlock>

    </StackPanel>

</HierarchicalDataTemplate>


Finally, the treeview this is used in:

<telerik:RadTreeView x:Name="tvwTreeData"
                     ItemsSource="{Binding Path=Folders}"
                     ItemContainerStyle="{StaticResource ItemContainerStyle}"
                     SelectedItem="{Binding Path=SelectedTreeItem, Mode=TwoWay}" />


Problem 1) When I click a hyperlink, the correct tree node is not always selected. In other words, to make it work right I have to click the node, then the hyperlink on that node. How can I adjust this so that clicking a link selects its node?

Problem 2) How can I adjust this template so that nodes of Type.Folder don't show the hyperlink?

Thanks
If it's not broken, fix it until it is

AnswerRe: WPF HierarchicalDataTemplate Questions: Pin
Cracked-Down25-May-12 2:18
Cracked-Down25-May-12 2:18 

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.