自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Silverlight捕獲事件操作方法介紹

開發(fā) 開發(fā)工具
當(dāng)我們?cè)谶M(jìn)行全屏模式和普通模式之間進(jìn)行切換的時(shí)候,需要進(jìn)行Silverlight捕獲事件來獲得功能的實(shí)現(xiàn)。大家可以通過本文介紹的內(nèi)容提高對(duì)這款工具的認(rèn)識(shí)。

Silverlight開發(fā)工具在實(shí)際使用中,有很多功能和使用技巧值得我們?nèi)ド钊氲奶接懀偨Y(jié),以此來方便我們的開發(fā)程序效率。在這里就介紹一下有關(guān)Silverlight捕獲事件的實(shí)現(xiàn)方法。#t#

有時(shí)候,我們需要在全屏模式和普通模式之間切換時(shí),添加一個(gè)其它的代碼,這時(shí)可以使用事件FullScreenChanged。

  1. public Page()  
  2. {  
  3. InitializeComponent();  
  4. Application.Current.Host.
    Content.FullScreenChanged +=
     new EventHandler(Content_
    FullScreenChanged);  

實(shí)現(xiàn)Silverlight捕獲事件處理

  1. private void Content_FullScreen
    Changed(object sender, EventArgs e)  
  2. {  
  3. Content contentObject = Application.
    Current.Host.Content;  
  4. if (contentObject.IsFullScreen)  
  5. {  
  6. toggleButton.Background = new 
    SolidColorBrush(Colors.Green);  
  7. toggleButton.Content = "Full 
    Screen Mode"
    ;  
  8. }  
  9. else  
  10. {  
  11. toggleButton.Background = new 
    SolidColorBrush(Colors.Red);  
  12. toggleButton.Content = 
    "Normal Mode";  
  13. }  

在普通模式和全屏模式之間切換時(shí),改變按鈕的背景色和文字。

 

完整的Silverlight捕獲事件代碼如下:

 

  1. public partial class Page :
     UserControl  
  2. {  
  3. public Page()  
  4. {  
  5. InitializeComponent();  
  6. Application.Current.Host.Content.
    FullScreenChanged += new
     EventHandler(Content_FullScreenChanged);  
  7. }  
  8. private void toggleButton_Click
    (object sender, RoutedEventArgs e)  
  9. {  
  10. Content contentObject =
     
    Application.Current.Host.Content;  
  11. contentObject.IsFullScreen = 
    !contentObject.IsFullScreen;  
  12. }  
  13. private void Content_FullScreen
    Changed(object sender, EventArgs e)  
  14. {  
  15. Content contentObject = Application.
    Current.Host.Content;  
  16. if (contentObject.IsFullScreen)  
  17. {  
  18. toggleButton.Background = new 
    SolidColorBrush(Colors.Green);  
  19. toggleButton.Content = "Full 
    Screen Mode"
    ;  
  20. }  
  21. else  
  22. {  
  23. toggleButton.Background = new 
    SolidColorBrush(Colors.Red);  
  24. toggleButton.Content = 
    "Normal Mode";  
  25. }  
  26. }  

Silverlight捕獲事件的相關(guān)實(shí)現(xiàn)方法就為大家介紹到這里。

責(zé)任編輯:曹凱 來源: 博客園
相關(guān)推薦

2009-12-30 15:53:28

Silverlight

2010-01-04 16:50:04

Silverlight

2009-12-31 11:35:20

Silverlight

2009-12-30 16:48:52

Silverlight

2009-12-28 17:48:01

WPF界面布局

2010-01-28 14:01:32

Android監(jiān)聽通話

2010-01-07 10:46:27

VB.NET Sock

2009-12-30 15:08:04

Silverlight

2009-12-31 16:38:19

Silverlight

2009-12-30 10:44:38

Silverlight

2010-01-06 17:12:26

.Net Framew

2009-12-30 14:44:04

Silverlight

2009-12-15 13:59:42

Ruby對(duì)象操作

2010-02-01 09:40:08

Python操作

2011-07-20 15:08:22

C++

2009-12-31 16:18:44

Silverlight

2009-12-30 10:32:31

Silverlight

2010-03-04 09:58:32

安裝Python

2010-02-23 17:59:52

WSIT連接WCF

2009-12-31 15:05:00

Silverlight
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)