av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

Silverlight捕獲事件操作方法介紹

Silverlight開(kāi)發(fā)工具在實(shí)際使用中,有很多功能和使用技巧值得我們?nèi)ド钊氲奶接?,總結(jié),以此來(lái)方便我們的開(kāi)發(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)方法就為大家介紹到這里。


分享標(biāo)題:Silverlight捕獲事件操作方法介紹
文章位置:http://uogjgqi.cn/article/dposioc.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們?cè)谖⑿派?4小時(shí)期待你的聲音

解答本文疑問(wèn)/技術(shù)咨詢/運(yùn)營(yíng)咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流