Ejemplo n.º 1
0
        private void LoadColumnEdit()
        {
            DoOnMainThread(() =>
            {
                //okay lets spawn a dialog for editing the columns in the grid
                var currentColumns = DynamicGridViewModel.FieldMetadata
                                     .OrderBy(f => f.Order)
                                     .Select(f => new KeyValuePair <string, double>(f.FieldName, f.WidthPart))
                                     .ToArray();

                Action <IEnumerable <ColumnEditDialogViewModel.SelectableColumn> > letsLoadTheColumns = (newColumnSet) =>
                {
                    DoOnMainThread(() =>
                    {
                        ExplicitlySelectedColumns = new List <GridFieldMetadata>();
                        for (var i = 1; i <= newColumnSet.Count(); i++)
                        {
                            var thisOne = newColumnSet.ElementAt(i - 1);
                            ExplicitlySelectedColumns.Add(new GridFieldMetadata(new ViewField(thisOne.FieldName, i, Convert.ToInt32(thisOne.Width))));
                        }
                        ClearChildForm();
                        RecreateGrid();
                    });
                };

                var columnEditDialog = new ColumnEditDialogViewModel(SummaryItem.RecordTypeSchemaName, currentColumns, RecordService, letsLoadTheColumns, ClearChildForm, ApplicationController);
                LoadChildForm(columnEditDialog);
            });
        }
Ejemplo n.º 2
0
        private void LoadColumnEdit()
        {
            DoOnMainThread(() =>
            {
                //okay lets spawn a dialog for editing the columns in the grid
                var currentColumns = DynamicGridViewModel.FieldMetadata
                                     .ToArray();

                Action <IEnumerable <GridFieldMetadata> > letsLoadTheColumns = (newColumnSet) =>
                {
                    DoOnMainThread(() =>
                    {
                        ExplicitlySelectedColumns = newColumnSet.ToList();
                        ClearChildForm();
                        RecreateGrid();
                    });
                };

                var columnEditDialog = new ColumnEditDialogViewModel(SummaryItem.RecordTypeSchemaName, currentColumns, RecordService, letsLoadTheColumns, ClearChildForm, ApplicationController);
                LoadChildForm(columnEditDialog);
            });
        }