Exemple #1
0
            private void CheckedChanged(object sender, EventArgs e)
            {
                ToolStripMenuItem Item = (ToolStripMenuItem)sender;

                if (Item.Checked)
                {
                    for (int i = 0; i < Items.Length; i++)
                    {
                        if (Item.GetHashCode() != Items[i].GetHashCode())
                        {
                            Items[i].Checked = false;
                        }
                        else
                        {
                            CheckedChange?.Invoke(this, new EventArgs());
                        }
                    }
                }
                else
                {
                    bool HaveSelection = false;
                    for (int i = 0; i < Items.Length; i++)
                    {
                        if (Items[i].Checked)
                        {
                            HaveSelection = true;
                        }
                    }
                    if (!HaveSelection)
                    {
                        Item.Checked = true;
                    }
                }
            }
 void OnCheckBoxTapped(object sender, EventArgs args)
 {
     IsChecked = !IsChecked;
     if (!_enModositok)
     {
         CheckedChange?.Invoke(this, IsChecked);
     }
     //_myIschecked = !_myIschecked;
     //IsChecked =_myIschecked  ;
     //boxLabel.Text = (bool)_myIschecked ? "⚫" : "⚪";
 }
Exemple #3
0
 protected virtual void OnCheckedChange(EventArgs e)
 {
     if (Checked)
     {
         CheckImage.Source = CheckedImage;
     }
     else
     {
         CheckImage.Source = UnCheckedImage;
     }
     CheckedChange?.Invoke(this, e);
 }
Exemple #4
0
 protected void Radio_Tapped(object sender, EventArgs e)
 {
     if (this.Checked == false)
     {
         foreach (View item in ((Layout <View>)RadioTableView.Parent.Parent).Children)
         {
             if (item is RadioButton)
             {
                 RadioButton rb = (RadioButton)item;
                 if (rb.GroupName == this.GroupName && rb != sender)
                 {
                     rb.Checked = false;
                 }
             }
         }
         this.Checked = true;
         CheckedChange?.Invoke(this, e);
     }
 }
Exemple #5
0
        /*public bool _myIschecked;
         * public bool myIschecked
         * {
         *  get { return _myIschecked; }
         *  set
         *  {
         *      this._myIschecked = value;
         *      boxLabel.Text = (bool)_myIschecked ? "⚫" : "⚪";
         *      //CheckedChange?.Invoke(this, (bool)_myIschecked);
         *
         *      //myFrame.BackgroundColor = _myIschecked ? Color.White : Color.Aqua;
         *      //myFrame.CornerRadius = _myIschecked ? 0 : 20;
         *  }
         *
         * }*/

        private void rb_CheckedChange(object sender, bool e)
        {
            //throw new NotImplementedException();
            int idx = 0;

            foreach (var item in listCheckbox)
            {
                idx++;
                if (item.Id == ((RadioButton)sender).Id)
                {
                    _Value           = idx;
                    item.myIschecked = true;
                }
                else
                {
                    item.myIschecked = false;
                }
            }
            CheckedChange?.Invoke(this, (int)Value);
            //Debug.WriteLine("Nyomi:" + ((RadioButton)sender).Text);
        }
Exemple #6
0
 protected virtual void OnCheckedChange(EventArgs e)
 {
     CheckedChange?.Invoke(this, e);
 }