Skip to end of metadata
Go to start of metadata

Remarks

UXTickBar will use the value of Minimum, Maximum, and LargeChange properties to calculate the number of tickbar items to be displayed.

The following example shows how to create a tick bar that renders five tickbar items that starts from 2 and ends at 10. The value of LargeChange property determines the position where each tickbar item will be rendered with respect of Minimum and Maximum value.

View

By default, as you can see in the above figure, the content of each tickbar item is generated automatically. Alternatively, you can specify custom content for each tick bar item by specifying the Items collection. Note that the number of items will still be determined by Minimum, Maximum, and LargeChange properties. This means, in order to achieve the same layout, you need to specify the same number of tickbar items with custom content.

The following example shows how to create a tick bar with custom content for each tick bar item.

View

Working with ContentVisibility Property

You can choose whether or not to show the content element only using ContentVisibility property.

The following example shows how to hide content element in UXTickBar.

View

 

Working with IsDirectionReversed Property and Orientation Property

You can specify the orientation of UXTickBar to Horizontal or Vertical using Orientation property. In horizontal UXTickBar, the tick bar items will be displayed from left to right. In vertical UXTickBar, the tick bar items will be displayed from bottom to top. Alternatively, you can set IsDirectionReversed property to reverse the direction of the increasing value. If IsDirectionReversed property is set to True, the tick bar items will be displayed from right to left in horizontal UXTickBar and from top to bottom in vertical UXTickBar.

View

Working with LargeChange Property, Maximum Property, Minimum Property and SmallChange Property

UXTickBar will use the value of Minimum, Maximum, and LargeChange properties to calculate the number of tickbar items to be displayed.

The following example shows how to create a tick bar that renders five tickbar items that starts from 2 and ends at 10. The value of LargeChange property determines the position where each tickbar item will be rendered with respect of Minimum and Maximum value.

View

Working with PointerPosition Property

By default, the width and height of the pointer element is 1 pixel and 5 pixel respectively. The pointer can be positioned to Top, Left, Bottom, or Right using PointerPosition property.

View

Working with PointerVisibility Property

You can choose whether or not to show the pointer element only using PointerVisibility property.

The following example shows how to hide pointer element in UXTickBar.

View

Working with TickFormat Property

When the tickbar items are generated automatically, UXTickBar will use the value of each tickbar item as the content of the item. You can set the format string of tickbar items' content using TickFormat property. You can apply the standard numeric format string to the content of the tickbar item. For more information on standard numeric format string, see Standards Numeric Format Strings.

The following example shows how to apply one digit decimal format string to the tickbar items.

View

Working with Ticks Property

By default, all tickbar items will be displayed in the calculated position based on the number of tickbar items and the available rendered area. In some cases, you might need to show some tickbar items and hide the others. In this case, you can specify which tickbar items to be displayed using Ticks property. For example, if you set Ticks property to 1, 5, 7, then the first, fifth, and seventh tickbar items will be displayed and the other tickbar items will be hidden.

XAML

Definition

public class UXTickBar : ISItemsControl

Summary

The following table summarizes the members exposed in this class.

Public Constructors

UXTickBar Constructor()Initializes a new instance of UXTickBar class.

Public Properties

ContentVisibilityGets or sets the visibility of tick bar item's content.
IsDirectionReversedGets or sets the direction of increasing value.
LargeChangeGets or sets a value used to calculate the placement of tick bar item in the tick bar. When tick bar is integrated to slider bar control, this property indicates a value to be added to or substracted from the value of the slider bar control.
MaximumGets or sets the highest possible value of the tick bar.
MinimumGets or sets the lowest possible value of the tick bar.
OrientationGets or sets the orientation of the tick bar.
PointerPositionGets or sets the pointer position of the tick bar.
PointerTemplateGets or sets the template of pointer element.
PointerVisibilityGets or sets the visibility of tick bar item's pointer.
SmallChangeGets or sets a value to be added to or susbtracted from the value of slider bar, when tick bar is integrated to a slider bar control.
TickBarItemsGets or sets the tick bar items. Use this property when you need to set the custom ticks from slider. If you want to change the items from UXTickBar use Items property directly.
TickFormatGets or sets the format string applied to the each tick bar item when they are generated automatically.
TicksGets or sets the position of the tick bar items to display in the tick bar.

Protected Properties

ProductProduct Info.

Fields

ContentVisibilityPropertyIdentifies the ContentVisibility dependency property.
IsDirectionReversedPropertyIdentifies the IsDirectionReversed dependency property.
LargeChangePropertyIdentifies the LargeChange dependency property.
MaximumPropertyIdentifies the Maximum dependency property.
MinimumPropertyIdentifies the Minimum dependency property.
OrientationPropertyIdentifies the Orientation dependency property.
PointerPositionPropertyIdentifies the PointerPosition dependency property.
PointerTemplatePropertyIdentifies the PointerTemplate dependency property.
PointerVisibilityPropertyIdentifies the PointerVisibility dependency property.
SmallChangePropertyIdentifies the SmallChange dependency property.
TickBarItemsPropertyIdentifies the TickBarItems dependency property.
TickFormatPropertyIdentifies the TickFormat dependency property.
TicksPropertyIdentifies the Ticks dependency property.

