private void UpdateButtonLabel(ToggleButton btn) { int iType = Convert.ToInt32(btn.Tag); QueueType type = (QueueType)iType; if (btn.IsChecked == true) { uint iCount = _sys.GetUnprocessedItemsCount(type); //int iCount = _sys.Items.Count(i => i.Queue.Type == type && !i.Processed); string count = string.Format("({0})", iCount); if (!(btn.Content as string).Contains(count)) { btn.Content = string.Concat(BUTTON_LABELS[iType], SPACE_SEPARATOR, count); } } else { btn.Content = BUTTON_LABELS[iType]; } }