by Corrado Cavalli via Corrado's BLogs on 12/21/2009 8:59:57 PM
Scopo: Muovere un elemento X dalla posizione “A” alla “B” usando l’oggetto VisualStateManager di WPF e Silverlight.
In tutti e tre i casi (WPF 3.5, WPF 4.0 e Silverlight X) lo XAML generato da Blend è esattamente lo stesso:
1: <Grid x:Name="LayoutRoot">
2: <VisualStateManager.VisualStateGroups>
3: <VisualStateGroup x:Name="States">
4: <VisualState x:Name="Normal"/>
5: <VisualState x:Name="Moved">
6: <cut…>
Il codice da utilizzare per passare nello stato “Moved” è:
WPF 3.5: *No way* la soluzione più semplice è utilizzare il behavior GotoStateAction (o l’estensione ad-hoc creata da Blend)
WPF 4.0: Usare VisualStateManager.GotoElementState(“LayoutRoot”,”Moved”,true);
Silverlight: VisualStateManager.GotoState(this,”Moved”,true);
In parole povere: Tre modi diversi per ottenere lo stesso risultato
Original Post: VisualStateManager: Un esempio da non seguire
The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.