Пример #1
0
        public async Task DisplayAsync(StorageFile file)
        {
            FileGrid.Columns.Clear();

            Table table = await ParquetUwp.LoadAsync(file);

            int i = 0;

            foreach (Field f in table.Schema.Fields)
            {
                FileGrid.Columns.Add(new DataGridTextColumn
                {
                    Header  = f.Name,
                    Width   = DataGridLength.SizeToCells,
                    Binding = new Binding
                    {
                        Path = new PropertyPath("[" + i++ + "]")
                    }
                });
            }

            FileGrid.ItemsSource = table.Select(r => new TableRowView(r)).ToList();

            StatusText.Text = $"showing first {table.Count} records.";
        }
        private async Task LoadAndDisplay(StorageFile file)
        {
            HamburgerMenu.IsPaneOpen = false;

            if (file == null)
            {
                return;
            }

            LoadingControl.IsLoading = true;

            try
            {
                DataSet ds = await ParquetUwp.LoadAsync(file);

                Display(ds);
            }
            finally
            {
                LoadingControl.IsLoading = false;
            }
        }