Exemplo n.º 1
0
		public GridViewSection()
		{
			var layout = new DynamicLayout();

			layout.AddRow(new Label { Text = "Default" }, Default());
			layout.AddRow(new Label { Text = "No Header,\nNon-Editable" }, NoHeader());
#if DESKTOP
			layout.BeginHorizontal();
			layout.Add(new Label { Text = "Context Menu\n&& Multi-Select\n&& Filter" });
			layout.BeginVertical();
			layout.Add(filterText = new SearchBox { PlaceholderText = "Filter" });
			var withContextMenuAndFilter = WithContextMenuAndFilter();
			layout.Add(withContextMenuAndFilter);
			layout.EndVertical();
			layout.EndHorizontal();

			var selectionGridView = Default(addItems: false);
			layout.AddRow(new Label { Text = "Selected Items" }, selectionGridView);

			// hook up selection of main grid to the selection grid
			withContextMenuAndFilter.SelectionChanged += (s, e) =>
			{
				var items = new GridItemCollection();
				items.AddRange(withContextMenuAndFilter.SelectedItems);
				selectionGridView.DataStore = items;
			};
#endif

			Content = layout;
		}
Exemplo n.º 2
0
        public GridViewSection()
        {
            var layout = new DynamicLayout();

            layout.AddRow(new Label {
                Text = "Default"
            }, Default());
            layout.AddRow(new Label {
                Text = "No Header,\nNon-Editable"
            }, NoHeader());
#if DESKTOP
            layout.BeginHorizontal();
            layout.Add(new Label {
                Text = "Context Menu\n&& Multi-Select\n&& Filter"
            });
            layout.BeginVertical();
            layout.Add(filterText = new SearchBox {
                PlaceholderText = "Filter"
            });
            var withContextMenuAndFilter = WithContextMenuAndFilter();
            layout.Add(withContextMenuAndFilter);
            layout.EndVertical();
            layout.EndHorizontal();

            var selectionGridView = Default(addItems: false);
            layout.AddRow(new Label {
                Text = "Selected Items"
            }, selectionGridView);

            // hook up selection of main grid to the selection grid
            withContextMenuAndFilter.SelectionChanged += (s, e) =>
            {
                var items = new GridItemCollection();
                items.AddRange(withContextMenuAndFilter.SelectedItems);
                selectionGridView.DataStore = items;
            };
#endif

            Content = layout;
        }