| Visual Basic (Declaration) | |
|---|---|
Public Event ShadowInit As DragDropShadowRoutedEventHandler | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As DragDropBehavior Dim handler As DragDropShadowRoutedEventHandler AddHandler instance.ShadowInit, handler | |
| C# | |
|---|---|
public event DragDropShadowRoutedEventHandler ShadowInit | |
| Delphi | |
|---|---|
public event ShadowInit: DragDropShadowRoutedEventHandler; | |
| JScript | |
|---|---|
In JScript, you can handle the events defined by another class, but you cannot define your own. | |
| Managed Extensions for C++ | |
|---|---|
public: __event DragDropShadowRoutedEventHandler* ShadowInit | |
| C++/CLI | |
|---|---|
public: event DragDropShadowRoutedEventHandler^ ShadowInit | |
The event handler receives an argument of type DragDropShadowEventArgs containing data related to this event. The following DragDropShadowEventArgs properties provide information specific to this event.
| Property | Description |
|---|---|
| Handled (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) | |
| HandledBy (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) | |
| IsHandledByPrimitive (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) | |
| OriginalObject | Gets the original object. |
| OriginalSource (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) | |
| RefreshOffset | Refresh the current offset based on new shadow object. |
| RoutedEvent (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) | |
| ShadowObject | Gets or sets the shadow object. |
| Source (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) |
The following example code demonstrates how to create custom object / image and uses it as drag shadow object when drag drop take place.
| XAML | Copy Code |
|---|---|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <i:Interaction.Behaviors> <Intersoft:DragDropBehavior ShadowInit="DragDropBehavior_ShadowInit"/> </i:Interaction.Behaviors> <Image Source="folder.png" Height="64" Width="64"/> <TextBlock Text="My Archive" HorizontalAlignment="Center" VerticalAlignment="Center"/> </StackPanel> |
|
| C# | Copy Code |
|---|---|
private void DragDropBehavior_ShadowInit(object sender, Intersoft.Client.UI.Controls.Interactivity.DragDropShadowEventArgs e) { Image originalShadow = e.ShadowObject as Image; Image image = new Image() { Source = originalShadow.Source }; image.Height = originalShadow.ActualHeight; image.Width = originalShadow.ActualWidth; Border shadow = new Border(); shadow.BorderThickness = new Thickness(1); shadow.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0)); shadow.Child = image; e.ShadowObject = shadow; } |
|
This event raised when shadow image is being initialized. You can customize the drag shadow object from this event.
This e
Copy Code