Created
June 11, 2012 09:13
-
-
Save biac/2909212 to your computer and use it in GitHub Desktop.
Kujian - SplitPage.xaml.cs (STOP ボタン)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async void Button_Click_2(object sender, RoutedEventArgs e) | |
{ | |
_isContinue = false; | |
while (!_isBreaking) | |
await Task.Delay(50); | |
itemListView.Background = new SolidColorBrush(Colors.DarkGray); | |
int remain = 5000; | |
int span = 50; | |
var rnd = new Random(); | |
while(remain > 0) | |
{ | |
await Task.Delay(span); | |
SelectNext(); | |
remain -= span; | |
span = (int)(span * (1.0 + rnd.NextDouble())); | |
} | |
// ここで音を出したかった!! | |
var orgColor = itemListView.Background; | |
var hiColor = new SolidColorBrush(Colors.Red); | |
for (int i = 0; i < 3; i++) | |
{ | |
itemListView.Background = orgColor; | |
await Task.Delay(150); | |
itemListView.Background = hiColor; | |
await Task.Delay(150); | |
} | |
itemListView.Background = new SolidColorBrush(Colors.WhiteSmoke); | |
_isBreaking = false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment