WEB开发网
开发学院图形图像Flash Silverlight 3 Beta 新特性解析(7)- Child Wind... 阅读

Silverlight 3 Beta 新特性解析(7)- Child Window和Shader Effect篇

 2009-04-02 12:01:34 来源:WEB开发网   
核心提示: 1:privatevoidViewContactButton_Click(objectsender,RoutedEventArgse)2:{3:Employeeemployee=this.EmployeeGrid.SelectedItemasEmployee;4:if(employee!=

  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恢复原状

Silverlight 3 Beta 新特性解析(7)- Child Window和Shader Effect篇

上一页  1 2 3 4 5 6 7 8 9 10  下一页

Tags:Silverlight 特性

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接