Beispiel #1
0
        /// <summary> Событие клика по "шапке" в элементе list-a для сворачивания и разворачивания номеров </summary>
        private void ListBoxElementHeaderClick(object sender, RoutedEventArgs e)
        {
            var item = sender as Button;

            if (item != null)
            {
                var currentContact = item.DataContext as ExtendedModelContact;
                if (currentContact != null)
                {
                    if (!currentContact.IsExpand)
                    {
                        var expandedContacts = CurrentListModelContact.Where(a => a.IsExpand);
                        foreach (var contact in expandedContacts)
                        {
                            contact.IsExpand = false;
                        }
                        currentContact.IsExpand = true;
                        _currentExpandContact   = currentContact.ModelContactObj;
                        ChengeContactStatus(_currentExpandContact);
                    }
                    else
                    {
                        currentContact.IsExpand = false;
                        _currentExpandContact   = null;
                    }
                }
            }
        }
        /// <summary> Сортировка контактов </summary>
        private void ListModelContactSort()
        {
            // тут сделать сортировку в зависимости от языка + добавить в обработчик изменения языка

            CurrentListModelContact.Sort((modelContact1, modelContact2) => String.Compare(modelContact1.FullName, modelContact2.FullName, StringComparison.InvariantCultureIgnoreCase));
        }