DataGridColumn.DragIndicatorStyle DataGridColumn.DragIndicatorStyle DataGridColumn.DragIndicatorStyle DataGridColumn.DragIndicatorStyle Property


取得或設定在拖曳作業期間要套用至資料行標題的樣式物件。Gets or sets the style object to apply to the column header during a drag operation.

 property System::Windows::Style ^ DragIndicatorStyle { System::Windows::Style ^ get(); void set(System::Windows::Style ^ value); };
public System.Windows.Style DragIndicatorStyle { get; set; }
member this.DragIndicatorStyle : System.Windows.Style with get, set
Public Property DragIndicatorStyle As Style


在拖曳作業期間要套用至資料行標題的樣式物件。The style object to apply to the column header during a drag operation. 已註冊的預設值是 nullThe registered default is null. 如需哪些因素會影響值的詳細資訊,請參閱 DependencyPropertyFor information about what can influence the value, see DependencyProperty.


使用這個屬性,即可設定DragIndicatorStyle DataGrid中個別資料行的。Use this property to set the DragIndicatorStyle for an individual column in the DataGrid. 若要定義Style拖曳指標的,請TargetType指定的ControlTo define a Style for the drag indicator, specify a TargetType of Control.

您可以在樣式中設定屬性,以變更拖曳指標的某些元素外觀,例如資料行標頭周圍的框線。You can set properties in the style to change the appearance of certain elements of the drag indicator, such as the border around the column header. 不過,拖曳指標的預設範本會使用VisualBrushCanvas繪製,以及要拖曳之原始資料行標頭的影像。However, the default template for the drag indicator uses a VisualBrush to paint a Canvas with an image of the original column header that is being dragged. 因此,如果您在樣式中設定某些屬性(例如BackgroundForeground),它們就會顯示為不套用。As a result, if you set some properties in your style, such as Background or Foreground, they will appear to not be applied. 若要在拖曳資料行標頭時變更其外觀,請套用不使用預設值VisualBrush的新範本。To change the appearance of the column header while it is being dragged, apply a new template that does not use the default VisualBrush.