Raghda Ramadan
Raghda Ramadan

Reputation: 11

Button Click window phone 8

I need to change button content when the button pressed but i call function open message box inside buttonClick so the content didn't apper untill the message box closed.

code sample:

private void B1_Click(object sender, RoutedEventArgs e)
    {
        B1.content="X";
        DisplayMessage();
    }

I want to show X befor message. I try to use MouseLeftButtonDown/Up but it didn't work.

Upvotes: 0

Views: 210

Answers (1)

Farhan Ghumra
Farhan Ghumra

Reputation: 15296

You can use delay to perform what you want.

private async void B1_Click(object sender, RoutedEventArgs e)
{
    B1.content="X";
    await Task.Delay(1000);     // 1000 is miliseconds
    DisplayMessage();
}

Upvotes: 1

Related Questions