【注意】この文書にはより新しいバージョンが存在します: WCAG 2.1 達成方法集
この達成方法 (参考) の使用法と、この達成方法が WCAG 2.0 達成基準 (規定) とどのように関係するのかに関する重要な情報については、WCAG 達成基準の達成方法を理解するを参照のこと。適用 (対象) のセクションは、その達成方法の範囲について説明しており、特定の技術に関する達成方法の存在は、その技術があらゆる状況で WCAG 2.0 を満たすコンテンツを作成するために使用できることを意味するものではない。
Microsoft Silverlight, versions 3 and greater
Silverlight managed programming model and Silverlight XAML
訳注: Silverlight は、2021 年 11 月にサポートを終了する計画が Microsoft 社より公表されている (Microsoft サポート - Silverlight のライフサイクルポリシー)。
WAIC では、Silverlight に関する達成方法の翻訳を行っていないが、将来もその予定がないことに留意されたい。
これは、次の達成基準に関連する達成方法である:
SL11 に関するユーザエージェントサポートノートを参照のこと。Silverlight Technology Notesも参照。
The objective of this technique is to associate a "Pause" or "Stop" action for a Silverlight animation with a user interface control. This enables a user to pause or stop an animation in Silverlight content.
The Silverlight animation system is generalized such that nearly any
Silverlight property of type Double
, Point
or Color
can
be animated, or a property can cycle through discrete object values.
Thus the possibilities for which properties in the user interface can
be animated are quite broad. The general technique shown can be used
to pause or stop any Silverlight animation, including those that are
purely decorative.
Silverlight has two discrete methods for animation control: a Pause
method
and a Stop
method. The difference in behavior is that Pause
uses
whatever the last value was while the animation was still running,
and holds that value permanenently (unless the animation is restarted). Stop
sets
the value to be whatever value existed before the animation was started.
However, calling Stop
on an animation often results
in a behavior that looks like a "reset" to the user; this
is particularly true if the animation is animating an element's position
on screen. In many cases, what might be a conceptual "stop" for
the user is better accomplished by a "permanent Pause" in
the Silverlight animation API. Whether to call Pause
or Stop
is
an aesthetic decision and application authors can experiment to see
which behavior has the best appearance. If application authors choose
to use Stop
, authors can simply replace the call to
.Pause() with a call to .Stop() for any code that is based on this
technique's example.
The following is the XAML UI. The animated object and the animation behavior are both described in XAML, as is the control that users can activate to pause the animation.
<UserControl x:Class="PauseBouncyBall.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<UserControl.Resources>
<Storyboard x:Key="anim" RepeatBehavior="Forever" >
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Ball"
Storyboard.TargetProperty="(Canvas.Top)"
FillBehavior="HoldEnd" AutoReverse="True">
<EasingDoubleKeyFrame Value="100" KeyTime="00:00:01">
<EasingDoubleKeyFrame.EasingFunction>
<BounceEase Bounces="-1" EasingMode="EaseIn"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</UserControl.Resources>
<Canvas x:Name="LayoutRoot" Background="White" Height="600" Width="800">
<Ellipse Name="Ball" Fill="Red" Width="20" Height="20" Canvas.Top="200">
<Ellipse.RenderTransform>
<TransformGroup>
<TranslateTransform/>
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
<Button HorizontalAlignment="Left" Width="200" Click="Button_Click">Stop the bouncy ball please!</Button>
</Canvas>
</UserControl>
The following is the C# logic. One function is the "page" constructor,
which is what starts and loops the animation. The other function
is the event handler for the UI control (a button). The event handler
retrieves the animation definition from the page resources, and calls
the Pause
method on the animation.
public MainPage()
{
InitializeComponent();
(this.Resources["anim"] as Storyboard).Begin();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
(this.Resources["anim"] as Storyboard).Pause();
}
This example is shown in operation in the working example of Pause Bouncy Ball.
この参考リソースは、あくまでも情報提供のみが目的であり、推薦などを意味するものではない。
Using a browser that supports Silverlight, open an HTML page that references a Silverlight application through an object tag. For Silverlight content with moving, blinking, scrolling or auto-updating content that is the result of a running Silverlight animation:
Check for a mechanism to stop the movement, blinking, scrolling or auto-updating.
Check that the movement, blinking, scrolling or auto-updating stops when the mechanism is activated and does not restart by itself.
For pause, check that the animation can be restarted using a start mechanism.
#3 is true.
この達成方法が「十分な達成方法」の一つである場合、この手順や期待される結果を満たしていなければ、それはこの達成方法が正しく用いられていないことを意味するが、必ずしも達成基準を満たしていないことにはならない。場合によっては、別の達成方法によってその達成基準が満たされていることもありうる。