日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Silverlight捕獲事件操作方法介紹

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

有時候,我們需要在全屏模式和普通模式之間切換時,添加一個其它的代碼,這時可以使用事件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. }  

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

完整的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)方法就為大家介紹到這里。


文章名稱:Silverlight捕獲事件操作方法介紹
網(wǎng)站URL:http://www.5511xx.com/article/dposioc.html