吴佳鑫的个人专栏

当日事当日毕,没有任何借口

导航

上一页 1 2 3 4 5 6 ··· 18 下一页

2012年8月17日

silverlight DependencyObject和DependencyProperty详解

摘要: 之前我们多次讲到绑定,它会有一个通知作用,那这个通知作用是怎么出来的呢,为什么我们以前的CLR的属性就没有这种通知功能呢?那是因为现在我们SL中多了这样两个概念--- DependencyObject和DependencyProperty。DependencyProperty实际上就是在DependencyObject中去使用的。下面分别来介绍这两个东东。一、DependencyObject1、它是SL内置定义好的,并拥有DependencyProperty的类。2、它是一个准备要去绑定的一个数据对象 3、我们所有的界面元素是由 DependencyObject 派生的。来一个UML图一、D. 阅读全文

posted @ 2012-08-17 00:34 _eagle 阅读(2423) 评论(2) 推荐(4) 编辑

2012年8月16日

silverlight 转换器经典demo

摘要: 当在 文本框中输入 大于0时,会显示向上的箭头,输入等于0时,会显示一条横线,输入小于0时,会显示向下的箭头。前台XAML代码:<UserControl 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 阅读全文

posted @ 2012-08-16 22:25 _eagle 阅读(784) 评论(0) 推荐(1) 编辑

silverlight Binding 详解

摘要: 这个日记介绍:•Binding with Tools (在blend中绑定)•Binding with Handwriting (在代码中手工绑定)一、数据源绑定一般我们在做demo时会提供一些示例数据,在blend中,创建示例数据源是非常简单的。下面介绍两种数据源的创建方法。在blend中,点击data面板,会见到两个类型饼图的小图标。1、Single Data (右边的按键)2、List Data (左边的按键)下图为创建 Single Data 数据源:创建这种的示例数据源,可以提供给单个对象使用。比例下图的一个Point对象(需要一个X轴和Y轴数据)下图为创建List Data 数据源 阅读全文

posted @ 2012-08-16 01:46 _eagle 阅读(3916) 评论(0) 推荐(0) 编辑

2012年8月5日

Silverlight设计时特性的使用

摘要: 1.[Category("MyCategory")]:属性分组,让设计师能在“属性的海洋”中快速找到自己需要的属性2.[EditorBrowsable(EditorBrowsableState.Advanced)]:属性隐藏,把不常用的属性放在隐藏面板中,在需要时才展开面板3.[Description("This is a number of clicking.")]:属性描述,提示设计师该属性的作用和注意事项4.[AlternateContentProperty]:控件内容,在对象树中,提供UI元素插入的功能5.Style 和 Template类型的属 阅读全文

posted @ 2012-08-05 22:28 _eagle 阅读(408) 评论(0) 推荐(0) 编辑

silverlight storyboard

摘要: 一个 storyboard 实际是由多个 TimeLine 来组成上图可以看出storyBoard中有一个属性是Children,它是TimelineCollection类型,就是说它包含了多个Timeline,见下图:来一个例子:看看XAML生成的代码,上面有两个DoubleAnimationUsingKeyFrames,但实际上是一个Timeline。但是在CS代码中,我们打出DoubleAnimationUsingKeyFrames,按F12可以看出它也是继承于 TimeLine示例图的红线可以看到,一个Timeline实际上是对应的是某一个控件的某一个属性的变化过程。一个Timelin 阅读全文

posted @ 2012-08-05 22:14 _eagle 阅读(575) 评论(0) 推荐(0) 编辑

silverlight ItemTemplate和ItemPanel实例

摘要: 先定义一个Panel。好让下面的演示:using System.Windows.Controls;using System.Windows;namespace Class3Samples{ public class CyclePanel : Panel { protected override System.Windows.Size ArrangeOverride(System.Windows.Size finalSize) { int count = this.Children.Count; Point ce... 阅读全文

posted @ 2012-08-05 02:01 _eagle 阅读(905) 评论(0) 推荐(0) 编辑

silverlight style和template 使用之tip

摘要: Style:1、 Control Style这是最基本的样式---控制样式,包括SL自带的控件和自定义控件。•TargetType: Button -- SL自带的控件 TargetType: local:MyControl -- 自定义的控件。 local是命名空间。View Code <Style x:Key="ButtonStyle1" TargetType="Button"> <Setter Property="Background" Value="#FF1F3B53"/> < 阅读全文

posted @ 2012-08-05 01:06 _eagle 阅读(1537) 评论(0) 推荐(1) 编辑

2012年7月29日

silverlight 之Control and UserControl 区别

摘要: 先来一张UML图最简单的来说,UserControl 是Control 的一个子类。但是在实际应用中,它们会给平等的对待。有时候我们的Control会让它直接继承 Control这个类,有的时候会直接继承于UserControl 这个类。区别:1、UserControl 它实际上是已有控件的组合(textbox , button ....),它的功能是做组合; 而Control 主要是做功能,就是做一些有独特功能的控件。2、UserControl 主要是对一些已有control之间的联动,像我们要有一个翻页功能,点击了左键要翻页,点击了右键要翻页什么的,这种比较多的情况是一个UserContr 阅读全文

posted @ 2012-07-29 00:09 _eagle 阅读(1188) 评论(0) 推荐(0) 编辑

2012年7月26日

silverlight 布局系统总结

摘要: 来一张UML图。可以看到各个布局都是继承于 FrameWorkElement 。可以看到有的布局是继承于 Panel ,有的是继承于Control , 有的是直接继承于FrameWorkElement。–Panel: Grid, Canvas, StackPanel 等等–FrameworkElement: Border, ContentPresenter–Control: ContentControl1、继承于Panel 的布局容器是可以容纳多个Child 孩子的,都有一些布局功能的。2、继承于FrameworkElement 的 Border , ContentPresenter,这两个只 阅读全文

posted @ 2012-07-26 00:51 _eagle 阅读(1188) 评论(0) 推荐(0) 编辑

2012年7月25日

sivlerlight 之 ListBox各种数据源绑定demo

摘要: 前台XAM;:<UserControl 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-compatibi 阅读全文

posted @ 2012-07-25 00:17 _eagle 阅读(534) 评论(0) 推荐(1) 编辑

上一页 1 2 3 4 5 6 ··· 18 下一页