vain0x / DotNetKit.Wpf.AutoCompleteComboBox

ComboBox with filtering (auto-complete) for WPF
MIT License
71 stars 25 forks source link

downloaded code, compiled and ran it. Couldn't get it to work At All. Depending on what is typed the combo either shows all the names or none of them. #6

Closed jbesemer closed 6 years ago

croddin commented 6 years ago

It looks like this is because in the demo program the whole list of persons is stored in one person object because of a line endings issue. In person.cs Environment.NewLine is used but the file has \n line endings instead of \r\n.

To fix the demo, change the code that defines allPersons in: DotNetKit.Wpf.AutoCompleteComboBox.Demo\Data\Person.cs

to

static readonly IReadOnlyList<Person> allPersons =
            source.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.RemoveEmptyEntries)
            .Select((name, i) => new Person(i + 1L, name))
            .ToArray();

I can send a pull request if this is being maintained.

jbesemer commented 6 years ago

Works great. Thanks.

On Fri, Oct 12, 2018 at 8:43 PM vain0x notifications@github.com wrote:

Closed #6 https://github.com/vain0x/DotNetKit.Wpf.AutoCompleteComboBox/issues/6 via f3fa020 https://github.com/vain0x/DotNetKit.Wpf.AutoCompleteComboBox/commit/f3fa0203444c4a96983b655b2620848c49f46cb7 .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vain0x/DotNetKit.Wpf.AutoCompleteComboBox/issues/6#event-1901992599, or mute the thread https://github.com/notifications/unsubscribe-auth/AMvNrSeNpmjD4CiSJ8bFtKR-pvS1gLPLks5ukWFxgaJpZM4SBKRo .