随笔分类 -  Silverlight

摘要:果以下绑定,DataGrid 模板里的Radio 的绑定事件将不会被触发:<sdk:DataGrid Grid.Column="0" x:Name="dataGrid" IsReadOnly="True" AutoGenerateColumns="False" Width="auto" Height="auto" HorizontalAlignment="Left" VerticalAlignment="Top" ItemsSou 阅读全文
posted @ 2011-10-31 16:51 kntao 阅读(734) 评论(0) 推荐(0) 编辑
摘要:前边一篇文章中,说了一下WCF和Asp.net的session共享,现在实现Silverlight的过期退出和WCF服务session失效的同步方案。Silverlight的bussiness模板中已经包含了超时认证的部分,现作为借鉴,实现了WCF服务端session失效和Silverlight过期的同步。1. 在web.config中设置session过期的时间: <sessionState mode="InProc" stateConnectionString= "tcpip=127.0.0.1:42424" cookieless=" 阅读全文
posted @ 2011-10-31 16:19 kntao 阅读(370) 评论(0) 推荐(0) 编辑
摘要:silverlight的mvvm模式框架有,MVVM Light:http://mvvmlight.codeplex.comCaliburn:http://caliburn.codeplex.com/Prism:http://compositewpf.codeplex.com/其中MVVMLight是一个轻量级框架,大家可以参考。下面重点说一下View与Command的原理及使用。大家可以参照源代码:1.每一个ViewModel都继承ViewModelBase类:大致的源代码是:using System; using System.ComponentModel; using System.Li 阅读全文
posted @ 2011-10-28 18:27 kntao 阅读(655) 评论(0) 推荐(0) 编辑
摘要:具体思路是:利用 <PlaneProjection ></PlaneProjection> 对Frame做一个旋转动画。在ContentFrame_Navigating 方法里,记录此时的导航页的图片。 void ContentFrame_Navigating(object sender, NavigatingCancelEventArgs e) { LastFrameContent = new WriteableBitmap(ContentFrame, null); }并在ContentFrame_Navigated(obj... 阅读全文
posted @ 2011-10-26 10:49 kntao 阅读(259) 评论(0) 推荐(0) 编辑
摘要:直接见图:目前项目:Presentation Layer:采用MVVM Pattern Service Layer: 直接采用WCF通信 persistance Layer:采用NHibernate DB:SQL Server 阅读全文
posted @ 2011-06-30 09:41 kntao 阅读(101) 评论(0) 推荐(0) 编辑
摘要:使用RotateTransform进行旋转变形Angle属性定义选择角度,CenterX,CenterY旋转中心点。<TextBlock Text="This is the text to rotate!" TextWrapping="Wrap" Foreground="White"/><TextBlock.RenderTransform><RotateTransform Angle="45"/></TextBlock.RenderTransform> 使用Scale 阅读全文
posted @ 2010-07-13 15:44 kntao 阅读(249) 评论(0) 推荐(0) 编辑
摘要:1,Silverlight 与JS交互:<1>, silverlight 调用js:HtmlPage.Window.Invoke("函数名", new object[] { 参数数组});HtmlPage.Window.CreateInstance("函数名", new object[] { 参数数组});<2>,JS 调用silverlight方法:HtmlPage.RegisterScriptableObject("RPFrame", this);// 1,注册[ScriptableMember] // 2 阅读全文
posted @ 2010-05-31 17:42 kntao 阅读(190) 评论(0) 推荐(0) 编辑
摘要:在开发RIA,我们经常在某一点的控件或者是在一个范围内的控件,在Silverlight3中提供了方法帮我们解决VisualTreeHelper.FindElementsInHostCoordinates 。 名称说明FindElementsInHostCoordinates(Point, UIElement)检索一组对象,这些对象位于某一对象的坐标空间的指定点内。FindElementsInHostCoordinates(Rect, UIElement)检索一组对象,这些对象位于某一对象的坐标空间的指定 Rect 内。用法: List<UIElement> list = Visua 阅读全文
posted @ 2010-04-15 17:05 kntao 阅读(207) 评论(0) 推荐(0) 编辑
摘要:首先添加一个Grid <Grid x:Name="GTest" ShowGridLines="False" SizeChanged="GTest_SizeChanged" > </Grid> 1. Grid动态添加新的列和行。this.GTest.RowDefinitions.Add(new RowDefinition() {Height=new GridLength(30) });this.GTest.ColumnDefinitions.Add(new ColumnDefinition() { Width = 阅读全文
posted @ 2010-01-25 15:37 kntao 阅读(142) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示