'宣言 Public Event PaneDragOver As EventHandler(Of PaneDragOverEventArgs)
public event EventHandler<PaneDragOverEventArgs> PaneDragOver
イベント ハンドラが、このイベントに関連するデータを含む、PaneDragOverEventArgs 型の引数を受け取りました。次の PaneDragOverEventArgs プロパティには、このイベントの固有の情報が記載されます。
プロパティ | 解説 |
---|---|
Cursor | 表示すべきカーソルを返すまたは設定します。 |
DragAction | 実行される操作についての情報を提供するクラスを返します。これは操作に関する特定の情報を取得するために適切なタイプにアップキャストされる必要があります。 |
Handled System.Windows.RoutedEventArgsから継承されます。 | Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. |
IsValidDragAction | 指定したドラッグ操作が有効かどうかを示すブール値を取得または設定します。 |
OriginalSource System.Windows.RoutedEventArgsから継承されます。 | Gets the original reporting source as determined by pure hit testing, before any possible System.Windows.RoutedEventArgs.Source adjustment by a parent class. |
Panes | ドラッグされたペインのコレクションを返します。 |
RoutedEvent System.Windows.RoutedEventArgsから継承されます。 | Gets or sets the System.Windows.RoutedEventArgs.RoutedEvent associated with this System.Windows.RoutedEventArgs instance. |
Source System.Windows.RoutedEventArgsから継承されます。 | Gets or sets a reference to the object that raised the event. |
Imports Infragistics.Windows.DockManager Imports Infragistics.Windows.DockManager.Dragging Imports Infragistics.Windows.DockManager.Events Private Sub XamDockManager_PaneDragOver(ByVal sender As Object, ByVal e As PaneDragOverEventArgs) ' note: this event is only fired once for each unique ' pane drag action. ' the drag action provides information about the type ' of action that will occur. the property is of the ' base class - PaneDragAction - so you need to upcast ' to the appropriate type to get additional information ' If TypeOf e.DragAction Is FloatPaneAction Then ' here we are preventing a drag operation from ' changing a docked pane into a new floating pane. ' the same effect would have been accomplished if ' the AllowDockingFloating of one or more of the ' panes in the e.Panes had been set to false. e.IsValidDragAction = False ' note: by default this event will only fire for ' valid drop locations. if you need to receive this ' event for locations that are not valid (e.g. based ' on properties of the pane(s) being dragged such as ' the AllowDocking(Left|Right|Top|Bottom) properties) ' then you need to set the ' RaisePaneDragOverForInvalidLocations property of the ' event args for the PaneDragStarting to true. ' 'e.IsValidDragAction = true; Else End If Dim sb As New System.Text.StringBuilder() sb.Append(e.DragAction.ToString()) sb.Append(": ") ' you can see the panes that are being dragged For Each pane As ContentPane In e.Panes sb.Append(pane.Header) sb.Append(",") Next System.Diagnostics.Debug.WriteLine(sb.ToString(), "PaneDragOver") ' the cursor property can be used to override the default ' valid/invalid drop cursor that was specified in the ' panedragstarting event. If e.IsValidDragAction = False Then e.Cursor = Cursors.No End If ' mark the event handled so it doesn't keep bubbling ' up the element tree e.Handled = True End Sub
using Infragistics.Windows.DockManager; using Infragistics.Windows.DockManager.Dragging; using Infragistics.Windows.DockManager.Events; private void XamDockManager_PaneDragOver(object sender, PaneDragOverEventArgs e) { // note: this event is only fired once for each unique // pane drag action. // the drag action provides information about the type // of action that will occur. the property is of the // base class - PaneDragAction - so you need to upcast // to the appropriate type to get additional information // if (e.DragAction is FloatPaneAction) { // here we are preventing a drag operation from // changing a docked pane into a new floating pane. // the same effect would have been accomplished if // the AllowDockingFloating of one or more of the // panes in the e.Panes had been set to false. e.IsValidDragAction = false; } else { // note: by default this event will only fire for // valid drop locations. if you need to receive this // event for locations that are not valid (e.g. based // on properties of the pane(s) being dragged such as // the AllowDocking(Left|Right|Top|Bottom) properties) // then you need to set the // RaisePaneDragOverForInvalidLocations property of the // event args for the PaneDragStarting to true. // //e.IsValidDragAction = true; } System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(e.DragAction.ToString()); sb.Append(": "); // you can see the panes that are being dragged foreach (ContentPane pane in e.Panes) { sb.Append(pane.Header); sb.Append(","); } System.Diagnostics.Debug.WriteLine(sb.ToString(), "PaneDragOver"); // the cursor property can be used to override the default // valid/invalid drop cursor that was specified in the // panedragstarting event. if (e.IsValidDragAction == false) e.Cursor = Cursors.No; // mark the event handled so it doesn't keep bubbling // up the element tree e.Handled = true; }