示例#1
0
        /// <summary>
        /// Creates an initialized instance of a
        /// <strong><see cref="ListBoxStateMachine"/></strong> object with the specified parameters.
        /// </summary>
        /// <param name="controller">The <strong>UIController</strong> object that dispatches hit testing.</param>
        /// <param name="numberOfPixelsInHorizontalAxis">
        /// The number of pixels that this control occupies horizontally.
        /// For more information, see <strong><see cref="P:CoreInteractionFramework.UIElementStateMachine.NumberOfPixelsInHorizontalAxis">
        /// NumberOfPixelsInHorizontalAxis</see></strong>.
        /// </param>
        /// <param name="numberOfPixelsInVerticalAxis">
        /// The number of pixels that this control occupies vertically.
        /// For more information, see <strong><see cref="P:CoreInteractionFramework.UIElementStateMachine.NumberOfPixelsInVerticalAxis">
        /// NumberOfPixelsInVerticalAxis</see></strong>.
        /// </param>
        public ListBoxStateMachine(UIController controller,
                                   int numberOfPixelsInHorizontalAxis,
                                   int numberOfPixelsInVerticalAxis)
            : base(controller, numberOfPixelsInHorizontalAxis, numberOfPixelsInVerticalAxis)
        {
            scrollAdapter = new ScrollAdapter(controller, this);
            scrollAdapter.ViewportChanged += OnScrollAdapterViewportChanged;

            ListBoxMode = ListBoxMode.Selection;

            // Create container objects.
            items = new ListBoxStateMachineItemCollection(this);
            selectedItems = new ListBoxStateMachineItemCollection(this);
            contactTargetEventContactIds = new Dictionary<int, ContactTargetEvent>();
            capturedItemContactIds = new Dictionary<int, ListBoxStateMachineItem>();

            items.ListBoxItemRemoved += OnListBoxItemRemoved;
            items.ListBoxItemAdded += OnListBoxItemAdded;

            selectedItems.ListBoxItemAdded += OnSelectedItemsListBoxItemAdded;
            selectedItems.ListBoxItemRemoved += OnSelectedItemsListBoxItemRemoved;
        }
 /// <summary>
 /// Creates a new <strong><see cref="ScrollViewerStateMachine"/></strong> instance
 /// with the specified parameters.
 /// </summary>
 /// <param name="controller">The <strong>UIController</strong> object that dispatches hit testing.</param>
 /// <param name="numberOfPixelsInHorizontalAxis">
 /// The number of pixels that this control occupies horizontally. 
 /// For more information, see 
 /// <strong><see cref="P:CoreInteractionFramework.UIElementStateMachine.NumberOfPixelsInHorizontalAxis">NumberOfPixelsInHorizontalAxis</see></strong>.
 /// </param>
 /// <param name="numberOfPixelsInVerticalAxis">
 /// The number of pixels that this control occupies vertically. 
 /// For more information, see 
 /// <strong><see cref="P:CoreInteractionFramework.UIElementStateMachine.NumberOfPixelsInVerticalAxis">NumberOfPixelsInVerticalAxis</see></strong>.
 /// </param>
 public ScrollViewerStateMachine(UIController controller, int numberOfPixelsInHorizontalAxis, int numberOfPixelsInVerticalAxis)
     : base(controller, numberOfPixelsInHorizontalAxis, numberOfPixelsInVerticalAxis)
 {
     scrollAdapter = new ScrollAdapter(controller, this);
     scrollAdapter.ViewportChanged += new EventHandler(OnViewportChanged);
 }