Stylus.Synchronize 메서드

정의

커서와 사용자 인터페이스를 동기화합니다.

public:
 static void Synchronize();
public static void Synchronize ();
static member Synchronize : unit -> unit
Public Shared Sub Synchronize ()

예제

다음 예제에서는 커서 아래에 있는 요소를 가져오는 방법을 보여 줍니다. 를 호출 Synchronize 하면 가 DirectlyOver 올바른 요소를 반환합니다.

void AnimateButton()
{
    TranslateTransform buttonTransform = new TranslateTransform(0, 0);
    button1.RenderTransform = buttonTransform;

    // Animate the Button's position.
    DoubleAnimation myDoubleAnimation = new DoubleAnimation();
    myDoubleAnimation.From = 0;
    myDoubleAnimation.By = 100;
    myDoubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(5));
    myDoubleAnimation.AutoReverse = true;
    myDoubleAnimation.RepeatBehavior = RepeatBehavior.Forever;

    buttonTransform.BeginAnimation(TranslateTransform.XProperty, myDoubleAnimation);       
}
Sub AnimateButton() 
    Dim buttonTransform As New TranslateTransform(0, 0)
    button1.RenderTransform = buttonTransform
    
    ' Animate the Button's position.
    Dim myDoubleAnimation As New DoubleAnimation()
    myDoubleAnimation.From = 0
    myDoubleAnimation.By = 100
    myDoubleAnimation.Duration = New Duration(TimeSpan.FromSeconds(5))
    myDoubleAnimation.AutoReverse = True
    myDoubleAnimation.RepeatBehavior = RepeatBehavior.Forever
    
    buttonTransform.BeginAnimation(TranslateTransform.XProperty, myDoubleAnimation)

End Sub
void SynchronizeStylus()
{
    Stylus.Synchronize();
    UIElement element = (UIElement)Stylus.DirectlyOver;
    output.Text += "The stylus is over " + element.ToString() + "\r\n";
}
Sub SynchronizeStylus()

    Stylus.Synchronize()
    Dim element As UIElement = CType(Stylus.DirectlyOver, UIElement)
    output.Text += "The stylus is over " + element.ToString() & vbCr & vbLf

End Sub

설명

애플리케이션은 커서 위치에 요소를 확인 해야 합니다. 애니메이션을 사용 하면 애플리케이션을 DirectlyOver 메서드는 커서에서 움직인 요소를 반환할 수 있습니다. 를 호출 Synchronize 하여 가 DirectlyOver 적절한 요소를 반환하는지 확인합니다.

적용 대상