Exemplo n.º 1
0
        /// <summary>
        /// Adds a FolderDisplay object to the UI's column view
        /// </summary>
        /// <param name="fd">FolderDisplay object to add</param>
        /// <param name="readd">Whether this FolderDisplay should be re-added to the displayList</param>
        private void addToTable(FolderDisplay fd, bool readd = true)
        {
            //create the grid separator

            /*ContentGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(5) });
             * GridSplitter gs = new GridSplitter() { Width = 5 };
             * ContentGrid.Children.Add(gs);
             * Grid.SetColumn(gs, ContentGrid.ColumnDefinitions.Count - 1);
             * Grid.SetRow(gs, 1);*/

            //add the datagrid
            ContentGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(1, GridUnitType.Star)
            });
            ContentGrid.Children.Add(fd.dg);
            Grid.SetRow(fd.dg, 1);
            Grid.SetColumn(fd.dg, ContentGrid.ColumnDefinitions.Count - 1);

            Label l = new Label()
            {
                Content = fd.folderData.path.Name + " - " + fd.totalSizeFormatted()
            };

            ContentGrid.Children.Add(l);
            Grid.SetRow(l, 0);
            Grid.SetColumn(l, ContentGrid.ColumnDefinitions.Count - 1);

            if (readd)
            {
                displayList.Add(fd);
            }

            //scroll to end
            MainScrollView.ScrollToHorizontalOffset(System.Int32.MaxValue);
            MainScrollView.UpdateLayout();
        }