Example #1
0
        protected override void ControllerPropertyChangedHandler(object sender, PropertyChangedEventArgs args)
        {
            if (sender == m_controller)
            {
                if (args.PropertyName == nameof(FileSystemController.Directories))
                {
                    m_fileSystemEntryItemsControl.ItemsSource = GetFileSystemEntryItems();

                    if (m_controller.Directories != null && m_controller.Directories.Any())
                    {
                        ItemsScrollViewer?.ScrollToTop();
                    }

                    UpdateListVisibility();
                }
                else if (args.PropertyName == nameof(FileSystemController.SelectedDirectories))
                {
                    UpdateSelection();
                    UpdateSelectionList();

                    UpdateSelectionListVisibility();
                }
            }

            base.ControllerPropertyChangedHandler(sender, args);
        }
Example #2
0
        protected override void ControllerPropertyChangedHandler(object sender, PropertyChangedEventArgs args)
        {
            if (sender == m_controller)
            {
                if (args.PropertyName == nameof(FileSystemController.DirectoriesAndFiles))
                {
                    List <FileSystemInfo> items = m_controller.DirectoriesAndFiles;
                    m_fileSystemEntryItemsControl.ItemsSource = GetFileSystemEntryItems(items);

                    if (items != null && items.Any())
                    {
                        ItemsScrollViewer.ScrollToTop();
                    }

                    UpdateListVisibility();
                }
                else if (args.PropertyName == nameof(FileSystemController.CurrentFileFullName))
                {
                    if (m_controller.CurrentFileFullName != null)
                    {
                        CurrentFile = m_controller.CurrentFileFullName;
                    }
                    else
                    {
                        CurrentFile = null;
                    }

                    UpdateSelection();
                }
                else if (args.PropertyName == nameof(FileSystemController.FileFilters))
                {
                    Filters = m_controller.FileFilters;
                    m_fileFiltersComboBox.ItemsSource = m_controller.FileFilters;

                    UpdateFileFiltersVisibility();
                }
                else if (args.PropertyName == nameof(FileSystemController.FileFilterToApply))
                {
                    int filterIndex = -1;

                    if (m_controller.FileFilterToApply != null && m_controller.FileFilters != null)
                    {
                        for (int i = 0; i < m_controller.FileFilters.Count && filterIndex == -1; i++)
                        {
                            if (m_controller.FileFilters[i] == m_controller.FileFilterToApply)
                            {
                                filterIndex = i;
                            }
                        }
                    }

                    FilterIndex = filterIndex;
                }
            }

            base.ControllerPropertyChangedHandler(sender, args);
        }
Example #3
0
 /// <summary>
 /// Called when [notification logic].
 /// </summary>
 /// <param name="manager">The manager.</param>
 /// <param name="n">The n.</param>
 /// <remarks>...</remarks>
 protected void OnNotificationLogic(DynamicNotificationManager manager, Notification n)
 {
     this.InvokeAsyncThreadSafe(() => {
         var item            = new TileItem(n);
         n[typeof(TileItem)] = item;
         ItemsContainer.Children.Insert(0, item);
         ItemsScrollViewer.ScrollToTop();
     });
 }