1

Still learning visual studio and it's elements :-)

My question is as follows...

How do i extract "for example" the [clientname] out of session object using a xaml resource designer?

The session it's self is "CurrentSession" realistically i would like this to be dynamic so that i could use my listview template on any listview. I have been following the courses Here and this has helped me immensely but i cannot seem to work out how to do this from a session object, any help would be greatly appreciated :-)

a part of my xaml designer for a listview....

<DataTemplate x:Key="templateListBoxItem">
    <Grid Margin="5">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Border Grid.Column="0" 
                Grid.Row="0" 
                Grid.RowSpan="2" 
                Margin="0,0,10,0">
            <Image Source="{DynamicResource IMS}" 
                   Stretch="Fill" 
                   Height="20" 
                   Width="20"/>
        </Border>
        <ItemsControl ItemsSource="{Binding CurrentSession[clientName]}">
            <TextBlock Text="{Binding clientName}" 
                       Grid.Row="0" 
                       Grid.Column="1" 
                       FontWeight="Bold"/>
        </ItemsControl>
    </Grid>
</DataTemplate>
Mark
  • 85
  • 9
  • I mannaged to find another post [Here][1] by using the ResourceBinding class that he kindly shared...so if anyone else has this same problem please follow the link provided, becuse this solved my problem.... Many thanks to Gor Rustamyan [1]: https://stackoverflow.com/questions/20564862/binding-to-resource-key-wpf/20566945#20566945 P.S i cannot answer my own post so please let this be an answer because it helped me alot! – Mark Aug 02 '17 at 15:10

0 Answers0