[SOLVED] Sort not working

Please report bugs here. If you are unsure whether something is a bug or an expected behavior, please post it on the "Technical Support" forum instead, and wait for a moderator to handle/move the post.
TobiasDonaubauer
Posts: 12
Joined: Wed Nov 04, 2015 5:29 am

[SOLVED] Sort not working

Postby TobiasDonaubauer » Sun Dec 13, 2015 9:21 pm

The following code is working in simulator but not in browser:

Helper Class

Code: Select all

   public class SitebarItem : IComparable<SitebarItem>
    {
        public string Text { get; set; }
        public object Tag { get; set; }

        public SitebarItem()
        {
            Text = "";
        }

        public SitebarItem(string text, object tag)
        {
            Text = text;
            Tag = tag;
        }

        public int CompareTo(SitebarItem other)
        {
            return Text.CompareTo(other.Text);
        }
    }



Sort code

Code: Select all

            List<SitebarItem> test = new List<SitebarItem>();
            test.Add(new SitebarItem("B", "B"));
            test.Add(new SitebarItem("A", "A"));
            test.Sort();
            string first = test[0].Text;


BUG
first is 'B', but it should be 'A'. Works fine in simulator

JS-Support
Site Admin
Posts: 678
Joined: Tue Apr 08, 2014 3:42 pm

Re: Sort not working

Postby JS-Support » Wed Dec 16, 2015 6:23 am

Thank you for reporting this bug. We are going to look into is asap.

Regards,
JS-Support

JS-Support
Site Admin
Posts: 678
Joined: Tue Apr 08, 2014 3:42 pm

Re: Sort not working

Postby JS-Support » Sun Sep 25, 2016 11:50 pm

Hi,

The issue has been fixed in Beta 9.4, which you can download from the following URL:

http://forums.cshtml5.com/viewforum.php?f=6

Thanks.
Regards,
JS-Support


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest