Example #1
0
        public void DoesAdvertiseSupportedEvents()
        {
            if (!ApiInformation.IsPropertyPresent("Windows.UI.Xaml.UIElement", "Interactions"))
            {
                Log.Warning("UIElement.Interactions not supported on this build.");
                return;
            }

            RunOnUIThread.Execute(() =>
            {
                var interaction     = new SliderInteraction();
                var supportedEvents = interaction.GetSupportedEvents();

                Verify.IsGreaterThan(supportedEvents.Count, 0);
            });
        }
Example #2
0
        public void ValidateDefaultValues()
        {
            if (!ApiInformation.IsPropertyPresent("Windows.UI.Xaml.UIElement", "Interactions"))
            {
                Log.Warning("UIElement.Interactions not supported on this build.");
                return;
            }

            RunOnUIThread.Execute(() =>
            {
                var interaction = new SliderInteraction();

                Verify.AreEqual(Orientation.Horizontal, interaction.Orientation);
                Verify.AreEqual(0.0, interaction.Minimum);
                Verify.AreEqual(100.0, interaction.Maximum);
                Verify.AreEqual(0.0, interaction.Position);
                Verify.AreEqual(1.0, interaction.SmallChange);
                Verify.AreEqual(10.0, interaction.LargeChange);
            });
        }
        public SliderInteractionPage()
        {
            this.InitializeComponent();

            HorizontalSliderInteraction = new SliderInteraction()
            {
                Minimum = 0,
                Maximum = 200 - 2 - 20 // Subtract 2x host border thickness and the width of the scrubber thumb
            };

            horizontalElement.Interactions.Add(HorizontalSliderInteraction);

            VerticalSliderInteraction = new SliderInteraction()
            {
                Orientation = Orientation.Vertical,
                Minimum     = 0,
                Maximum     = 200 - 2 - 20 // Subtract 2x host border thickness and the height of the scrubber thumb
            };

            verticalElement.Interactions.Add(VerticalSliderInteraction);
        }