Class ContainerHeaderViewModel
Represents a Header element for IContainer elements.
Inherited Members
Namespace: Syncfusion.UI.Xaml.Diagram
Assembly: Syncfusion.SfDiagram.WPF.dll
Syntax
public class ContainerHeaderViewModel : DiagramElementViewModel, IContainerHeader, IDiagramElement, IID, INotifyPropertyChanged
Examples
Below example explains how to add header for Container object.
<!--Initialize the Container-->
<syncfusion:ContainerViewModel UnitHeight="200" UnitWidth="250">
<syncfusion:ContainerViewModel.Header>
<!--Initialize the Container's header-->
<syncfusion:ContainerHeaderViewModel UnitHeight="40">
<!--Initialize the Container's header text-->
<syncfusion:ContainerHeaderViewModel.Annotation>
<syncfusion:AnnotationEditorViewModel Content="Title"/>
</syncfusion:ContainerHeaderViewModel.Annotation>
</syncfusion:ContainerHeaderViewModel>
</syncfusion:ContainerViewModel.Header>
</syncfusion:ContainerViewModel>
Constructors
ContainerHeaderViewModel()
Creates new instance of ContainerHeaderViewModel class.
Declaration
public ContainerHeaderViewModel()
Properties
Annotation
Represent a block of text that can be displayed over a Header of ContainerHeaderViewModel.
Declaration
public IAnnotation Annotation { get; set; }
Property Value
Type |
---|
IAnnotation |
Info
Gets or sets the more / additional information about the Container's header block.
Declaration
public IContainerHeaderInfo Info { get; set; }
Property Value
Type |
---|
IContainerHeaderInfo |
Examples
Below example explains how to get the bounds of the Container's Header.
private void OnDiagramItemSelected(object sender, DiagramEventArgs args)
{
if (args.Item is ContainerViewModel container)
{
// Get the bounds of the Container's Header
IContainerHeader header = container.Header;
Rect headerBounds = ((IContainerHeaderInfo)header.Info).Bounds;
}
}
ShapeStyle
Gets or sets the style of the Container's header block.
Declaration
public Style ShapeStyle { get; set; }
Property Value
Type |
---|
System.Windows.Style |
Examples
Below example explains how to customize the appearance of the Header block.
<!--Initialize the Container-->
<syncfusion:ContainerViewModel x:Name="container" UnitHeight="200" UnitWidth="250">
<syncfusion:ContainerViewModel.Header>
<!--Initialize the Container's header-->
<syncfusion:ContainerHeaderViewModel UnitHeight="40">
<!--Initialize the Container's header text-->
<syncfusion:ContainerHeaderViewModel.Annotation>
<syncfusion:AnnotationEditorViewModel Content="Title"/>
</syncfusion:ContainerHeaderViewModel.Annotation>
<!--Define the style for header block-->
<syncfusion:ContainerHeaderViewModel.ShapeStyle>
<Style TargetType="Path">
<Setter Property="Fill" Value="CornflowerBlue"/>
<Setter Property="Stretch" Value="Fill"/>
<Setter Property="Data">
<Setter.Value>
<RectangleGeometry Rect="10,10,10,10"/>
</Setter.Value>
</Setter>
</Style>
</syncfusion:ContainerHeaderViewModel.ShapeStyle>
</syncfusion:ContainerHeaderViewModel>
</syncfusion:ContainerViewModel.Header>
</syncfusion:ContainerViewModel>
UnitHeight
Gets or sets the height of the Container's header block.
Declaration
public double UnitHeight { get; set; }
Property Value
Type |
---|
System.Double |
UnitWidth
Gets or sets the width of the Container's header block.
Declaration
public double UnitWidth { get; set; }
Property Value
Type |
---|
System.Double |
Implements
System.ComponentModel.INotifyPropertyChanged