简体   繁体   中英

Silverlight Web App MVVM

I am trying to create a multiple user control silverlight application with MVVM pattern. Here is sample of my first page User control

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

My bindings on the Column 0 (list of links) is working fine. Now I would like to bind the views for each of the command to the Column 1 of the grid where I am using the ContentControl. There is no support for DataType in the DataTemplate. The above code where I have used a ContentControl is also not working with IValueConverter Convert(). How do I bind multiple user controls based on selection in the Silverlight Web application.

Thanks, Shankar

Sounds to me you should be looking at using a navigation:Frame in the right hand pane instead of a ContentControl .

Details are a little hard to provide with so little info about your application in your question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM