private void TileIntervalUpdate_Loaded(object sender, RoutedEventArgs e) { var savedInterval = BackgroundTasks.GetTileTaskInterval(); for (int i = 0; i < TileIntervalUpdate.Items.Count; i++) { var item = (ComboBoxItem)TileIntervalUpdate.Items[i]; var itemInterval = uint.Parse((string)item.Tag); if (itemInterval == savedInterval) { TileIntervalUpdate.SelectedIndex = i; break; } } }