Skip to content

StringFormat does not apply in MultiSelectionComboBox selection #12

@ExLuzZziVo

Description

@ExLuzZziVo

Hi,

There is an issue with MultiSelectionComboBox: if I want to apply ItemStringFormat, it is only gets applied on items in dropdown, but not on items in combobox's total text field. Please, take a look at example screenshot

1

Steps to reproduce:

  1. Create ViewModel
public class ViewModel: INotifyPropertyChanged
{

        private ObservableCollection<DateTime> _dateTimes = new ObservableCollection<DateTime>() {DateTime.Now, new DateTime(2019, 4, 23)};
        public ObservableCollection<DateTime> DateTimes
        {
            get => _dateTimes;
            set
            {
                _dateTimes = value;
                OnPropertyChanged(nameof(DateTimes));
            }
        }
        
        [field: NonSerialized] public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
}
  1. Add MultiSelectionComboBox control to XAML and bind it to ViewModel
<timsWpfControls:MultiSelectionComboBox SelectionMode="Multiple" ItemsSource="{Binding DateTimes}" ItemStringFormat="{}{0:D}"/>
  1. Select all items and see the result

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions