Click here to Skip to main content
15,843,149 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Conditional DataBinding to UI Elements Pin
SledgeHammer015-Feb-12 13:26
SledgeHammer015-Feb-12 13:26 
GeneralRe: Conditional DataBinding to UI Elements Pin
Mycroft Holmes5-Feb-12 14:15
professionalMycroft Holmes5-Feb-12 14:15 
GeneralRe: Conditional DataBinding to UI Elements Pin
SledgeHammer015-Feb-12 15:14
SledgeHammer015-Feb-12 15:14 
GeneralRe: Conditional DataBinding to UI Elements Pin
Mycroft Holmes5-Feb-12 16:15
professionalMycroft Holmes5-Feb-12 16:15 
AnswerRe: Conditional DataBinding to UI Elements Pin
Mycroft Holmes5-Feb-12 16:16
professionalMycroft Holmes5-Feb-12 16:16 
GeneralRe: Conditional DataBinding to UI Elements Pin
Andy_L_J5-Feb-12 16:43
Andy_L_J5-Feb-12 16:43 
QuestionOwn TreeViewItem with image and text Pin
Mc_Topaz2-Feb-12 23:20
Mc_Topaz2-Feb-12 23:20 
AnswerRe: Own TreeViewItem with image and text Pin
Mc_Topaz3-Feb-12 1:52
Mc_Topaz3-Feb-12 1:52 
Solved the problem with this adjustment:

Node class:
C#
public abstract class Node
{
    ObservableCollection<Node> nodes = new ObservableCollection<Node>();
    BitmapImage image;
    string header;

    public Node(string header, BitmapImage image)
    {
        this.header = header;
        this.image = image;
    }

    public string Header
    {
        get { return header; }
    }

    public BitmapImage Image
    {
        get { return image; }
    }

    public ObservableCollection<Node> Nodes
    {
        get { return nodes; }
    }
}


MainWindow XAML TreeView:
XML
<TreeView Name="tvTree">
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Nodes}" DataType="{x:Type local:Node}">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Height="16" Source="{Binding Image}" />
                        <Separator Width="10" Visibility="Hidden" />
                        <TextBlock Text="{Binding Header}" />
                    </StackPanel>
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>


Of course is that the easiest solution *face palm*
GeneralGridSplitter Conundrum Pin
Gil Yoder1-Feb-12 16:31
Gil Yoder1-Feb-12 16:31 
QuestionRe: GridSplitter Conundrum Pin
Gil Yoder2-Feb-12 10:44
Gil Yoder2-Feb-12 10:44 
AnswerRe: GridSplitter Conundrum Pin
SledgeHammer012-Feb-12 12:40
SledgeHammer012-Feb-12 12:40 
GeneralRe: GridSplitter Conundrum Pin
Gil Yoder2-Feb-12 15:09
Gil Yoder2-Feb-12 15:09 
GeneralRe: GridSplitter Conundrum Pin
SledgeHammer012-Feb-12 15:37
SledgeHammer012-Feb-12 15:37 
GeneralRe: GridSplitter Conundrum Pin
Gil Yoder2-Feb-12 16:43
Gil Yoder2-Feb-12 16:43 
SuggestionRe: GridSplitter Conundrum Pin
Gil Yoder2-Feb-12 19:59
Gil Yoder2-Feb-12 19:59 
GeneralRe: GridSplitter Conundrum Pin
SledgeHammer013-Feb-12 8:17
SledgeHammer013-Feb-12 8:17 
Questionadding/removing ListView columns at runtime (revisited) Pin
Vincent Beek1-Feb-12 1:20
Vincent Beek1-Feb-12 1:20 
AnswerRe: adding/removing ListView columns at runtime (revisited) Pin
Abhinav S1-Feb-12 1:36
Abhinav S1-Feb-12 1:36 
GeneralRe: adding/removing ListView columns at runtime (revisited) Pin
Mycroft Holmes1-Feb-12 12:53
professionalMycroft Holmes1-Feb-12 12:53 
QuestionBinding list of items to IntemsControl in WPF Pin
rams231-Jan-12 0:14
rams231-Jan-12 0:14 
AnswerRe: Binding list of items to IntemsControl in WPF Pin
Wayne Gaylard31-Jan-12 1:10
professionalWayne Gaylard31-Jan-12 1:10 
GeneralRe: Binding list of items to IntemsControl in WPF Pin
rams231-Jan-12 1:36
rams231-Jan-12 1:36 
GeneralRe: Binding list of items to IntemsControl in WPF Pin
Wayne Gaylard31-Jan-12 1:39
professionalWayne Gaylard31-Jan-12 1:39 
GeneralRe: Binding list of items to IntemsControl in WPF Pin
Abhinav S1-Feb-12 17:26
Abhinav S1-Feb-12 17:26 
GeneralRe: Binding list of items to IntemsControl in WPF Pin
Wayne Gaylard1-Feb-12 20:06
professionalWayne Gaylard1-Feb-12 20:06 

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.