Last active
June 7, 2017 18:15
-
-
Save cathode/2548d1963e326c7aa41e0a939f730cd1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TreeView x:Name="questionTree" FontSize="18" | |
HorizontalAlignment="Left" Width="280" Margin="10,48,0,35" ItemsSource="{Binding RootGroups}" SelectedItemChanged="questionTree_SelectedItemChanged" > | |
<TreeView.Resources> | |
<HierarchicalDataTemplate DataType="{x:Type qa:QAQuestionGroup}" ItemsSource="{Binding SubGroups}"> | |
<TextBlock Text="{Binding}" /> | |
<HierarchicalDataTemplate.ItemTemplate> | |
<HierarchicalDataTemplate DataType="{x:Type qa:QAQuestion}" ItemsSource="{Binding Questions}"> | |
<HierarchicalDataTemplate.ItemTemplate> | |
<DataTemplate> | |
<TextBlock Text="{Binding QuestionName}" /> | |
</DataTemplate> | |
</HierarchicalDataTemplate.ItemTemplate> | |
</HierarchicalDataTemplate> | |
</HierarchicalDataTemplate.ItemTemplate> | |
</HierarchicalDataTemplate> | |
</TreeView.Resources> | |
</TreeView> | |
public class QAQuestionGroup | |
{ | |
public string GroupName {get;set;} | |
public virtual ICollection<QAQuestion> Questions {get;set;} | |
public virtual ICollection<QAQuestionGroup> SubGroups {get;set;} | |
} | |
public class QAQuestion | |
{ | |
public string QuestionName {get;set;} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment