Class GalleryItem
Represents gallery item class.
Namespace: Syncfusion.Windows.Tools.Controls
Assembly: Syncfusion.Tools.Wpf.dll
Syntax
[SkinType(SkinVisualStyle = Skin.Office2007Blue, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/Office2007BlueStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2007Black, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/Office2007BlackStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2007Silver, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/Office2007SilverStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2003, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/Office2003Style.xaml")]
[SkinType(SkinVisualStyle = Skin.ShinyBlue, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/ShinyBlueStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.ShinyRed, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/ShinyRedStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.SyncOrange, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/SyncOrangeStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Blend, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/BlendStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Default, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf;component/Controls/Gallery/Themes/Generic.xaml")]
[SkinType(SkinVisualStyle = Skin.Metro, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/MetroStyle.xaml")]
public class GalleryItem : ContentControl
Remarks
UI framework element based on System.Windows.Controls.ContentControl class. Control is used for content hosting.
Examples
This example shows how to create a GalleryItems in XAML.
<Window x:Class="Gallery.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Gallery" Height="300" Width="300">
<StackPanel HorizontalAlignment="Center">
<local:Gallery Name="gallery">
<local:GalleryGroup>
<local:GalleryItem Name="item">
</local:GalleryItem>
</local:GalleryGroup>
</local:Gallery>
</StackPanel>
</Window>
This example shows how to create a GalleryItem in C#.
using System.Windows;
using System.Windows.Controls;
namespace Sample1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
Gallery gallery = new Gallery();
stackPanel.Children.Add( gallery );
GalleryGroup group = new GalleryGroup();
gallery.Items.Add( group );
GalleryItem item = new GalleryItem();
group.Items.Add( item );
}
}
}
Constructors
GalleryItem()
Initializes a new instance of the GalleryItem class.
Declaration
public GalleryItem()
Fields
CaptionProperty
Identifies Caption dependency property.
Declaration
public static readonly DependencyProperty CaptionProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
DescriptionProperty
Identifies Description dependency property.
Declaration
public static readonly DependencyProperty DescriptionProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
DraggedEvent
Occurs when item is dragged.
Declaration
public static readonly RoutedEvent DraggedEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
HasFocusProperty
Identifies HasFocus dependency property.
Declaration
public static readonly DependencyProperty HasFocusProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
HeightProperty
Identifies
Declaration
public static readonly DependencyProperty HeightProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsAlwaysShownCaptionProperty
Identifies IsAlwaysShownCaption dependency property.
Declaration
public static readonly DependencyProperty IsAlwaysShownCaptionProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsDragOverProperty
Identifies IsDragOver dependency property.
Declaration
public static readonly DependencyProperty IsDragOverProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsSelectedChangedEvent
Occurs when IsSelected property is changed.
Declaration
public static readonly RoutedEvent IsSelectedChangedEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
IsSelectedProperty
Identifies IsSelected dependency property.
Declaration
public static readonly DependencyProperty IsSelectedProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
VisibilityChangedEvent
Occurs when System.Windows.UIElement.Visibility property is changed.
Declaration
public static readonly RoutedEvent VisibilityChangedEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
VisualModeProperty
Identifies VisualMode dependency property.
Declaration
public static readonly DependencyProperty VisualModeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
WidthProperty
Identifies
Declaration
public static readonly DependencyProperty WidthProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
Caption
Gets or sets the string value that represents caption of item. This is dependency property.
Declaration
public string Caption { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | Type: System.String Default value is empty string. |
CaptionAlignment
Gets or sets the value that represents alignment of caption in gallery item. This is dependency property.
Declaration
public CaptionAlignment CaptionAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| CaptionAlignment | Type: CaptionAlignment Default value is Top. |
Remarks
Alignment occurs only in Standard mode when IsAlwaysShownCaption is true. It doesn't affect captions in Detailed mode.
See Also
Description
Gets or sets the string value that represents description of item. This is dependency property.
Declaration
public string Description { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | Type: System.String Default value is empty string. |
DescriptionAlignment
Gets or sets the value that represents alignment of description in gallery item. This is dependency property.
Declaration
public CaptionAlignment DescriptionAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| CaptionAlignment | Type: CaptionAlignment Default value is Bottom. |
Remarks
Alignment occurs only in Standard mode when IsAlwaysShownCaption is true. It doesn't affect descriptions in Detailed mode.
See Also
HasFocus
Gets or sets a value indicating whether the item has focus.
Declaration
public bool HasFocus { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean True if item has focus, otherwise false. |
IsAlwaysShownCaption
Gets or sets a value indicating whether the caption and description always should be displayed.
This is dependency property.
Default value is False.
Declaration
public bool IsAlwaysShownCaption { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsDragOver
Gets or sets a value indicating whether some other item is dragging over it. This is a dependency property.
Declaration
public bool IsDragOver { get; protected set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean True if another item is dragging over it, otherwise false. |
IsSelected
Gets or sets a value indicating whether the item is selected. This is dependency property.
Declaration
public bool IsSelected { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean True if item is selected, otherwise false. |
VisualMode
Gets or sets the value that represents visual mode of item. This is dependency property.
Declaration
public GalleryVisualMode VisualMode { get; set; }
Property Value
| Type | Description |
|---|---|
| GalleryVisualMode | Type: GalleryVisualMode Default value is Standard. |
See Also
Methods
ArrangeOverride(Size)
Called to arrange and size the content of a System.Windows.Controls.Control object.
Declaration
protected override Size ArrangeOverride(Size arrangeBounds)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Size | arrangeBounds | The computed size that is used to arrange the content. |
Returns
| Type | Description |
|---|---|
| System.Windows.Size | The size of the control. |
MeasureOverride(Size)
Called to remeasure a control.
Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Size | constraint | The maximum size that the method can return. |
Returns
| Type | Description |
|---|---|
| System.Windows.Size | The size of the control, up to the maximum specified by |
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate.
Declaration
public override void OnApplyTemplate()
OnDragEnter(DragEventArgs)
Invoked when System.Windows.DragDrop.DragEnter is raised.
Declaration
protected override void OnDragEnter(DragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DragEventArgs | e | The instance that contains the event data. |
OnDragLeave(DragEventArgs)
Invoked when System.Windows.DragDrop.DragLeave is raised.
Declaration
protected override void OnDragLeave(DragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DragEventArgs | e | The instance that contains the event data. |
OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)
Invoked when System.Windows.Input.Keyboard.GotKeyboardFocus is raised.
Declaration
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyboardFocusChangedEventArgs | e | The instance that contains the event data. |
OnHasFocusChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises HasFocusChanged event.
Declaration
protected virtual void OnHasFocusChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)
Invoked when System.Windows.Input.Keyboard.LostKeyboardFocus is raised.
Declaration
protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyboardFocusChangedEventArgs | e | The instance that contains the event data. |
OnMouseDown(MouseButtonEventArgs)
Invoked when System.Windows.Input.Mouse.MouseDown event is raised.
Declaration
protected override void OnMouseDown(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The instance that contains the event data. |
OnMouseMove(MouseEventArgs)
Invoked when System.Windows.Input.Mouse.MouseMove event is raised.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseEventArgs | e | The instance that contains the event data. |
OnMouseUp(MouseButtonEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseUp is raised.
Declaration
protected override void OnMouseUp(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The MouseButtonEventArgs that contains the event data. |
OnQueryContinueDrag(QueryContinueDragEventArgs)
Invoked when System.Windows.DragDrop.QueryContinueDrag is raised.
Declaration
protected override void OnQueryContinueDrag(QueryContinueDragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.QueryContinueDragEventArgs | e | The instance that contains the event data. |
OnVisualParentChanged(DependencyObject)
Invoked when parent of item is changed
Declaration
protected override void OnVisualParentChanged(DependencyObject oldParent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyObject | oldParent | Dependency object which represents old parent. |
Events
CaptionChanged
Event that is raised when Caption property is changed.
Declaration
public event PropertyChangedCallback CaptionChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
DescriptionChanged
Event that is raised when Description property is changed.
Declaration
public event PropertyChangedCallback DescriptionChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
HasFocusChanged
Event that is raised when HasFocus property is changed
Declaration
public event PropertyChangedCallback HasFocusChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
HeightChanged
Event that is raised when
Declaration
public event PropertyChangedCallback HeightChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
IsAlwaysShownCaptionChanged
Event that is raised when IsAlwaysShownCaption property is changed
Declaration
public event PropertyChangedCallback IsAlwaysShownCaptionChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
IsSelectedChanged
Event that is raised when IsSelected property is changed.
Declaration
public event PropertyChangedCallback IsSelectedChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
VisibilityChanged
Event that is raised when System.Windows.Visibility property is changed
Declaration
public event PropertyChangedCallback VisibilityChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
VisualModeChanged
Event that is raised when VisualMode property is changed
Declaration
public event PropertyChangedCallback VisualModeChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
WidthChanged
Event that is raised when
Declaration
public event PropertyChangedCallback WidthChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |