2012-02-28 39 views

回答

3

我不知道如何自動化您的用戶界面。

如果您使用的是昂貴的工具包,那麼我發現這樣做的唯一方法是使用觸摸手勢使用鼠標操作 - 但顯然這隻能在手機上。

如果您使用的是一些手工製作的工具包,那麼您可能需要在應用程序欄中使用一些包裝,與綁定應用程序欄所用的方式相同。這不是完全的UI自動化(它不是自動化級別),但應用程序欄不是標準的Silverlight控件,這種黑客至少可以讓你進步。

+0

感謝您的意見,我可以寫一個類'MyapplicationBarIconButton'派生自'按鈕',我不能將它添加到ApplicationBar.Buttons.What我應該做什麼爲了這? – 2012-02-29 07:47:25

0
public class MyApplicationBarIconButton : Button, IApplicationBarIconButton 
    { 
     public MyApplicationBarIconButton() 
     {  
     } 
     public MyApplicationBarIconButton(Uri iconUri,String text) 
     { 
      IconUri = iconUri; 
      Text = text; 
     } 
     public string Text { get; set; } 
     public event EventHandler Click; 
     public Uri IconUri { get; set; } 
     public bool IsEnabled { get; set; } 
    }