WPF

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

    Show / Hide Table of Contents

    Class DomainUpDown

    DomainUpDown class that provides the UpDown control

    Inheritance
    System.Object
    DomainUpDown
    Namespace: Syncfusion.Windows.Shared
    Assembly: Syncfusion.Shared.Wpf.dll
    Syntax
    public class DomainUpDown : Control
    Remarks

    Represents an up-down control that displays string values.

    A DomainUpDown control displays a single string value that is selected from the collection of items by pressing the up or down buttons on keyboard or scrolling the mouse wheel. The user can also enter text in the control.

    To create a collection of items to display in the DomainUpDown control, user can add or remove the items individually by using the Add(String) and Remove(String) methods. This can be called in an event handler, such as the DomainUpDown event of a button.

    Examples

    This example shows how to create a DomainUpDown in XAML.

    <Window x:Class="WpfApplication10.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
    Title="Window1" Height="300" Width="300">
    <Grid>
    <syncfusion:DomainUpDown Name="domainUpDown1"/>
    </Grid>
    </Window>

    The following example shows how to create a DomainUpDown in C#.

    using System.Windows;
    using System.Windows.Controls;
    using Syncfusion.Windows.Tools.Controls;
    using Syncfusion.Windows.Tools;
    namespace UpDownControlSample
    {
        public partial class Window1 : Window
        {
            // Counter used for adding items
            int myCounter = 1;

    // Create a new instance of the UpDown DomainUpDown domainUpDown1 = new DomainUpDown();

    public Window1() { InitializeComponent();

    // Add UpDown to grid grid1.Children.Add( domainUpDown1 ); }

    private void AddItem_Click(object sender, RoutedEventArgs e) { // Add item to domainUpDown domainUpDown1.Add( "item " + myCounter.ToString() );

    // Increment the counter variable. myCounter++; } } }

    Constructors

    DomainUpDown()

    Initializes a new instance of the DomainUpDown class.

    Declaration
    public DomainUpDown()

    Fields

    AnimationShiftProperty

    Identifies AnimationShift dependency property.

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

    DEF_ANIMATION_SPEED

    Default animation speed of value change.

    Declaration
    protected const double DEF_ANIMATION_SPEED = 0.2
    Field Value
    Type Description
    System.Double

    m_downValue

    Command for down button.

    Declaration
    public static RoutedCommand m_downValue
    Field Value
    Type Description
    System.Windows.Input.RoutedCommand

    m_upValue

    Command for down button.

    Declaration
    public static RoutedCommand m_upValue
    Field Value
    Type Description
    System.Windows.Input.RoutedCommand

    ValueProperty

    Identifies Value dependency property.

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

    Properties

    AnimationShift

    Gets or sets the animation shift.

    Declaration
    public double AnimationShift { get; set; }
    Property Value
    Type Description
    System.Double

    The animation shift.

    Item[Int32]

    Gets the System.String at the specified index.

    Declaration
    public string this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index

    The index of the item

    Property Value
    Type Description
    System.String

    Index of the item

    Value

    Gets or sets the value of the control's value. This is a dependency property.

    Declaration
    public string Value { get; set; }
    Property Value
    Type Description
    System.String

    Type: System.String Default value is null.

    See Also
    System.String

    Methods

    Add(String)

    Adds the specified item to the collection.

    Declaration
    public int Add(string item)
    Parameters
    Type Name Description
    System.String item

    The item to add.

    Returns
    Type Description
    System.Int32

    The index at which the value has been added.

    AddRange(String[])

    Adds the elements of an System.Collections.ICollection to the end of the collection.

    Declaration
    public void AddRange(string[] range)
    Parameters
    Type Name Description
    System.String[] range

    The System.Collections.ICollection whose elements should be added to the end of the collection. It cannot be null itself, but it can contain elements that are null.

    Exceptions
    Type Condition
    System.ArgumentNullException

    range is null.

    OnApplyTemplate()

    Builds the current template's visual tree if necessary.

    Declaration
    public override void OnApplyTemplate()

    OnKeyDown(KeyEventArgs)

    Invoked when an unhandled System.Windows.Input.Keyboard.KeyDown�attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

    Declaration
    protected override void OnKeyDown(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.KeyEventArgs e

    The System.Windows.Input.KeyEventArgs that contains the event data.

    OnMouseWheel(MouseWheelEventArgs)

    Invoked when an unhandled System.Windows.Input.Mouse.MouseWheel�attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

    Declaration
    protected override void OnMouseWheel(MouseWheelEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseWheelEventArgs e

    The System.Windows.Input.MouseWheelEventArgs that contains the event data.

    OnValueChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises ValueChanged event.

    Declaration
    protected virtual void OnValueChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    The System.Windows.DependencyPropertyChangedEventArgs that contains the event data.

    Remove(String)

    Removes the first occurrence of a specific item from the collection.

    Declaration
    public void Remove(string item)
    Parameters
    Type Name Description
    System.String item

    The item to remove from the collection.

    RemoveAt(Int32)

    Removes item at the specified index from the collection.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the element to remove.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    Index is less than zero or index is equal to or greater than System.Collections.ArrayList.Count.

    Events

    ValueChanged

    Event that is raised when Value property is changed.

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