ResizableContentControl Class
Represents a ContentControl that contains a gripper, allowing it to be resized.
[TemplatePart(Name = "PART_Gripper", Type = typeof(Thumb))]
public class ResizableContentControl : ContentControl
- Inheritance:
- object Visual UIElement FrameworkElement Control ContentControl object
Constructors
ResizableContentControl()
Initializes an instance of the class.
public ResizableContentControl()
ResizableContentControl(object)
Initializes an instance of the class.
public ResizableContentControl(object content)
| Parameter | Type | Description |
|---|---|---|
| content | object | The object to use as the content. |
Properties
CanAutoSize
Indicates whether the gripper auto-sizes to its content when it is double-clicked.
public bool CanAutoSize { get; set; }
Property Value
- bool:
trueif the gripper auto-sizes to its content when it is double-clicked; otherwise,false. The default value istrue.
GripperBackground
The Brush to use for the gripper background.
GripperForeground
The Brush to use for the gripper foreground.
ResizeMode
A ControlResizeMode indicating the resizing capabilities of the gripper.
public ControlResizeMode ResizeMode { get; set; }
Property Value
- ControlResizeMode:
The default value is Both.
Remarks
Use the None> value to hide the gripper.
Methods
AutoSize()
Auto-sizes the content control to the desired size of its content.
public void AutoSize()
GetUseAlternateScrollViewerStyle(DependencyObject)
Gets the value of the UseAlternateScrollViewerStyleProperty attached property for a specified object.
public static bool GetUseAlternateScrollViewerStyle(DependencyObject obj)
| Parameter | Type | Description |
|---|---|---|
| obj | DependencyObject | The object to which the attached property is retrieved. |
Returns
- bool:
trueif the alternate Style should be used for ScrollViewer elements; otherwise,false.
MeasureOverride(Size)
Called to remeasure a control.
protected override Size MeasureOverride(Size constraint)
| Parameter | Type | Description |
|---|---|---|
| constraint | Size | The maximum size that the method can return. |
Returns
- Size:
The size of the control, up to the maximum specified by
constraint.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
SetUseAlternateScrollViewerStyle(DependencyObject, bool)
Sets the value of the UseAlternateScrollViewerStyleProperty attached property to a specified object.
public static void SetUseAlternateScrollViewerStyle(DependencyObject obj, bool value)
| Parameter | Type | Description |
|---|---|---|
| obj | DependencyObject | The object to which the attached property is written. |
| value | bool |
|
Fields
CanAutoSizeProperty
Defines the CanAutoSize property.
public static readonly DependencyProperty CanAutoSizeProperty
GripperBackgroundProperty
Defines the GripperBackground property.
public static readonly DependencyProperty GripperBackgroundProperty
GripperForegroundProperty
Defines the GripperForeground property.
public static readonly DependencyProperty GripperForegroundProperty
ResizeModeProperty
Defines the ResizeMode property.
public static readonly DependencyProperty ResizeModeProperty
UseAlternateScrollViewerStyleProperty
Defines the UseAlternateScrollViewerStyle property.
public static readonly DependencyProperty UseAlternateScrollViewerStyleProperty