コード例 #1
0
ファイル: Selector.cs プロジェクト: RUSshy/ultraviolet
        /// <summary>
        /// Called when the value of the <see cref="SelectedIndex"/> or <see cref="SelectedItem"/>
        /// dependency properties change.
        /// </summary>
        private static void HandleSelectedContainerChanged(Selector selector, DependencyObject container)
        {
            var item = selector.ItemContainerGenerator.ItemFromContainer(container);
            if (item == null)
                return;

            if (GetIsSelected(container))
                return;

            selector.BeginChangeSelection();

            selector.UnselectAllItems();
            selector.SelectItem(item);

            selector.EndChangeSelection();
        }
コード例 #2
0
            /// <summary>
            /// Initializes a new instance of the <see cref="SelectionCollection"/> class.
            /// </summary>
            /// <param name="owner">The <see cref="Selector"/> that owns this collection.</param>
            public SelectionCollection(Selector owner)
            {
                Contract.Require(owner, nameof(owner));

                this.owner = owner;
            }
コード例 #3
0
            /// <summary>
            /// Initializes a new instance of the <see cref="SelectionCollection"/> class.
            /// </summary>
            /// <param name="owner">The <see cref="Selector"/> that owns this collection.</param>
            public SelectionCollection(Selector owner)
            {
                Contract.Require(owner, "owner");

                this.owner = owner;
            }