Silverlight常用小知识总结(不断更新中)
2010-08-11 16:49
344 查看
(一)、全屏显示
1、首先添加引用 using System.Windows.Interop;
2、一句话解决 Application.Current.Host.Content.IsFullScreen = ! Application.Current.Host.Content.IsFullScreen ;
(二)、一个用于页面跳转的小方法
public void RedirectTo()
{
// 此变量用来保存所要跳转载入的 XAML 页面
string pageName = "MainPage.xaml"; //如在Login.xaml页面中跳转到MainPage.xaml页面
// 此变量用来保存所要载入的 XAML 页面的完整类别名称(亦即 命名空间.类别名称)
string typeName = "";
// 取得 XAML 界面的主文件名。
pageName = pageName.Substring(0, pageName.IndexOf("."));
// 构建出 XAML 界面的完整类别名称。
typeName = string.Format(CultureInfo.InvariantCulture, "eShop.{0}", pageName);
Type type = typeof(MainPage).Assembly.GetType(typeName, false);//MainPage是该页面的类名
// 建立 XAML 页面的执行个体。
UIElement newElement = Activator.CreateInstance(type) as UIElement;
this.LayoutRoot.Children.Clear();
this.LayoutRoot.Children.Add(newElement);
}
(三)、页面跳转
HtmlPage.Window.Eval("window.navigate('Default.aspx?index=1');");
1、首先添加引用 using System.Windows.Interop;
2、一句话解决 Application.Current.Host.Content.IsFullScreen = ! Application.Current.Host.Content.IsFullScreen ;
(二)、一个用于页面跳转的小方法
public void RedirectTo()
{
// 此变量用来保存所要跳转载入的 XAML 页面
string pageName = "MainPage.xaml"; //如在Login.xaml页面中跳转到MainPage.xaml页面
// 此变量用来保存所要载入的 XAML 页面的完整类别名称(亦即 命名空间.类别名称)
string typeName = "";
// 取得 XAML 界面的主文件名。
pageName = pageName.Substring(0, pageName.IndexOf("."));
// 构建出 XAML 界面的完整类别名称。
typeName = string.Format(CultureInfo.InvariantCulture, "eShop.{0}", pageName);
Type type = typeof(MainPage).Assembly.GetType(typeName, false);//MainPage是该页面的类名
// 建立 XAML 页面的执行个体。
UIElement newElement = Activator.CreateInstance(type) as UIElement;
this.LayoutRoot.Children.Clear();
this.LayoutRoot.Children.Add(newElement);
}
(三)、页面跳转
HtmlPage.Window.Eval("window.navigate('Default.aspx?index=1');");
相关文章推荐
- 极化SAR一些常用知识总结(不断更新中)
- 编程常用词汇总结(不断更新)
- 积累一些不太常用的C/C++语言知识(不断更新)
- 2013Word工具常用知识集锦(不断更新)
- 常用到的Linux命令总结---不断更新
- 常用数据库sql总结(不断总结更新中)
- MATLAB 常用问题总结(不断更新中)
- 常用的css3新特性总结(工作中不断更新中)
- startUML工具常用知识集锦(不断更新)
- Silverlight中常用知识总结
- 学习总结知识链接(不断更新中...)
- SQL常用小总结【不断更新】
- SVN的知识总结(持续不断更新)
- UI 常用方法总结之--- UIWindow UIView (不断更新中)
- Android一些常用知识和代码(不断更新)
- 2013Excel工具常用知识集锦(不断更新)
- 平时常用工具汇总--不断更新总结
- ios开发总结:Utils常用方法等收集,添加扩展类,工具类方法,拥有很多方便快捷功能(不断更新中。。。)
- UI 常用方法总结之--- UILabel UITextField (不断更新中)
- [原创总结 不断更新]Linux 下常用命令操作总结