Skip to end of metadata
Go to start of metadata

Remarks

UXClock is a lightweight analog clock control to display and edit time. UXClock uses UXClockHourHand, UXClockMinuteHand, and UXClockSecondHand to display the time and also edit the time. These hands can be drag and drop to change the time represented by UXClock.

You can use Value property to set the initial time in UXClock. UXClock will process the time part of the Value property to display the time.

View

Working with AutoUpdate Property and TickingMode Property

In UXClock, you can use AutoUpdate property to enable automatic update on UXClock value based on the current time. When this mode is enabled, UXClock will work like a general analog clock and the time will be automatically updated.

View

By default when auto update mode is enabled, UXClock will use the milisecond update to update its display. You can customize the ticking mode to Second using TickingMode property.

XAML

Definition

public class UXClock : ISControl

Summary

The following table summarizes the members exposed in this class.

Public Constructors

UXClock Constructor()Initializes a new instance of the UXClock class.

Public Properties

AMPMDesignatorMarginGets or sets the margin of AM/PM element.
AMPMDesignatorPositionGets or sets the position of AM/PM element.
AMPMDesignatorVisibilityGets or sets a value that determines the visibility of AM/PM element.
AutoUpdateGets or sets a value that determines whether the control should update the value to actual time.
AutoUpdateTimeoutGets or sets a value that determines the timeout for auto update feature.
ClockBackgroundEffectGets or sets the effect of clock background.
CultureGets or sets the culture for the time presenter.
EditingModeGets or sets a value that determines the behavior when the value is edited using command or drag drop.
IsEditableGets or sets a value that determines whether the clock is editable.
LongMarkerStyleGets or sets the style for each hour marker.
MarkersPaddingGets or sets the distance between outer circle and markers.
MarkersStyleSelectorGets or sets the markers style selector.
SecondHandVisibilityGets or sets the visibility of second hand element.
ShortMarkerStyleGets or sets the style for each minute marker.
TickingModeGets or sets a value that determines the ticking behavior when AutoUpdate is set to True.
TimeFormatGets or sets the time format for time presenter when IsEditable property is set to false.
ValueGets or sets the time value.
ValueModeGets or sets a value that determines the value changing behavior.

Protected Properties

ProductProduct Info.

Fields

AMPMDesignatorMarginPropertyIdentifies the AMPMDesignatorMargin dependency property.
AMPMDesignatorPositionPropertyIdentifies the AMPMDesignatorPosition dependency property.
AMPMDesignatorVisibilityPropertyIdentifies the AMPMDesignatorVisibility dependency property.
AutoUpdatePropertyIdentifies the AutoUpdate dependency property.
AutoUpdateTimeoutPropertyIdentifies the AutoUpdateTimeout dependency property.
ClockBackgroundEffectPropertyIdentifies the ClockBackgroundEffect dependency property.
CulturePropertyIdentifies the Culture dependency property.
EditingModePropertyIdentifies the EditingMode dependency property.
IsEditablePropertyIdentifies the IsEditable dependency property.
LongMarkerStylePropertyIdentifies the LongMarkerStyle dependency property.
MarkersPaddingPropertyIdentifies the MarkersPadding dependency property.
MarkersStyleSelectorPropertyIdentifies the MarkersStyleSelector dependency property.
SecondHandVisibilityPropertyIdentifies the SecondHandVisibility dependency property.
ShortMarkerStylePropertyIdentifies the ShortMarkerStyle dependency property.
TickingModePropertyIdentifies the TickingMode dependency property.
TimeFormatPropertyIdentifies the TimeFormat dependency property.
ValueModePropertyIdentifies the ValueMode dependency property.
ValuePropertyIdentifies the Value dependency property.

Public Methods

AttachEventHandlers()Attach built-in event handlers to control templates. Call this method if necessary.
DetachedEventHandlers()Detach built-in event handlers from control templates. Call this method if necessary.
Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
InitializeTemplates()Initializes control templates.
OnApplyTemplate()Builds the visual tree for the CallOut when a new template is applied.

Protected Methods

OnMouseLeftButtonDown(MouseButtonEventArgs)Called before the MouseLeftButtonDown event occurs.
OnMouseWheel(MouseWheelEventArgs)Provides handling for mouse wheel action.

Public Constructors

public UXClock()

Initializes a new instance of the UXClock class.

Public Properties

