稳扎稳打Silverlight(34)

返回“稳扎稳打Silverlight 3.0系列文章索引”

稳扎稳打Silverlight(34) - 3.0控件之Frame,Page,Label,DescriptionViewer,ValidationSummary

介绍

Silverlight 3.0 控件一览:

Frame - 与 Page 控件结合使用,从而实现导航功能(可以由此实现 Deep Linking)

Page - 与 Frame 控件结合使用

Label - 比 TextBlock 功能多一些,可以用来对错误的验证信息做提示

DescriptionViewer - 鼠标经过时的提示信息

ValidationSummary - 汇总显示验证错误的信息 

在线DEMO

http://www.cnblogs.com/webabcd/archive/2009/08/04/1538238.html

示例

1、Frame 控件的使用演示。其可以导航 Page,可以做url映射

Frame.xaml

<navigation:Page x:Class="Silverlight30.Control.Frame"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignWidth="640" d:DesignHeight="480"
Title="Frame Page">
<Grid x:Name="LayoutRoot">

<StackPanel HorizontalAlignment="Left">
<Border BorderBrush="Gray" BorderThickness="3" Padding="10">

<!--
Frame - 与 Page 控件结合使用,从而实现导航功能(可以由此实现 Deep Linking)
Source - 需要在 Frame 中显示的 Page 的地址
JournalOwnership - 导航日志的记录方式 [System.Windows.Navigation.JournalOwnership 枚举]
Automatic - 如果 Frame 是最顶级的 Frame,则在浏览器端记录导航日志,否则由此 Frame 自行记录
OwnsJournal - 自行记录
UsesParentJournal - 当 Frame 是最顶级的 Frame 时,由浏览器记录。如果是非顶级 Frame 的话,则会抛出异常
UriMapper - Uri 映射器。可以在其内编辑映射规则
UriMapping - 具体的映射规则(在 System.Windows.Navigation 命名空间下)
如本例就是把类似 Silverlight30TestPage.aspx#/Control/PageDemo 的地址映射到类似 Silverlight30TestPage.aspx#/Control/PageDemo.xaml 的地址
-->           
<navigation:Frame x:Name="frame" Source="/Control/PageDemo" JournalOwnership="OwnsJournal">
<navigation:Frame.Content>
<TextBlock Text="我是 Frame 的 Content" />
</navigation:Frame.Content>
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping Uri="/{address}" MappedUri="/{address}.xaml"/>
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
</Border>
<Button x:Name="navigateToPageDemo" Content="链接到 PageDemo" Click="navigateToPageDemo_Click" Width="200" />
<Button x:Name="navigateToPageDemo2" Content="链接到 PageDemo2" Click="navigateToPageDemo2_Click" Width="200" />
</StackPanel>

</Grid>
</navigation:Page>

时间: 2024-08-17 18:47:00

稳扎稳打Silverlight(34)的相关文章

稳扎稳打Silverlight 3.0系列文章索引

相关文章:稳扎稳打Silverlight 2.0系列文章索引 在线DEMO http://www.cnblogs.com/webabcd/archive/2009/08/04/1538238.html 1.稳扎稳打Silverlight(33) - 3.0控件之AutoCompleteBox,DataPager 介绍 Silverlight 3.0 控件一览: AutoCompleteBox - 自动完成控件.当用户输入部分信息后,此控件可以基于指定的过滤算法在一个下拉框中陈列出匹配项 Data

稳扎稳打Silverlight(4)

稳扎稳打Silverlight(4) - 2.0控件之DataGrid,DatePicker,Grid,GridSplitter,HyperlinkButton,Image 在线DEMO http://www.cnblogs.com/webabcd/archive/2008/10/09/1307486.html 示例 1.DataGrid.xaml <UserControl xmlns:data="clr-namespace:System.Windows.Controls;assembly

稳扎稳打Silverlight(36)

返回"稳扎稳打Silverlight 3.0系列文章索引" 稳扎稳打Silverlight(36) - 3.0控件之TreeView,ListBox增强,DataGrid增强,MediaElement增强 介绍 Silverlight 3.0 控件一览: TreeView - 树控件 ListBox - 改进:支持多选 DataGrid - 改进:结合 PagedCollectionView 实现数据分组, 增加了一些编辑数据的相关事件, 结合 DataAnnotations 实现数据

稳扎稳打Silverlight(51)

稳扎稳打Silverlight(51) - 4.0绑定之数据验证IDataErrorInfo,INotifyDataErrorInfo 介绍 Silverlight 4.0 数据验证: * IDataErrorInfo - 对数据实体类提供自定义验证支持..NET Framework 也有此接口,可以方便移植 * INotifyDataErrorInfo - 对数据实体类提供自定义验证支持,比 IDataErrorInfo 功能更强大.INotifyDataErrorInfo 支持异步验证,这就

稳扎稳打Silverlight(47)

稳扎稳打Silverlight(47) - 4.0UI之操作剪切板,隐式样式,CompositeTransform,拖放外部文件到程序中 介绍 Silverlight 4.0 用户界面(UI)相关: * 操作剪切板 - 支持获取或设置剪切板中的文本信息 * 隐式样式(Implicit Style) - 将某种样式应用到某种类型的所有元素,即全局样式 * CompositeTransform - 将多种转换方式合而为一 * 拖动(Drag)外部文件,并将其放到(Drop) Silverlight

稳扎稳打Silverlight(46)

稳扎稳打Silverlight(46) - 4.0UI之FlowDirection,TextTrimming,响应鼠标滚轮事件,响应鼠标右键事件,全屏的新特性 介绍 Silverlight 4.0 用户界面(UI)相关: * FlowDirection - 指定文本或界面元素在它们的父元素中的流动方向 * TextTrimming - 文字溢出时的显示方式 * 响应鼠标的滚轮事件 * 响应鼠标的右键事件 * 全屏的新特性 - 当其他程序获得焦点时,是否退出全屏模式 在线DEMO http://w

稳扎稳打Silverlight(45)

稳扎稳打Silverlight(45) - 4.0浏览器外运行(Out Of Browser)之被信任的应用程序(Trusted Application) 介绍 Silverlight 4.0 OOB 之 被信任的应用程序: * 概述 * 访问本地文件系统 * 调用 COM 接口 * 自定义窗口样式和行为 在线DEMO http://www.cnblogs.com/webabcd/archive/2010/08/09/1795417.html 示例 1.关于"被信任的应用程序"的简要概

稳扎稳打Silverlight(44)

稳扎稳打Silverlight(44) - 4.0浏览器外运行(Out Of Browser)之OOB的增强及其新增的NotificationWindow 介绍 Silverlight 4.0 OOB 模式的新特性: * 新增了 Closing 事件 * 实现程序在 OOB 模式下的自动更新 * NotificationWindow - 在 OOB 模式下显示通知窗口,也就是 toast * 实现自定义的 NotificationWindow 在线DEMO http://www.cnblogs.

稳扎稳打Silverlight(41)

返回"稳扎稳打Silverlight 3.0系列文章索引" 稳扎稳打Silverlight(41) - 3.0Tip/Trick之GPU加速,Out-Of-Browser,应用程序库缓存,合并ResourceDictionary,应用程序扩展服务,Silverlight插件对象 介绍 Silverlight 3.0 提示和技巧系列 GPU 加速 - 对 GPU 加速的支持 Out-Of-Browser -浏览器外运行,即支持脱离浏览器运行 应用程序库缓存 - 将 dll(zip) 缓存