Class GridSplitterManager<T>
- Namespace
- SearchAThing.Desktop
- Assembly
- netcore-desktop.dll
Manage arrangement of control that allow split Vertically or Horizontally.
public class GridSplitterManager<T> : Grid, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, IInputElement, IDataTemplateHost, INamed, ISetterValue, IChildIndexProvider where T : Control, INotifyPropertyChanged
Type Parameters
T
- Manage arrangement of control that allow split Vertically or Horizontally.
- Inheritance
-
AvaloniaObjectAnimatableStyledElementVisualLayoutableInteractiveInputElementControlPanelGridGridSplitterManager<T>
- Implements
-
IDataContextProviderILogicalIThemeVariantHostIResourceHostIResourceNodeIStyleHostISetLogicalParentISetInheritanceParentIStyleableIInputElementIDataTemplateHostINamedISetterValueIChildIndexProvider
- Inherited Members
-
Grid.ShowGridLinesPropertyGrid.ColumnPropertyGrid.RowPropertyGrid.ColumnSpanPropertyGrid.RowSpanPropertyGrid.IsSharedSizeScopePropertyGrid.GetColumn(Control)Grid.GetRow(Control)Grid.GetColumnSpan(Control)Grid.GetRowSpan(Control)Grid.GetIsSharedSizeScope(Control)Grid.MeasureOverride(Size)Grid.ArrangeOverride(Size)Grid.ShowGridLinesGrid.ColumnDefinitionsGrid.RowDefinitionsPanel.BackgroundPropertyPanel.Render(DrawingContext)Panel.AffectsParentArrange<TPanel>(params AvaloniaProperty[])Panel.AffectsParentMeasure<TPanel>(params AvaloniaProperty[])Panel.BackgroundPanel.IsItemsHostControl.FocusAdornerPropertyControl.TagPropertyControl.ContextMenuPropertyControl.ContextFlyoutPropertyControl.RequestBringIntoViewEventControl.ContextRequestedEventControl.LoadedEventControl.UnloadedEventControl.SizeChangedEventControl.GetTemplateFocusTarget()Control.OnLoaded(RoutedEventArgs)Control.OnUnloaded(RoutedEventArgs)Control.OnSizeChanged(SizeChangedEventArgs)Control.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)Control.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)Control.OnGotFocus(GotFocusEventArgs)Control.OnLostFocus(RoutedEventArgs)Control.OnCreateAutomationPeer()Control.OnPointerReleased(PointerReleasedEventArgs)Control.OnKeyUp(KeyEventArgs)Control.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)Control.FocusAdornerControl.DataTemplatesControl.ContextMenuControl.ContextFlyoutControl.IsLoadedControl.TagControl.ContextRequestedControl.LoadedControl.UnloadedControl.SizeChangedInputElement.FocusablePropertyInputElement.IsEnabledPropertyInputElement.IsEffectivelyEnabledPropertyInputElement.CursorPropertyInputElement.IsKeyboardFocusWithinPropertyInputElement.IsFocusedPropertyInputElement.IsHitTestVisiblePropertyInputElement.IsPointerOverPropertyInputElement.IsTabStopPropertyInputElement.GotFocusEventInputElement.LostFocusEventInputElement.KeyDownEventInputElement.KeyUpEventInputElement.TabIndexPropertyInputElement.TextInputEventInputElement.TextInputMethodClientRequestedEventInputElement.PointerEnteredEventInputElement.PointerExitedEventInputElement.PointerMovedEventInputElement.PointerPressedEventInputElement.PointerReleasedEventInputElement.PointerCaptureLostEventInputElement.PointerWheelChangedEventInputElement.TappedEventInputElement.HoldingEventInputElement.DoubleTappedEventInputElement.Focus(NavigationMethod, KeyModifiers)InputElement.OnKeyDown(KeyEventArgs)InputElement.OnTextInput(TextInputEventArgs)InputElement.OnPointerEntered(PointerEventArgs)InputElement.OnPointerExited(PointerEventArgs)InputElement.OnPointerMoved(PointerEventArgs)InputElement.OnPointerPressed(PointerPressedEventArgs)InputElement.OnPointerCaptureLost(PointerCaptureLostEventArgs)InputElement.OnPointerWheelChanged(PointerWheelEventArgs)InputElement.UpdateIsEffectivelyEnabled()InputElement.FocusableInputElement.IsEnabledInputElement.CursorInputElement.IsKeyboardFocusWithinInputElement.IsFocusedInputElement.IsHitTestVisibleInputElement.IsPointerOverInputElement.IsTabStopInputElement.IsEffectivelyEnabledInputElement.TabIndexInputElement.KeyBindingsInputElement.IsEnabledCoreInputElement.GestureRecognizersInputElement.GotFocusInputElement.LostFocusInputElement.KeyDownInputElement.KeyUpInputElement.TextInputInputElement.TextInputMethodClientRequestedInputElement.PointerEnteredInputElement.PointerExitedInputElement.PointerMovedInputElement.PointerPressedInputElement.PointerReleasedInputElement.PointerCaptureLostInputElement.PointerWheelChangedInputElement.TappedInputElement.HoldingInputElement.DoubleTappedInteractive.RaiseEvent(RoutedEventArgs)Interactive.BuildEventRoute(RoutedEvent)Layoutable.DesiredSizePropertyLayoutable.WidthPropertyLayoutable.HeightPropertyLayoutable.MinWidthPropertyLayoutable.MaxWidthPropertyLayoutable.MinHeightPropertyLayoutable.MaxHeightPropertyLayoutable.MarginPropertyLayoutable.HorizontalAlignmentPropertyLayoutable.VerticalAlignmentPropertyLayoutable.UseLayoutRoundingPropertyLayoutable.UpdateLayout()Layoutable.ApplyTemplate()Layoutable.Measure(Size)Layoutable.Arrange(Rect)Layoutable.InvalidateMeasure()Layoutable.InvalidateArrange()Layoutable.AffectsMeasure<T>(params AvaloniaProperty[])Layoutable.AffectsArrange<T>(params AvaloniaProperty[])Layoutable.MeasureCore(Size)Layoutable.ArrangeCore(Rect)Layoutable.OnMeasureInvalidated()Layoutable.OnVisualParentChanged(Visual, Visual)Layoutable.WidthLayoutable.HeightLayoutable.MinWidthLayoutable.MaxWidthLayoutable.MinHeightLayoutable.MaxHeightLayoutable.MarginLayoutable.HorizontalAlignmentLayoutable.VerticalAlignmentLayoutable.DesiredSizeLayoutable.IsMeasureValidLayoutable.IsArrangeValidLayoutable.UseLayoutRoundingLayoutable.EffectiveViewportChangedLayoutable.LayoutUpdatedVisual.BoundsPropertyVisual.ClipToBoundsPropertyVisual.ClipPropertyVisual.IsVisiblePropertyVisual.OpacityPropertyVisual.OpacityMaskPropertyVisual.EffectPropertyVisual.HasMirrorTransformPropertyVisual.RenderTransformPropertyVisual.RenderTransformOriginPropertyVisual.FlowDirectionPropertyVisual.VisualParentPropertyVisual.ZIndexPropertyVisual.GetFlowDirection(Visual)Visual.SetFlowDirection(Visual, FlowDirection)Visual.InvalidateVisual()Visual.AffectsRender<T>(params AvaloniaProperty[])Visual.OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)Visual.OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)Visual.InvalidateMirrorTransform()Visual.BoundsVisual.ClipToBoundsVisual.ClipVisual.IsEffectivelyVisibleVisual.IsVisibleVisual.OpacityVisual.OpacityMaskVisual.EffectVisual.HasMirrorTransformVisual.RenderTransformVisual.RenderTransformOriginVisual.FlowDirectionVisual.ZIndexVisual.VisualChildrenVisual.VisualRootVisual.BypassFlowDirectionPoliciesVisual.AttachedToVisualTreeVisual.DetachedFromVisualTreeStyledElement.DataContextPropertyStyledElement.NamePropertyStyledElement.ParentPropertyStyledElement.TemplatedParentPropertyStyledElement.ThemePropertyStyledElement.BeginInit()StyledElement.EndInit()StyledElement.ApplyStyling()StyledElement.InitializeIfNeeded()StyledElement.OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)StyledElement.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)StyledElement.OnDataContextBeginUpdate()StyledElement.OnDataContextEndUpdate()StyledElement.OnInitialized()StyledElement.NameStyledElement.ClassesStyledElement.DataContextStyledElement.IsInitializedStyledElement.StylesStyledElement.StyleKeyStyledElement.ResourcesStyledElement.TemplatedParentStyledElement.ThemeStyledElement.LogicalChildrenStyledElement.PseudoClassesStyledElement.StyleKeyOverrideStyledElement.ParentStyledElement.ActualThemeVariantStyledElement.AttachedToLogicalTreeStyledElement.DetachedFromLogicalTreeStyledElement.DataContextChangedStyledElement.InitializedStyledElement.ResourcesChangedStyledElement.ActualThemeVariantChangedAnimatable.TransitionsPropertyAnimatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)Animatable.TransitionsAvaloniaObject.CheckAccess()AvaloniaObject.VerifyAccess()AvaloniaObject.ClearValue(AvaloniaProperty)AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)AvaloniaObject.ClearValue<T>(StyledProperty<T>)AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetHashCode()AvaloniaObject.GetValue(AvaloniaProperty)AvaloniaObject.GetValue<T>(StyledProperty<T>)AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)AvaloniaObject.IsAnimating(AvaloniaProperty)AvaloniaObject.IsSet(AvaloniaProperty)AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)AvaloniaObject.CoerceValue(AvaloniaProperty)AvaloniaObject.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)AvaloniaObject.InheritanceParentAvaloniaObject.this[AvaloniaProperty]AvaloniaObject.this[IndexerDescriptor]
- Extension Methods
Constructors
GridSplitterManager()
public GridSplitterManager()
Properties
Children
List programmatically created controls
public ObservableCollection<T> Children { get; }
Property Value
CreateControl
CreateControl
public Func<T>? CreateControl { get; set; }
Property Value
- Func<T>
DebugWriter
set to a valid text writer (eg.Console.Out) to debug structure processing; if null no debug output
public TextWriter? DebugWriter { get; set; }
Property Value
DistributeSplitSize
DistributeSplitSize if false split will half its size; if true (default) it creates a def star so balanced between N axial parallel controls
public bool DistributeSplitSize { get; set; }
Property Value
FocusedControl
FocusedControl
public T? FocusedControl { get; set; }
Property Value
- T
FocusedControlBorderBrush
FocusedControlBorderBrush
public IBrush FocusedControlBorderBrush { get; set; }
Property Value
- IBrush
FocusedControlBorderThickness
FocusedControlBorderThickness
public double FocusedControlBorderThickness { get; set; }
Property Value
JsonSettings
Json settings for SaveStructure(ConfigControlDelegate?) and LoadStructure(GridSplitterManagerLayoutItem, ConfigControlDelegate?).
public JsonSerializerSettings JsonSettings { get; }
Property Value
- JsonSerializerSettings
SplitterBrush
SplitterBrush
public IBrush SplitterBrush { get; set; }
Property Value
- IBrush
SplitterThickness
SplitterThickness
public double SplitterThickness { get; set; }
Property Value
Methods
Clear()
remove all layout except the topmost control view
public void Clear()
LoadStructure(GridSplitterManagerLayoutItem, ConfigControlDelegate?)
load split layout from object ( see SaveStructure )
public void LoadStructure(GridSplitterManagerLayoutItem layout, GridSplitterManager<T>.ConfigControlDelegate? reconfigureControl = null)
Parameters
layout
GridSplitterManagerLayoutItemsplit layout object
reconfigureControl
GridSplitterManager<T>.ConfigControlDelegateoptional configure control delegate
- See Also
OnPropertyChanged(string?)
invoke this method to forward propertchanged event notification. note: not needed to specify propertyName set by compiler service to called property.
protected void OnPropertyChanged(string? propertyName = null)
Parameters
propertyName
string
Remove()
removed currently focused control; does nothing if focused control is null
public void Remove()
SaveStructure(ConfigControlDelegate?)
create a serializable object that hold split configuration
public GridSplitterManagerLayoutItem SaveStructure(GridSplitterManager<T>.ConfigControlDelegate? emitControl = null)
Parameters
emitControl
GridSplitterManager<T>.ConfigControlDelegateoptionally an action to save apart control info
Returns
- See Also
ScanGrid(ConfigControlDelegate?, Action<(GridSplitterManagerLayoutItem item, Control control)>?)
public GridSplitterManagerLayoutItem ScanGrid(GridSplitterManager<T>.ConfigControlDelegate? emitControl = null, Action<(GridSplitterManagerLayoutItem item, Control control)>? controlVisited = null)
Parameters
emitControl
GridSplitterManager<T>.ConfigControlDelegatecontrolVisited
Action<(GridSplitterManagerLayoutItem item, Control control)>
Returns
Split(GridSplitDirection)
split focused control over given direction; does nothing if focused control is null
public T? Split(GridSplitDirection dir)
Parameters
dir
GridSplitDirectionsplit direction
Returns
- T
Split(GridSplitDirection, params double[])
split in the direction given producing a set of given sizes children
public T[]? Split(GridSplitDirection dir, params double[] sizes)
Parameters
dir
GridSplitDirectiondirection split
sizes
double[]list star size for produced children
Returns
- T[]
Events
ControlCreated
event fired when a child control created by split
public event GridSplitterManager<T>.ControlEventDelegate ControlCreated
Event Type
ControlRemoved
event fired when a child control removed by Remove() method
public event GridSplitterManager<T>.ControlEventDelegate ControlRemoved
Event Type
PropertyChanged
public event PropertyChangedEventHandler? PropertyChanged