IInteractionTrackerOwner Interfaccia

Definizione

Contiene callback che verranno attivati dagli eventi InteractionTracker.

L'implementazione di questa interfaccia consente di ricevere callback relativi allo stato e ai valori di InteractionTracker, nonché se vengono rispettati gli aggiornamenti richiesti alle proprietà di InteractionTracker .

public interface class IInteractionTrackerOwner
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.LiftedContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(2288613277, 7466, 22550, 131, 106, 104, 169, 16, 80, 125, 135)]
struct IInteractionTrackerOwner
/// [Windows.Foundation.Metadata.Guid(2288613277, 7466, 22550, 131, 106, 104, 169, 16, 80, 125, 135)]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.WindowsAppSDKContract, 65536)]
struct IInteractionTrackerOwner
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.LiftedContract), 65536)]
[Windows.Foundation.Metadata.Guid(2288613277, 7466, 22550, 131, 106, 104, 169, 16, 80, 125, 135)]
public interface IInteractionTrackerOwner
[Windows.Foundation.Metadata.Guid(2288613277, 7466, 22550, 131, 106, 104, 169, 16, 80, 125, 135)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.WindowsAppSDKContract), 65536)]
public interface IInteractionTrackerOwner
Public Interface IInteractionTrackerOwner
Attributi

Esempio

class InteractionBehavior : Behavior<UIElement>, IInteractionTrackerOwner
{
  public void CustomAnimationStateEntered(InteractionTracker sender, InteractionTrackerCustomAnimationStateEnteredArgs args)
  {
    //Logic to run when InteractionTracker enters CustomAnimation 
  }

  public void IdleStateEntered(InteractionTracker sender, InteractionTrackerIdleStateEnteredArgs args)
  {
    //Logic to run when InteractionTracker enters Idle
  }

  public void InertiaStateEntered(InteractionTracker sender, InteractionTrackerInertiaStateEnteredArgs args)
  {
    //Logic to run when InteractionTracker enters Inertia
  }

  public void InteractingStateEntered(InteractionTracker sender, InteractionTrackerInteractingStateEnteredArgs args)
  {
    //Logic to run when InteractionTracker enters Interacting
  }

  public void RequestIgnored(InteractionTracker sender, InteractionTrackerRequestIgnoredArgs args)
  {
    //Logic to run when a request to update position or scale is ignored
  }

  public void ValuesChanged(InteractionTracker sender, InteractionTrackerValuesChangedArgs args)
  {

    //Logic to run when position or scale change
  }
}

Commenti

L'implementazione di IInteractionTrackerOwner è necessaria se l'applicazione deve avere aggiornamenti sullo stato o i valori di InteractionTracker. A causa della natura asincrona di questo modello, questi callback sono il modo migliore per aggiornare la logica dell'applicazione. Per altre informazioni sugli stati e sulle transizioni di InteractionTracker , vedere InteractionTracker.

È possibile creare un InteractionTracker con o senza proprietario. La creazione di InteractionTracker con un proprietario è necessaria per la registrazione per i callback. Se questi callback non sono importanti per lo stato dell'applicazione, la creazione di un InteractionTracker senza proprietario è appropriata.

La creazione di un InteractionTracker con un proprietario richiede anche l'eliminazione appropriata di InteractionTracker quando appropriato.

Metodi

Nome Descrizione
CustomAnimationStateEntered(InteractionTracker, InteractionTrackerCustomAnimationStateEnteredArgs)

Callback attivato quando un InteractionTracker entra nello stato dell'animazione personalizzata.

IdleStateEntered(InteractionTracker, InteractionTrackerIdleStateEnteredArgs)

Callback attivato quando un InteractionTracker entra nello stato di inattività.

InertiaStateEntered(InteractionTracker, InteractionTrackerInertiaStateEnteredArgs)

Callback attivato quando un InteractionTracker entra nello stato di inerzia.

InteractingStateEntered(InteractionTracker, InteractionTrackerInteractingStateEnteredArgs)

Callback attivato quando un InteractionTracker entra nello stato di interazione.

RequestIgnored(InteractionTracker, InteractionTrackerRequestIgnoredArgs)

Callback attivato quando InteractionTracker ha ignorato una richiesta.

ValuesChanged(InteractionTracker, InteractionTrackerValuesChangedArgs)

Callback attivato quando i valori di output di InteractionTracker sono stati modificati.

Si applica a