2012-02-28 37 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; } 
    }