摘要:
常量在编译器确定,并且不会改变,所以常量的类型必须是基础数据类型(primitive types)Boolean, Char, Byte, SByte, Int16, UInt16, Int32, UInt32, Int64,UInt64, Single, Double, Decimal, and String。当然也有特殊情况,即给定义非基础数据的常量的时候赋值null。 常量被当做静态变量。常... 阅读全文
随笔档案-2010年12月22日
Silverlight杂记-绑定和显示
2010-12-22 01:36 by 撞破南墙, 506 阅读, 收藏, 编辑
摘要:
绑定 1运行时绑定 DateTime currentTime = DateTime.Now; Binding binding = new Binding(“TimeOfDay”); binding.Source = currentTime; binding.Mode = BindingMode.OneWay; myTextBox.SetBinding(TextBox.TextProperty, binding); 2设计时绑定 TextBox x:Name=“myTextBox” Text=“{Binding TimeOfDay, Mode=OneWay}” / 使用属性绑定的方 阅读全文