WPF

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GalleryItem

    Show / Hide Table of Contents

    Class GalleryItem

    Represents gallery item class.

    Inheritance
    System.Object
    GalleryItem
    ItemWindow
    Namespace: Syncfusion.Windows.Tools.Controls
    Assembly: Syncfusion.Tools.Wpf.dll
    Syntax
    [SkinType(SkinVisualStyle = Skin.Office2003, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/Office2003Style.xaml")]
    [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.SyncOrange, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/SyncOrangeStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Metro, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/MetroStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.ShinyRed, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/ShinyRedStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.ShinyBlue, Type = typeof(GalleryItem), XamlResource = "/Syncfusion.Tools.Wpf.Classic;component/Controls/Gallery/Themes/ShinyBlueStyle.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")]
    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 Description
    System.Windows.DependencyProperty

    DescriptionProperty

    Identifies Description dependency property.

    Declaration
    public static readonly DependencyProperty DescriptionProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    DraggedEvent

    Occurs when item is dragged.

    Declaration
    public static readonly RoutedEvent DraggedEvent
    Field Value
    Type Description
    System.Windows.RoutedEvent

    HasFocusProperty

    Identifies HasFocus dependency property.

    Declaration
    public static readonly DependencyProperty HasFocusProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    HeightProperty

    Identifies dependency property.

    Declaration
    public static readonly DependencyProperty HeightProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    IsAlwaysShownCaptionProperty

    Identifies IsAlwaysShownCaption dependency property.

    Declaration
    public static readonly DependencyProperty IsAlwaysShownCaptionProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    IsDragOverProperty

    Identifies IsDragOver dependency property.

    Declaration
    public static readonly DependencyProperty IsDragOverProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    IsSelectedChangedEvent

    Occurs when IsSelected property is changed.

    Declaration
    public static readonly RoutedEvent IsSelectedChangedEvent
    Field Value
    Type Description
    System.Windows.RoutedEvent

    IsSelectedProperty

    Identifies IsSelected dependency property.

    Declaration
    public static readonly DependencyProperty IsSelectedProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    VisibilityChangedEvent

    Occurs when System.Windows.UIElement.Visibility property is changed.

    Declaration
    public static readonly RoutedEvent VisibilityChangedEvent
    Field Value
    Type Description
    System.Windows.RoutedEvent

    VisualModeProperty

    Identifies VisualMode dependency property.

    Declaration
    public static readonly DependencyProperty VisualModeProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    WidthProperty

    Identifies dependency property.

    Declaration
    public static readonly DependencyProperty WidthProperty
    Field Value
    Type Description
    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
    GalleryVisualMode

    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
    GalleryVisualMode

    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. Type: System.Boolean

    Default value is False.

    Declaration
    public bool IsAlwaysShownCaption { get; set; }
    Property Value
    Type Description
    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
    GalleryVisualMode

    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 constraint.

    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 Description
    System.Windows.PropertyChangedCallback

    DescriptionChanged

    Event that is raised when Description property is changed.

    Declaration
    public event PropertyChangedCallback DescriptionChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    HasFocusChanged

    Event that is raised when HasFocus property is changed

    Declaration
    public event PropertyChangedCallback HasFocusChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    HeightChanged

    Event that is raised when property is changed.

    Declaration
    public event PropertyChangedCallback HeightChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    IsAlwaysShownCaptionChanged

    Event that is raised when IsAlwaysShownCaption property is changed

    Declaration
    public event PropertyChangedCallback IsAlwaysShownCaptionChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    IsSelectedChanged

    Event that is raised when IsSelected property is changed.

    Declaration
    public event PropertyChangedCallback IsSelectedChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    VisibilityChanged

    Event that is raised when System.Windows.Visibility property is changed

    Declaration
    public event PropertyChangedCallback VisibilityChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    VisualModeChanged

    Event that is raised when VisualMode property is changed

    Declaration
    public event PropertyChangedCallback VisualModeChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    WidthChanged

    Event that is raised when property is changed.

    Declaration
    public event PropertyChangedCallback WidthChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved