Silverlight 3 Beta 新特性解析(7)- Child Window和Shader Effect篇
2009-04-02 12:01:34 来源:WEB开发网 1: private void ViewContactButton_Click(object sender, RoutedEventArgs e)
2: {
3: Employee employee = this.EmployeeGrid.SelectedItem as Employee;
4: if (employee != null)
5: {
6: ContactWin contactWin = new ContactWin(employee.ContactID);
7: RippleEffect rippleEff = new RippleEffect();
8: rippleEff.Amplitude = 1;
9: rippleEff.Frequency = 1;
10: App.Current.RootVisual.Effect = rippleEff;
11:
12: contactWin.Closed += (sender2, e2) =>
13: {
14: App.Current.RootVisual.Effect = null;
15: };
16:
17: contactWin.Show();
18: //this.NavigationService.Navigate(new Uri(String.Format("ContactID={0}", employee.ContactID), UriKind.Relative));
19: }
20: }
由于所有继承自UIElement的控件都有Effect这个属性
所以我们可以给App.Current.RootVisual设置特效(这里设置的是RippleEffect)
而12~15将在ChildWindow关闭后,让App.Current.RootVisual恢复原状
Tags:Silverlight 特性
编辑录入:爽爽 [复制链接] [打 印]- ››silverlight全屏显示图片
- ››Silverlight MVVM 模式(一) 切近实战
- ››Silverlight for Windows Phone 7开发系列(1):...
- ››Silverlight for Windows Phone 7开发系列(2):...
- ››Silverlight for Windows Phone 7开发系列(3):...
- ››Silverlight for Windows Phone 7开发系列(4):...
- ››Silverlight for Symbian
- ››Silverlight3系列(四)数据绑定 Data Binding 1
- ››silverlight2 游戏 1 你能坚持多少秒
- ››Silverlight开发实践--PicZoomShow
- ››Silverlight自定义控件开发 - 令人懊恼的OnApplyT...
- ››Silverlight 2 RTW中ToolTipService.ToolTip不继承...
更多精彩
赞助商链接