Silverlight2.0 beta版转成Silverlight2.0 RC版的主要修改
Posted on 2008-10-20 14:15 lazypig01 阅读(143) 评论(0) 收藏 举报近期要将之前做的一个Silverlight2.0beta版转化为RC版,修改程序很麻烦,以下是主要的修改过程:
.SetValue(Canvas.TopProperty, 0);这里Canvas.TopProperty LeftProperty 需要double类型 所以改为.SetValue(Canvas.TopProperty, 0.0); SetValue里面参数变成强类型了
Storyboard.SetTargetProperty(Timeline,string)变成Storyboard.SetTargetProperty(Timeline,PropertyPath)
_imgTiles[i, j].GetValue(Image.SourceProperty)不再获得是Uri而是中间多了一层BitmapImage对象 要获得Uri必须这么写((BitmapImage)(_imgTiles[i, j].GetValue(Image.SourceProperty))).UriSource.OriginalString;清空SourceProperty的话,增加了ClearValue()方法,可以使用_img.ClearValue(Image.SourceProperty)
Resources变成了hashTable形式,增加了速度,所以root.Resources.Add(object)变成root.Resources.Add(string key,object) 再每次add之前最好先remove以确保没有一样的键值
SplineDoubleKeyFrame增加了KeyTime属性,所以不需要像以前用SetValue方法了
因为ContentPresenter源自FrameworkElement而不是Control了,所以FontWeight已经不是ContentPresenter的属性了,以下属性也不在ContentPresenter中:
· Background
· BorderBrush
· BorderThickness
· DefaultStyleKey
· FontFamily
· FontSize
· FontStretch
· FontStyle
· FontWeight
· Foreground
· HorizontalContentAlignment
· IsEnabled
· IsTabStop
· Padding
· TabIndex
· TabNavigation
· Template
· VerticalContentAlignment