예제 #1
0
        private static void TransferItems(MetroComboBox source, MetroComboBox target)
        {
            if (source.Items.Count == 0)
            {
                return;
            }

            var selectedItem = source.SelectedItem;

            source.SelectedItem = null;
            for (int i = source.Items.Count - 1; i >= 0; i--)
            {
                var item = source.Items[i];
                source.Items.Remove(item);
                target.Items.Add(item);
            }
            target.SelectedItem = selectedItem;
        }
예제 #2
0
 private void ApplyFrozenImageToClone(MetroComboBox clone)
 {
     // Without the dispatch, the image doesn't show up.
     Dispatcher.BeginInvoke(new Action <MetroComboBox, MetroComboBox>(ApplyFrozenImage), DispatcherPriority.ContextIdle, this, clone);
 }