I'm trying to change color of the rest of the text after a bullet "●". User writes some text in a TextBox's field and the result will be display in a TextBlock after clicking a Button (Button_Click Event). What am I doing wrong or missing right here?
TextBlock inputTxt = new TextBlock();
private void Button_Click(object sender, RoutedEventArgs e)
{
if (txtBox != null)
{
if (txtBox.Text.StartsWith("●"))
{
inputTxt.Text = txtBox.Text.Substring(2);
inputTxt.Foreground = Brushes.Blue;
txtBlock.Text = bullet + inputTxt.Text;
}
else txtBlock.Text = txtBox.Text;
}
}`
Thank you.
![1][1]
[1]: https://i.stack.imgur.com/9cCDj.png