Attached Behaviors

There are 2 entries for the tag Attached Behaviors
Wpf: “Drag & Drop” Behavior, okkio :-)

Questo manuale proprio non mi va giù :-) Pochissimi giorni fa ho introdotto nel mio toolkit un behavior per generalizzare la gestione del Drag & Drop, a breve il tutto probabilmente finirà su CodePlex, ma non è questo l’argomento odierno. Houston abbiamo un problema <cit.> Nel post di cui sopra, per agganciare il behavior ad una ListView facevamo: <ListView Margin="5" HorizontalAlignment="Stretch" behaviors:DragDropManager.DataObject="{Binding Path=ItemsToDrag}" behaviors:DragDropManager.DataObjectType="myType" ItemsSource="{Binding...

posted @ mercoledì 30 settembre 2009 17:07 | Feedback (0)

Wpf: “Drag & Drop” Behavior, embrionale.

Se soffrite da dipendenza acuta da M-V-VM questa è una discreta rottura perchè il drag & drop è “roba” totalmente da Presentation (aka View) ma la logica è totalmente da Business (aka ViewModel). La gestione del drag & drop è quindi un ottimo candidato per divertirci con gli attached behavior, nome figoso per le ormai legacy attached properties. Quello che vogliamo ottenere è questo: <ListView HorizontalAlignment="Stretch" SelectedItem="{Binding Path=Selection}" behaviors:DragDropManager.DataObject="{Binding Path=Selection}" ...

posted @ martedì 29 settembre 2009 10:42 | Feedback (2)