本文整理汇总了C#中Windows.UI.Xaml.FrameworkElement.GetProvider方法的典型用法代码示例。如果您正苦于以下问题:C# FrameworkElement.GetProvider方法的具体用法?C# FrameworkElement.GetProvider怎么用?C# FrameworkElement.GetProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.UI.Xaml.FrameworkElement
的用法示例。
在下文中一共展示了FrameworkElement.GetProvider方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AutomationInvokeAction
private static object AutomationInvokeAction(FrameworkElement element)
{
var invokeProvider = element.GetProvider<IInvokeProvider>(PatternInterface.Invoke);
invokeProvider.Invoke();
return null;
}
示例2: AutomationScrollAction
private static object AutomationScrollAction(FrameworkElement element, IDictionary<string, JToken> parameters)
{
var scrollProvider = element.GetProvider<IScrollProvider>(PatternInterface.Scroll);
var scrollInfo = parameters["args"].ElementAtOrDefault(1);
if (scrollInfo == null)
{
var msg = string.Format(HelpArgumentsErrorMsg, HelpUrlAutomationScript);
throw new AutomationException(msg, ResponseStatus.JavaScriptError);
}
var horizontalAmount = ParseScrollAmount(scrollInfo["horizontal"] ?? scrollInfo["h"]);
var verticalAmount = ParseScrollAmount(scrollInfo["vertical"] ?? scrollInfo["v"]);
var count = (scrollInfo["count"] ?? 1).Value<int>();
if (horizontalAmount != ScrollAmount.NoAmount && !scrollProvider.HorizontallyScrollable)
{
throw new AutomationException("Element is not horizontally scrollable.", ResponseStatus.JavaScriptError);
}
if (verticalAmount != ScrollAmount.NoAmount && !scrollProvider.VerticallyScrollable)
{
throw new AutomationException("Element is not vertically scrollable.", ResponseStatus.JavaScriptError);
}
for (var i = 0; i < count; ++i)
{
scrollProvider.Scroll(horizontalAmount, verticalAmount);
}
return null;
}
示例3: TogglePatternToggleState
private static string TogglePatternToggleState(FrameworkElement element)
{
var provider = element.GetProvider<IToggleProvider>(PatternInterface.Toggle);
return provider.ToggleState.ToString();
}
示例4: TogglePatternToggle
private static object TogglePatternToggle(FrameworkElement element)
{
var provider = element.GetProvider<IToggleProvider>(PatternInterface.Toggle);
provider.Toggle();
return null;
}