Public Methods

InitializeTemplates()Initializes the templates for tick bar.
OnApplyTemplate()Builds the visual tree for the UXTickBar when a new template is applied.

Protected Methods

GetContainerForItemOverride()Creates or identifies the element that is used to display the given item.
IsItemItsOwnContainerOverride(object)Determines if the specified item is (or is eligible to be) its own container.
MeasureOverride(Size)Provides the behavior for the Measure pass of Silverlight layout.
OnItemsChanged(NotifyCollectionChangedEventArgs)Called when the value of the System.Windows.Controls.ItemsControl.Items property changes.
PrepareContainerForItemOverride(DependencyObject, object)Prepares the specified element to display the specified item.

Public Constructors

public UXTickBar()

Initializes a new instance of UXTickBar class.

Public Properties

public Visibility ContentVisibility { get; set; }

Gets or sets the visibility of tick bar item's content.

public bool IsDirectionReversed { get; set; }

Gets or sets the direction of increasing value.

public double LargeChange { get; set; }

Gets or sets a value used to calculate the placement of tick bar item in the tick bar. When tick bar is integrated to slider bar control, this property indicates a value to be added to or substracted from the value of the slider bar control.

public double Maximum { get; set; }

Gets or sets the highest possible value of the tick bar.

public double Minimum { get; set; }

Gets or sets the lowest possible value of the tick bar.

public Orientation Orientation { get; set; }

Gets or sets the orientation of the tick bar.

public PointerPosition PointerPosition { get; set; }

Gets or sets the pointer position of the tick bar.

public DataTemplate PointerTemplate { get; set; }

Gets or sets the template of pointer element.

Remarks

You can use PointerTemplate property to fully customize the appearance of the pointer. For more information on how to customize the pointer appearance using PointerTemplate, see How-to: Customize Pointer Element in UXTickBar.

 

public Visibility PointerVisibility { get; set; }

Gets or sets the visibility of tick bar item's pointer.

public double SmallChange { get; set; }

Gets or sets a value to be added to or susbtracted from the value of slider bar, when tick bar is integrated to a slider bar control.

public UXTickBarItemCollection TickBarItems { get; set; }

Gets or sets the tick bar items. Use this property when you need to set the custom ticks from slider. If you want to change the items from UXTickBar use Items property directly.

public string TickFormat { get; set; }

Gets or sets the format string applied to the each tick bar item when they are generated automatically.

public DoubleCollection Ticks { get; set; }

Gets or sets the position of the tick bar items to display in the tick bar.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty ContentVisibilityProperty

Identifies the ContentVisibility dependency property.

public static readonly DependencyProperty IsDirectionReversedProperty

Identifies the IsDirectionReversed dependency property.

public static readonly DependencyProperty LargeChangeProperty

Identifies the LargeChange dependency property.

public static readonly DependencyProperty MaximumProperty

Identifies the Maximum dependency property.

public static readonly DependencyProperty MinimumProperty

Identifies the Minimum dependency property.

public static readonly DependencyProperty OrientationProperty

Identifies the Orientation dependency property.

public static readonly DependencyProperty PointerPositionProperty

Identifies the PointerPosition dependency property.

public static readonly DependencyProperty PointerTemplateProperty

Identifies the PointerTemplate dependency property.

public static readonly DependencyProperty PointerVisibilityProperty

Identifies the PointerVisibility dependency property.

public static readonly DependencyProperty SmallChangeProperty

Identifies the SmallChange dependency property.

public static readonly DependencyProperty TickBarItemsProperty

Identifies the TickBarItems dependency property.

public static readonly DependencyProperty TickFormatProperty

Identifies the TickFormat dependency property.

public static readonly DependencyProperty TicksProperty

Identifies the Ticks dependency property.

Public Methods

public void InitializeTemplates()

Initializes the templates for tick bar.

public void OnApplyTemplate()

Builds the visual tree for the UXTickBar when a new template is applied.

Protected Methods

protected DependencyObject GetContainerForItemOverride()

Creates or identifies the element that is used to display the given item.

Return Types

The element that is used to display the given item.

 

protected bool IsItemItsOwnContainerOverride(object item)

Determines if the specified item is (or is eligible to be) its own container.

Parameters

itemThe item to check.

Return Types

true if the item is (or is eligible to be) its own container; otherwise, false.

 

protected Size MeasureOverride(Size finalSize)

Provides the behavior for the Measure pass of Silverlight layout.

Parameters

finalSizeThe available size that this object can give to child objects. Infinity can be specified as a value to indicate that the object will size to whatever content is available.

Return Types

The size that this object determines it needs during layout, based on its calculations of child object allotted sizes.

 

protected void OnItemsChanged(NotifyCollectionChangedEventArgs e)

Called when the value of the System.Windows.Controls.ItemsControl.Items property changes.

Parameters

eNotifyCollectionChangedEventArgs that contains the event data

 

protected void PrepareContainerForItemOverride(DependencyObject element, object item)

Prepares the specified element to display the specified item.

Parameters

elementThe container element used to display the specified item.
itemThe item to display.

  • No labels