コード例 #1
0
        public async Task StrokeColorInitializesCorrectly()
        {
            var xplatStrokeColor = Colors.CadetBlue;

            var imageButton = new ImageButtonStub
            {
                Height          = 50,
                Width           = 100,
                StrokeThickness = 2,
                StrokeColor     = xplatStrokeColor
            };

            var expectedValue = xplatStrokeColor.ToPlatform();

            var values = await GetValueAsync(imageButton, (handler) =>
            {
                return(new
                {
                    ViewValue = imageButton.StrokeColor,
                    PlatformViewValue = GetNativeStrokeColor(handler)
                });
            });

            Assert.Equal(xplatStrokeColor, values.ViewValue);
            Assert.Equal(expectedValue, values.PlatformViewValue);
        }
コード例 #2
0
        public async Task ClipImageButtonWithBackgroundWorks()
        {
            Color expected = Colors.Yellow;

            var brush = new LinearGradientPaintStub(Colors.Blue, expected);

            var imageButton = new ImageButtonStub
            {
                Background = brush,
                Clip       = new EllipseShapeStub()
            };

            await ValidateHasColor(imageButton, expected);
        }