コード例 #1
0
ファイル: RadClock.cs プロジェクト: Jamnine/OrmFrameEmpty
 internal void SelectItem(RadClockItem item)
 {
     if (item != null)
     {
         this.NotifyClockItemSelected(item);
         item.Focus();
     }
 }
コード例 #2
0
ファイル: ClockItem.cs プロジェクト: Jamnine/OrmFrameEmpty
        private static void OnSelectionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RadClockItem item = d as RadClockItem;

            if (item != null)
            {
                item.IsSelected = (bool)e.NewValue;
            }
        }
コード例 #3
0
ファイル: RadClock.cs プロジェクト: Jamnine/OrmFrameEmpty
        /// <summary>
        /// When overridden in a derived class, undoes the effects of the <see cref="M:System.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(System.Windows.DependencyObject,System.Object)"/> method.
        /// </summary>
        /// <param name="element">The container element.</param>
        /// <param name="item">The Item.</param>
        protected override void ClearContainerForItemOverride(DependencyObject element, object item)
        {
            RadClockItem clockItem = element as RadClockItem;

            if (clockItem != null)
            {
                clockItem.ClockControl = null;
            }
            base.ClearContainerForItemOverride(element, item);
        }
コード例 #4
0
ファイル: RadClock.cs プロジェクト: Jamnine/OrmFrameEmpty
        /// <summary>
        /// Prepares the specified element to display the specified item.
        /// </summary>
        /// <param name="element">Element used to display the specified item.</param>
        /// <param name="item">Specified item.</param>
        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            base.PrepareContainerForItemOverride(element, item);
            RadClockItem clockItem = element as RadClockItem;

            if (clockItem == null)
            {
                return;
            }

            clockItem.ClockControl = this;
            if (clockItem != item)
            {
                TimeSpan currentItem = TimeSpan.Parse(item.ToString());
                clockItem.Content = string.Format(string.Format(this.GetCultureToUse(), "{0:t}", DateTime.MinValue.Add(currentItem)));
            }
            StyleManager.SetThemeFromParent(clockItem, this);
        }
コード例 #5
0
ファイル: RadClock.cs プロジェクト: Jamnine/OrmFrameEmpty
        internal void NotifyClockItemSelected(RadClockItem clockItem)
        {
            if (this.SelectedClockItem != clockItem)
            {
                if (this.SelectedClockItem != null)
                {
                    this.SelectedClockItem.IsSelected = false;
                }
            }
            if (clockItem != null)
            {
                this.selectedClockItem = clockItem;
                clockItem.IsSelected   = true;


                this.SelectedTime = TimeSpan.Parse(clockItem.DataContext.ToString());
            }
        }
コード例 #6
0
ファイル: RadClock.cs プロジェクト: Jamnine/OrmFrameEmpty
        internal void ProcessItem(int itemIndex)
        {
            RadClockItem selectedItem = this.ItemContainerGenerator.ContainerFromIndex(itemIndex) as RadClockItem;

            this.SelectItem(selectedItem);
        }