文章分类 -  Silverlight

摘要:"%PROGRAMFILES%\Microsoft Silverlight\sllauncher.exe" /install:"D:\项目\ZJNET5_S\Home\Bin\Debug\HuaweiSoftware.ZJNET.xap" /origin:"http://huaweisoft.com/ZJNET5.xap" /shortcut:Desktop+startmenu 阅读全文
posted @ 2013-07-05 09:30 lanmiao 阅读(206) 评论(0) 推荐(0) 编辑
摘要:<UserControl x:Class="Hongcing.Silverlight.Font.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <StackPanel> <!--不能直接使用“宋体”、“黑体”等中文字体名称,否则无效。--> <TextBox Text=" 阅读全文
posted @ 2012-06-16 22:53 lanmiao 阅读(198) 评论(0) 推荐(0) 编辑
摘要:在WPF的ScrollViewer控件中有ScrollChanged事件,到了Silverlight就没有此事件了。经常会有需要使用此事件去驱动一些功能的实现,例如延迟加载。网上也流传了一种使用监听VSM(Visual State Manager)实现的方法(见这里),但是其方法有点过于复杂,并且效率低下。所以这里放出一种简单的实现 ScrollChanged 事件的方法。第一步:当然是找到你所需要增加此功能的页面的后台代码;第二步:在为其增加一个事件public event EventHandler VerticalScrollChanged;第三步:在此页面的构造函数中增加this.Set 阅读全文
posted @ 2012-03-08 14:20 lanmiao 阅读(557) 评论(0) 推荐(0) 编辑
摘要:1 /// <summary> 2 /// 十六进制颜色值转为Color对象 3 /// </summary> 4 /// <param name="colorName">十六进制颜色值</param> 5 /// <returns>Color对象</returns> 6 public static Color ConvertToColor(string colorName) 7 { 8 if (colorName.StartsWith("#")) 9 colorName = col 阅读全文
posted @ 2012-03-08 14:16 lanmiao 阅读(617) 评论(0) 推荐(0) 编辑
摘要:正点解方法一<Style x:Key="horizontalListBoxStyle" TargetType="ListBox"> <!--容器模板--> <Setter Property="ItemsPanel"> <Setter.Value> <ItemsPanelTemplate> <StackPanel Orientation... 阅读全文
posted @ 2012-02-24 14:24 lanmiao 阅读(721) 评论(0) 推荐(0) 编辑
摘要:XAML代码:1 <Border Name="Frame" Grid.Column="1" Style="{StaticResource ContentBorderStyle}">2 <Grid Grid.Column="1" Name="gridFrame">3 4 </Grid>5 </Border>后台代码: 1 private void LoadSolutionManagement() 2 { 3 WebClient Appcli... 阅读全文
posted @ 2011-12-02 10:01 lanmiao 阅读(1140) 评论(0) 推荐(0) 编辑
摘要:1 <Border Name="Frame" Grid.Column="1" Style="{StaticResource ContentBorderStyle}">2 <navigation:Frame x:Name="mainFrame"></navigation:Frame>3 </Border>导航的代码: IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSett 阅读全文
posted @ 2011-12-02 09:58 lanmiao 阅读(634) 评论(0) 推荐(0) 编辑
摘要:// Silverlight页面的跳转 // (Application.Current.RootVisualasIContent).Content=newDragControl(); //Silverlight页面的跳转//(Application.Current.RootVisual as IContent).Content = new DragControl();//普通页面跳转HtmlWindow html = HtmlPage.Window;//html.Navigate(new Uri("http://www.Silverlightchina.net"));//普 阅读全文
posted @ 2011-11-21 10:09 lanmiao 阅读(6765) 评论(0) 推荐(0) 编辑
摘要:JavaScript中调用Silverlight方法/属性要从JavaScript中调用Silverlight方法,Silverlight必须首先注册ScriptableObject。这可以通过给要暴露给js的类型加上ScriptableTypeAttribute,这样就会暴露该类型的所有属性、方法和事件;如果只要暴露一部分成员,也可以仅给这一部分成员标记ScriptableMemberAttribute(在过去的版本中仅有ScriptableAttribute)。这个标记是非常宽松的,只要类中有成员是Scriptable的,就可以使用HtmlPage.RegisterScriptableOb 阅读全文
posted @ 2011-11-10 09:46 lanmiao 阅读(930) 评论(0) 推荐(0) 编辑
摘要:分辨率宽:App.Current.Host.Content.ActualWidth;分辨率高:App.Current.Host.Content.ActualHeight; 阅读全文
posted @ 2011-11-03 16:27 lanmiao 阅读(168) 评论(0) 推荐(0) 编辑