コード例 #1
0
        /// <summary>
        /// Triggers the visual state changes and visual transitions
        /// to open or close the list to/from selection mode.
        /// </summary>
        private void TriggerSelection(SelectionEnabledState state)
        {
            IList <WeakReference> items = this.GetItemsInViewPort();

            //Only animate the containers in the view port.
            foreach (var i in items)
            {
                MultiselectItem item = (MultiselectItem)(((WeakReference)i).Target);
                item.State = state;
                item.UpdateVisualState(true);
            }

            Dispatcher.BeginInvoke(() =>
            {
                for (int j = 0; j < this.Items.Count; j++)
                {
                    MultiselectItem item = (MultiselectItem)ItemContainerGenerator.ContainerFromIndex(j);
                    if (item != null)
                    {
                        item.State = state;
                        item.UpdateVisualState(false);
                    }
                }
            });
        }
コード例 #2
0
ファイル: MyListBoxItem.cs プロジェクト: Makzz90/VKClient_re
 protected virtual void OnUnselected(RoutedEventArgs e)
 {
     if (this._parent != null)
     {
         return;
     }
     this.State = SelectionEnabledState.Closed;
     this.UpdateVisualState(true);
 }
コード例 #3
0
ファイル: MultiselectList.cs プロジェクト: JanJoris/VikingApp
        /// <summary>
        /// Triggers the visual state changes and visual transitions
        /// to open or close the list to/from selection mode.
        /// </summary>
        private void TriggerSelection(SelectionEnabledState state)
        {
            IList<WeakReference> items = this.GetItemsInViewPort();

            //Only animate the containers in the view port.
            foreach (var i in items)
            {
                MultiselectItem item = (MultiselectItem)(((WeakReference)i).Target);
                item.State = state;
                item.UpdateVisualState(true);
            }

            Dispatcher.BeginInvoke(() =>
            {
                for (int j = 0; j < this.Items.Count; j++)
                {
                    MultiselectItem item = (MultiselectItem)ItemContainerGenerator.ContainerFromIndex(j);
                    if (item != null)
                    {
                        item.State = state;
                        item.UpdateVisualState(false);
                    }
                }
            });
        }