public Thickness AMPMDesignatorMargin { get; set; }

Gets or sets the margin of AM/PM element.

public Dock AMPMDesignatorPosition { get; set; }

Gets or sets the position of AM/PM element.

public Visibility AMPMDesignatorVisibility { get; set; }

Gets or sets a value that determines the visibility of AM/PM element.

public bool AutoUpdate { get; set; }

Gets or sets a value that determines whether the control should update the value to actual time.

public double AutoUpdateTimeout { get; set; }

Gets or sets a value that determines the timeout for auto update feature.

public Effect ClockBackgroundEffect { get; set; }

Gets or sets the effect of clock background.

public CultureInfo Culture { get; set; }

Gets or sets the culture for the time presenter.

public ClockEditingMode EditingMode { get; set; }

Gets or sets a value that determines the behavior when the value is edited using command or drag drop.

public bool IsEditable { get; set; }

Gets or sets a value that determines whether the clock is editable.

public Style LongMarkerStyle { get; set; }

Gets or sets the style for each hour marker.

public double MarkersPadding { get; set; }

Gets or sets the distance between outer circle and markers.

public StyleSelector MarkersStyleSelector { get; set; }

Gets or sets the markers style selector.

public Visibility SecondHandVisibility { get; set; }

Gets or sets the visibility of second hand element.

public Style ShortMarkerStyle { get; set; }

Gets or sets the style for each minute marker.

public ClockTickingMode TickingMode { get; set; }

Gets or sets a value that determines the ticking behavior when AutoUpdate is set to True.

public string TimeFormat { get; set; }

Gets or sets the time format for time presenter when IsEditable property is set to false.

public Nullable<DateTime> Value { get; set; }

Gets or sets the time value.

public ClockValueMode ValueMode { get; set; }

Gets or sets a value that determines the value changing behavior.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty AMPMDesignatorMarginProperty

Identifies the AMPMDesignatorMargin dependency property.

public static readonly DependencyProperty AMPMDesignatorPositionProperty

Identifies the AMPMDesignatorPosition dependency property.

public static readonly DependencyProperty AMPMDesignatorVisibilityProperty

Identifies the AMPMDesignatorVisibility dependency property.

public static readonly DependencyProperty AutoUpdateProperty

Identifies the AutoUpdate dependency property.

public static readonly DependencyProperty AutoUpdateTimeoutProperty

Identifies the AutoUpdateTimeout dependency property.

public static readonly DependencyProperty ClockBackgroundEffectProperty

Identifies the ClockBackgroundEffect dependency property.

public static readonly DependencyProperty CultureProperty

Identifies the Culture dependency property.

public static readonly DependencyProperty EditingModeProperty

Identifies the EditingMode dependency property.

public static readonly DependencyProperty IsEditableProperty

Identifies the IsEditable dependency property.

public static readonly DependencyProperty LongMarkerStyleProperty

Identifies the LongMarkerStyle dependency property.

public static readonly DependencyProperty MarkersPaddingProperty

Identifies the MarkersPadding dependency property.

public static readonly DependencyProperty MarkersStyleSelectorProperty

Identifies the MarkersStyleSelector dependency property.

public static readonly DependencyProperty SecondHandVisibilityProperty

Identifies the SecondHandVisibility dependency property.

public static readonly DependencyProperty ShortMarkerStyleProperty

Identifies the ShortMarkerStyle dependency property.

public static readonly DependencyProperty TickingModeProperty

Identifies the TickingMode dependency property.

public static readonly DependencyProperty TimeFormatProperty

Identifies the TimeFormat dependency property.

public static readonly DependencyProperty ValueModeProperty

Identifies the ValueMode dependency property.

public static readonly DependencyProperty ValueProperty

Identifies the Value dependency property.

Public Methods

public void AttachEventHandlers()

Attach built-in event handlers to control templates. Call this method if necessary.

public void DetachedEventHandlers()

Detach built-in event handlers from control templates. Call this method if necessary.

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void InitializeTemplates()

Initializes control templates.

public void OnApplyTemplate()

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

Protected Methods

protected void OnMouseLeftButtonDown(MouseButtonEventArgs e)

Called before the MouseLeftButtonDown event occurs.

Parameters

eThe data for the event.

 

protected void OnMouseWheel(MouseWheelEventArgs e)

Provides handling for mouse wheel action.

Parameters

eMouseWheel event args.
  • No labels