Intersoft.Client.UI.Controls.Interactivity Namespace > UXPanel Class : ShadowInit Event |
Public Event ShadowInit As DragDropShadowRoutedEventHandler
Dim instance As UXPanel Dim handler As DragDropShadowRoutedEventHandler AddHandler instance.ShadowInit, handler
public event DragDropShadowRoutedEventHandler ShadowInit
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) | Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. |
HandledBy (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) | Gets or sets the source object that handles this event. |
IsHandledByPrimitive (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) | Determines whether this event is handled internally by control infrastructure. |
OriginalObject | Gets the original object. |
OriginalSource (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) | Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. |
RefreshOffset | Refresh the current offset based on new shadow object. |
RoutedEvent (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) | Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. |
ShadowObject | Gets or sets the shadow object. |
Source (Inherited from Intersoft.Client.Framework.ISRoutedEventArgs) | Gets or sets a reference to the object that raised the event. |
This event raised when shadow image is being initialized. You can customize the drag shadow object from this event.
The following example code demonstrates how to handle ShadowInit event to customize drag shadow object for UXPanel items.
XAML |
Copy Code
|
---|---|
<Intersoft:UXStackPanel HorizontalAlignment="Center" VerticalAlignment="Center" AllowReorderItem="True" ShadowInit="UXStackPanel_ShadowInit"> <StackPanel> <Image Source="folder.png" Height="64" Width="64"/> <TextBlock Text="My Archive" HorizontalAlignment="Center" VerticalAlignment="Center"/> </StackPanel> <StackPanel> <Image Source="folder.png" Height="64" Width="64"/> <TextBlock Text="My Photos" HorizontalAlignment="Center" VerticalAlignment="Center"/> </StackPanel> <StackPanel> <Image Source="folder.png" Height="64" Width="64"/> <TextBlock Text="My Videos" HorizontalAlignment="Center" VerticalAlignment="Center"/> </StackPanel> </Intersoft:UXStackPanel> |
C# |
Copy Code
|
---|---|
private void UXStackPanel_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; } |
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2