示例#1
0
        /// <summary>
        /// Actualiza la vista de los circuitos cargados en la aplicación
        /// </summary>
        public void Refresh()
        {
            this.listOfCircuits.ItemsSource = ComponentsUtils.GetComponentsWithCircuits();
            CollectionView           view    = (CollectionView)CollectionViewSource.GetDefaultView(this.listOfCircuits.ItemsSource);
            PropertyGroupDescription groupBy = new PropertyGroupDescription("CtoFormat");

            view.GroupDescriptions.Add(groupBy);
            IsRefreshed?.Invoke(this, new RoutedEventArgs());
        }
        /// <summary>
        /// Maneja el evento que realizá la carga inicial del control
        /// </summary>
        /// <param name="sender">La fuente del evento.</param>
        /// <param name="e">Los argumentos de tipo <see cref="RoutedEventArgs"/> que contienen la información del evento.</param>
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            this.Filter = UpdateFilter();
            var items = ComponentsUtils.GetGallery();

            this.listOfComponents.ItemsSource = items;
            CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(this.listOfComponents.ItemsSource);

            view.Filter = ComponentFilter;
            if (this.listOfComponents.Items.Count > 0)
            {
                this.listOfComponents.SelectedIndex = 0;
            }
        }