Beispiel #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            uIColors.Add(UIColor.Black);
            uIColors.Add(UIColor.DarkGray);
            uIColors.Add(UIColor.LightGray);
            uIColors.Add(UIColor.White);
            uIColors.Add(UIColor.Blue);
            uIColors.Add(UIColor.Red);
            uIColors.Add(UIColor.Yellow);
            uIColors.Add(UIColor.Magenta);
            uIColors.Add(UIColor.Green);
            uIColors.Add(UIColor.Cyan);

            BrushColor.ThumbTintColor = uIColors[selectedColor];

            undoBT.TouchUpInside += (sender, e) =>
            {
                DrawView.Undoline();
            };
            ClearBT.TouchUpInside += (sender, e) =>
            {
                DrawView.Clear();
            };

            BrushColor.ValueChanged += (sender, e) =>
            {
                if (BrushColor.Value > 0)
                {
                    selectedColor             = (int)Math.Ceiling(BrushColor.Value / BrushColor.MaxValue * uIColors.Count - 1);
                    BrushColor.ThumbTintColor = uIColors[selectedColor];
                }
            };
            BrushSize.TouchUpInside += (sender, e) =>
            {
                infoBrushSize.Hidden = true;
            };
            BrushSize.ValueChanged += (sender, e) =>
            {
                infoBrushSize.Text   = ((int)BrushSize.Value).ToString();
                infoBrushSize.Hidden = false;
            };
        }