Share via


ReorderThemeTransition Classe

Définition

Fournit le comportement de la transition animée pour les cas où les éléments des contrôles list-view changent d’ordre. Cela est généralement dû à une opération de glisser-déplacer. Différents contrôles et thèmes ont potentiellement des caractéristiques variables pour les animations impliquées.

public ref class ReorderThemeTransition sealed : Transition
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ReorderThemeTransition final : Transition
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class ReorderThemeTransition final : Transition
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ReorderThemeTransition : Transition
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class ReorderThemeTransition : Transition
Public NotInheritable Class ReorderThemeTransition
Inherits Transition
<ReorderThemeTransition .../>
Héritage
Object Platform::Object IInspectable DependencyObject Transition ReorderThemeTransition
Attributs

Configuration requise pour Windows

Famille d’appareils
Windows 10 (introduit dans 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduit dans v1.0)

Exemples

L’exemple suivant applique un ReorderThemeAnimation à un ensemble de rectangles. À mesure que les nouveaux rectangles sont ajoutés à l’ensemble, les autres rectangles s’animent autour du nouveau.

<StackPanel>
    <Button x:Name="AddItemButton" Content="AddItem" Click="AddItemButton_Click"/>
    <ItemsControl x:Name="ItemsList">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <WrapGrid>
                    <WrapGrid.ChildrenTransitions>
<!-- Apply a ReorderThemeTransition that will run when child elements are reordered. -->
                        <TransitionCollection>
                            <ReorderThemeTransition/>
                        </TransitionCollection>
                    </WrapGrid.ChildrenTransitions>
                </WrapGrid>
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
        <!-- Initial items. -->
        <Rectangle Width="100" Height="100" Fill="Red"/>
        <Rectangle Width="100" Height="100" Fill="Green"/>
        <Rectangle Width="100" Height="100" Fill="Blue"/>            
    </ItemsControl>            
</StackPanel>
private void AddItemButton_Click(object sender, RoutedEventArgs e)
{
    Rectangle newItem = new Rectangle();
    Random rand = new Random();

    newItem.Height = 100;
    newItem.Width = 100;
    newItem.Fill = new SolidColorBrush(Color.FromArgb(255,
            (byte)rand.Next(0, 255), (byte)rand.Next(0, 255), (byte)rand.Next(0, 255)));

    // Insert a new Rectangle of a random color into the ItemsControl at index 2.
    ItemsList.Items.Insert(2, newItem);
}
void DocsCppWinRT::MainPage::AddItemButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e)
{
    Windows::UI::Xaml::Shapes::Rectangle newItem;

    newItem.Height(100);
    newItem.Width(100);

    Windows::UI::Color color;
    color.R = std::rand() % 256;
    color.G = std::rand() % 256;
    color.B = std::rand() % 256;

    newItem.Fill(Windows::UI::Xaml::Media::SolidColorBrush(color));

    // Insert a new Rectangle of a random color into the ItemsControl at index 2.
    ItemsList().Items().InsertAt(2, newItem);
}
void DocsCPP::MainPage::AddItemButton_Click(Object^ sender,RoutedEventArgs^ e)
{
    Rectangle^ newItem = ref new Rectangle();

    newItem->Height = 100;
    newItem->Width = 100;

    Color color;
    color.R = rand() % 256;
    color.G = rand() % 256;
    color.B = rand() % 256;

    newItem->Fill = ref new SolidColorBrush(color);

    // Insert a new Rectangle of a random color into the ItemsControl at index 2.
    ItemsList->Items->InsertAt(2, newItem);
}

Remarques

Notez que la définition de la propriété Duration n’a aucun effet sur cet objet, car la durée est préconfigurée.

Constructeurs

ReorderThemeTransition()

Initialise une nouvelle instance de la classe ReorderThemeTransition.

Propriétés

Dispatcher

Obtient le CoreDispatcher auquel cet objet est associé. CoreDispatcher représente une installation qui peut accéder à DependencyObject sur le thread d’interface utilisateur, même si le code est initié par un thread autre que l’interface utilisateur.

(Hérité de DependencyObject)

Méthodes

ClearValue(DependencyProperty)

Efface la valeur locale d’une propriété de dépendance.

(Hérité de DependencyObject)
GetAnimationBaseValue(DependencyProperty)

Retourne toute valeur de base établie pour une propriété de dépendance, qui s’applique dans les cas où une animation n’est pas active.

(Hérité de DependencyObject)
GetValue(DependencyProperty)

Retourne la valeur effective actuelle d’une propriété de dépendance à partir d’un objet DependencyObject.

(Hérité de DependencyObject)
ReadLocalValue(DependencyProperty)

Retourne la valeur locale d’une propriété de dépendance, si une valeur locale est définie.

(Hérité de DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

Inscrit une fonction de notification pour écouter les modifications apportées à un DependencyProperty spécifique sur ce instance DependencyObject.

(Hérité de DependencyObject)
SetValue(DependencyProperty, Object)

Définit la valeur locale d’une propriété de dépendance sur un DependencyObject.

(Hérité de DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

Annule une notification de modification précédemment inscrite en appelant RegisterPropertyChangedCallback.

(Hérité de DependencyObject)

S’applique à

Voir aussi