Exemplo n.º 1
0
 public void SetCheckState(CheckboxState checkState)
 {
     CheckState = checkState;
     if (CheckedChanged != null)
     {
         CheckedChanged(this, new CheckedChangedEventArgs(CheckState == CheckboxState.Checked));
     }
     CheckView.SetNeedsDisplay();
 }
Exemplo n.º 2
0
        public void SetEnabled(bool enabled)
        {
            if (enabled)
            {
                TitleLabel.TextColor = LabelColor;
            }
            else
            {
                LabelColor = TitleLabel.TextColor;

                nfloat r, g, b, a;
                LabelColor.GetRGBA(out r, out g, out b, out a);
                r = NMath.Floor((nfloat)(r * 100.0 + 0.5)) / (nfloat)100.0;
                g = NMath.Floor((nfloat)(g * 100.0 + 0.5)) / (nfloat)100.0;
                b = NMath.Floor((nfloat)(b * 100.0 + 0.5)) / (nfloat)100.0;
                TitleLabel.TextColor = UIColor.FromRGBA(
                    (r + (nfloat)0.4),
                    (g + (nfloat)0.4),
                    (b + (nfloat)0.4),
                    (nfloat)1);
            }
            Enabled = enabled;
            CheckView.SetNeedsDisplay();
        }