BlipFace.View.StatusListControl.tbMessage_TextChanged C# (CSharp) Method

tbMessage_TextChanged() private method

Służy tylko do wyliczania ilości znaków pozostałych do wpisania
private tbMessage_TextChanged ( object sender, System.Windows.Controls.TextChangedEventArgs e ) : void
sender object
e System.Windows.Controls.TextChangedEventArgs
return void
        private void tbMessage_TextChanged(object sender, TextChangedEventArgs e)
        {
            int charLeft = presenter.CountChars(tbMessage.Text);

            if (charLeft < 0)
            {
                tblCharLeft.Foreground = new SolidColorBrush(Color.FromRgb(200, 100, 100));
                btnSendBlip.IsEnabled = false;
            }
            else if (charLeft == 0)
            {
                tblCharLeft.Foreground = new SolidColorBrush(Color.FromRgb(120, 180, 120));
                btnSendBlip.IsEnabled = true;
            }
            else
            {
                tblCharLeft.Foreground = new SolidColorBrush(Color.FromRgb(160, 160, 160));
                btnSendBlip.IsEnabled = true;
            }

            tblCharLeft.Text = charLeft.ToString();
        }