Ejemplo n.º 1
0
        private void SetControlsGridView()
        {
            //Set the Tool Bar look
            ElementsGrid.ShowAdd      = Visibility.Collapsed;
            ElementsGrid.ShowClearAll = Visibility.Collapsed;
            ElementsGrid.ShowUpDown   = Visibility.Collapsed;
            //TODO: enable refresh to do refresh

            ElementsGrid.ShowEdit   = System.Windows.Visibility.Collapsed;
            ElementsGrid.ShowDelete = System.Windows.Visibility.Collapsed;

            //TODO: add button to show all...

            //Set the Data Grid columns
            GridViewDef view = new GridViewDef(GridViewDef.DefaultViewName);

            view.GridColsView = new ObservableList <GridColView>();

            view.GridColsView.Add(new GridColView()
            {
                Field = nameof(ElementInfo.ElementName), WidthWeight = 100
            });
            view.GridColsView.Add(new GridColView()
            {
                Field = nameof(ElementInfo.ElementType), WidthWeight = 60
            });
            view.GridColsView.Add(new GridColView()
            {
                Field = nameof(ElementInfo.Mandatory), WidthWeight = 60
            });

            ElementsGrid.SetAllColumnsDefaultView(view);
            ElementsGrid.InitViewItems();
        }
Ejemplo n.º 2
0
        public void Init2(ContextMenu contextMenu, ContextMenu emptyContextMenu)
        {
            Binding binding = new Binding()
            {
                Source = Application.Current.Resources["LocalString"], Path = new PropertyPath("Dict[Editor_BookmarksPanel]")
            };

            ElementsGrid.SetBinding(Grid.ToolTipProperty, binding);

            _contextMenu      = contextMenu;
            _emptyContextMenu = emptyContextMenu;
        }