Skip to content

Instantly share code, notes, and snippets.

@biac
Created June 11, 2012 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biac/2909194 to your computer and use it in GitHub Desktop.
Save biac/2909194 to your computer and use it in GitHub Desktop.
Kujian - SplitPage.xaml.cs (START ボタン)
private void Button_Click_1(object sender, RoutedEventArgs e)
{
itemListView.Background = backButton.Background;
Rotate();
}
private bool _isContinue;
private bool _isBreaking;
private async void Rotate() {
_isContinue = true;
while (_isBreaking)
await Task.Delay(50);
while (_isContinue)
{
SelectNext();
await Task.Delay(50);
}
_isBreaking = true;
}
private void SelectNext()
{
var lv = this.itemListView;
int nextIndex = lv.SelectedIndex + 1;
if (nextIndex >= lv.Items.Count)
nextIndex = 0;
lv.SelectedIndex = nextIndex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment