Xaml 如何从会话对象中提取项?

Xaml 如何从会话对象中提取项?,xaml,session,object,Xaml,Session,Object,仍在学习visual studio及其元素:-) 我的问题如下 如何使用xaml资源设计器“例如”提取[clientname]会话外对象 会话本身就是“CurrentSession”,实际上我希望它是动态的,这样我就可以在任何listview上使用我的listview模板。我一直在学习这些课程,这对我有很大的帮助,但我似乎无法从会话对象中找出如何做到这一点,任何帮助都将不胜感激:-) 用于listview的xaml设计器的一部分 <DataTemplate x:Key="templateL

仍在学习visual studio及其元素:-)

我的问题如下

如何使用xaml资源设计器“例如”提取[clientname]会话外对象

会话本身就是“CurrentSession”,实际上我希望它是动态的,这样我就可以在任何listview上使用我的listview模板。我一直在学习这些课程,这对我有很大的帮助,但我似乎无法从会话对象中找出如何做到这一点,任何帮助都将不胜感激:-)

用于listview的xaml设计器的一部分

<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>


我打算使用他善意分享的ResourceBinding类在[Here][1]找到另一篇文章……因此,如果其他人有同样的问题,请按照提供的链接进行操作,因为这解决了我的问题。。。。非常感谢Gor Rustayan[1]:P.S.我无法回答我自己的帖子,所以请将此作为答案,因为它对我帮助很大!我想通过使用ResourceBinding类找到另一篇文章[Here][1],他很乐意地分享了这个类……因此,如果其他人也有同样的问题,请按照提供的链接进行操作,因为这解决了我的问题。。。。非常感谢Gor Rustayan[1]:P.S.我无法回答我自己的帖子,所以请将此作为答案,因为它对我帮助很大!