Note that there are some explanatory texts on larger screens.

plurals
  1. POView Model Image Property?
    primarykey
    data
    text
    <p>I have a list of view models which I am binding to a TreeView, however these view models are representing a 'file system' like data structure with 'files' and 'folders'. So in the item template on my view for the tree view I have an image which should represent either a folder or a file.</p> <p>Here is My XAML:</p> <pre><code>&lt;StackPanel Orientation="Horizontal"&gt; &lt;!-- Folder Icon --&gt; &lt;Image Width="15" Height="15" Stretch="Fill" Source="\Resources\Folder.png"&gt;&lt;/Image&gt; &lt;Grid&gt; &lt;!-- Folder Name --&gt; &lt;Label Content="{Binding Path=FolderName}"&gt; &lt;!-- Force Selection on Right Click --&gt; &lt;ACB:CommandBehaviourCollection.Behaviours&gt; &lt;ACB:BehaviourBinding Event="PreviewMouseRightButtonDown" Command="{Binding Path=MainModel.SelectTreeViewItem}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type TreeViewItem}}}"&gt;&lt;/ACB:BehaviourBinding&gt; &lt;/ACB:CommandBehaviourCollection.Behaviours&gt; &lt;/Label&gt; &lt;!-- Folder Name Editor --&gt; &lt;StackPanel Name="FolderEditor" Orientation="Horizontal" Visibility="Collapsed"&gt; &lt;TextBox Text="{Binding Path=FolderName}" Width="130"&gt;&lt;/TextBox&gt; &lt;Button Content="Ok" Command="{Binding Path=RenameFolder}" CommandParameter="{Binding ElementName=FolderEditor}"&gt;&lt;/Button&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; &lt;/StackPanel&gt; </code></pre> <p>So basically I want to know how to bind the source of the image object to my view models.</p> <p>Thanks, Alex.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload