WEB开发网
开发学院图形图像Flash Silverlight 3 Beta 新特性解析(6) - Navigation和... 阅读

Silverlight 3 Beta 新特性解析(6) - Navigation和Deep Linking篇

 2009-03-31 11:58:58 来源:WEB开发网   
核心提示: 而在SL3Beta.Nav项目下创建的Views目录用来存放页面控件MainPage.xaml是普通的用户控件,其代码如下<UserControlx:Class="SL3Beta.Nav.MainPage"xmlns="http://schemas.mi

而在SL3Beta.Nav项目下创建的Views目录用来存放页面控件

MainPage.xaml是普通的用户控件,其代码如下

<UserControl x:Class="SL3Beta.Nav.MainPage"

  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 

  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

  xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation">

  <Grid x:Name="LayoutRoot" Background="#606060">

    <navigation:Frame x:Name="NavFrame" Source="/Views/EmployeePage.xaml">

    </navigation:Frame>

  </Grid>

</UserControl>

在初始的状态下加载/Views/EmployeePage.xaml页面来显示雇员信息如下:

<navigation:Page x:Class="SL3Beta.Nav.Views.EmployeePage" 

      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 

      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 

      xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"

      xmlns:web="clr-namespace:SL3Beta.Nav.Web"

      xmlns:riaData="clr-namespace:System.Windows.Data;assembly=System.Windows.Ria.Controls"

      xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm"

      xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"

      xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Ria.Controls"

      Title="Employee Page">

  <Grid x:Name="LayoutRoot">

    <StackPanel Width="900" Margin="10">

      <riaControls:DomainDataSource x:Name="EmployeeDataSource" LoadSize="10" LoadMethodName="LoadEmployee">

        <riaControls:DomainDataSource.DomainContext>

          <web:PersonDomainContext/>

        </riaControls:DomainDataSource.DomainContext>

        <riaControls:DomainDataSource.SortDescriptors>

          <riaData:SortDescriptor Direction="Ascending" PropertyPath="EmployeeID"/>

        </riaControls:DomainDataSource.SortDescriptors>

      </riaControls:DomainDataSource>

 

      <data:DataGrid x:Name="EmployeeGrid" ItemsSource="{Binding Data,ElementName=EmployeeDataSource}" MinHeight="100" SelectionChanged="EmployeeGrid_SelectionChanged"></data:DataGrid>

 

      <dataControls:DataPager PageSize="10" Source="{Binding Data,ElementName=EmployeeDataSource}"></dataControls:DataPager>



      <Button Content="查看联系信息" x:Name="ViewContactButton" HorizontalAlignment="Right" Margin="20,5" Click="ViewContactButton_Click" IsEnabled="False"/>

    </StackPanel>

  </Grid>

</navigation:Page>

上一页  1 2 3 4 5 6 7 8 9  下一页

Tags:Silverlight 特性

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接