Esempio n. 1
0
        /// <summary>
        /// we will draw one column at a time
        ///
        ///
        /// x
        /// layer
        /// last increase will be y
        /// </summary>
        public void Sort()
        {
            Platforms = Platforms.OrderByDescending(a => a.layer).ToList();
            Platforms = Platforms.OrderBy(a => a.x).ToList();

            // y form 0..1..2..etc
            Platforms = Platforms.OrderBy(a => a.y).ToList();
        }
Esempio n. 2
0
 private void PlatformComboBox_DropDownClosed(object sender, EventArgs e)
 {
     if (sender is ComboBox comboBox)
     {
         comboBox.Items.Clear();
         foreach (var checkbox in Platforms.OrderByDescending(cb => cb.IsChecked).ThenBy(o => (string)o.Content))
         {
             bool found = ((string)checkbox.Content).ToLower().Contains(comboBox.Text.ToLower());
             if (string.IsNullOrEmpty(comboBox.Text) || found)
             {
                 comboBox.Items.Add(checkbox);
             }
         }
     }
 }