我试图创建一个多用户控制的MVVM模式的silverlight应用程序。下面是我的第一个页面用户控件示例
<Grid x:Name="LayoutRoot" Background="GhostWhite" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Width="90">
<toolkit:HeaderedContentControl HorizontalAlignment="Left"
Content="{Binding Path=Commands}"
ContentTemplate="{StaticResource CommandsTemplate}"
Header="Control Panel"
/>
</Border>
<Border Grid.Column="1">
<ContentControl ContentTemplate="{StaticResource WorkspacesTemplate}" />
</Border>
</Grid>我在第0列(链接列表)上的绑定工作正常。现在,我想将每个命令的视图绑定到网格的第1列,在该列中我使用了ContentControl。DataTemplate中不支持DataType。上面我使用了ContentControl的代码也不能与IValueConverter Convert()一起工作。如何根据Silverlight Web应用程序中的选择绑定多个用户控件。
谢谢,Shankar
发布于 2010-10-01 19:51:18
在我看来,您应该考虑在右侧窗格中使用navigation:Frame而不是ContentControl。
在你的问题中,关于你的应用程序的信息如此之少,很难提供细节。
https://stackoverflow.com/questions/3838634
复制相似问题