Ejemplo n.º 1
0
        void PrepareData()
        {
            BuildColorPallete();

            DrawingImage = new ImageWithTouch
            {
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor   = Color.White,
                CurrentLineColor  = Color.Black
            };

            DrawingImage.SetBinding(ImageWithTouch.CurrentLineColorProperty, "CurrentLineColor");
            myFrame.Content = DrawingImage;
            foreach (var button in ColorPallete.Select(color => new Button
            {
                Text = color.Key,
                TextColor = GetTextColor(color.Value),
                BackgroundColor = color.Value,
                HeightRequest = 40,
                WidthRequest = 100,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand
            }))
            {
                button.Clicked += Button_Clicked;
                listColors.Children.Add(button);
            }
        }
Ejemplo n.º 2
0
        public SignatureViewModel()
        {
            DrawingImage = new ImageWithTouch
            {
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor   = Color.White,
                CurrentLineColor  = Color.Black
            };

            DrawingImage.SetBinding(ImageWithTouch.CurrentLineColorProperty, "CurrentLineColor");
        }