Пример #1
0
		internal static FrameworkElementFactory CreateBoundColumnTemplate (ApplicationContext ctx, Widget parent, CellViewCollection views, string dataPath = ".")
		{
			if (views.Count == 1)
                return CreateBoundCellRenderer(ctx, parent, views[0], dataPath);
			
			FrameworkElementFactory container = new FrameworkElementFactory (typeof (StackPanel));
			container.SetValue (StackPanel.OrientationProperty, System.Windows.Controls.Orientation.Horizontal);

			foreach (CellView view in views) {
				var factory = CreateBoundCellRenderer(ctx, parent, view, dataPath);

				factory.SetValue(FrameworkElement.MarginProperty, CellMargins);

				if (view.VisibleField != null)
				{
					var binding = new Binding(dataPath + "[" + view.VisibleField.Index + "]");
					binding.Converter = new BooleanToVisibilityConverter();
					factory.SetBinding(UIElement.VisibilityProperty, binding);
				}
				else if (!view.Visible)
					factory.SetValue(UIElement.VisibilityProperty, Visibility.Collapsed);

				container.AppendChild(factory);
			}

			return container;
		}
Пример #2
0
 public void SetViews(CellViewCollection views)
 {
     column.Views.Clear ();
     foreach (var v in views)
         column.Views.Add (v);
     UpdateColumn (column, columnHandle, ListViewColumnChange.Cells);
 }
Пример #3
0
 public void SetViews(CellViewCollection views)
 {
     ListBox.DisplayMemberPath = null;
     ListBox.ItemTemplate      = new DataTemplate {
         VisualTree = CellUtil.CreateBoundColumnTemplate(Context, Frontend, views)
     };
 }
Пример #4
0
 public void SetViews(CellViewCollection views)
 {
     Widget.Clear();
     foreach (var v in views)
     {
         CellUtil.CreateCellRenderer(ApplicationContext, this, null, v, Widget.Model);
     }
 }
Пример #5
0
 public void SetViews(CellViewCollection views)
 {
     Widget.Clear();
     foreach (var v in views)
     {
         CellUtil.CreateCellRenderer(this, null, v);
     }
 }
Пример #6
0
 public void SetViews(CellViewCollection views)
 {
     theColumn.Clear();
     foreach (var v in views)
     {
         CellUtil.CreateCellRenderer(ApplicationContext, Frontend, this, theColumn, v);
     }
 }
Пример #7
0
 public void SetViews(CellViewCollection views)
 {
     column.Views.Clear();
     foreach (var v in views)
     {
         column.Views.Add(v);
     }
     UpdateColumn(column, columnHandle, ListViewColumnChange.Cells);
 }
Пример #8
0
		internal static FrameworkElementFactory CreateBoundColumnTemplate (ApplicationContext ctx, Widget parent, CellViewCollection views, string dataPath = ".")
		{
			if (views.Count == 1)
                return CreateBoundCellRenderer(ctx, parent, views[0], dataPath);
			
			FrameworkElementFactory container = new FrameworkElementFactory (typeof (StackPanel));
			container.SetValue (StackPanel.OrientationProperty, System.Windows.Controls.Orientation.Horizontal);

			foreach (CellView view in views) {
                container.AppendChild(CreateBoundCellRenderer(ctx, parent, view, dataPath));
			}

			return container;
		}
Пример #9
0
        internal static FrameworkElementFactory CreateBoundColumnTemplate(CellViewCollection views, string dataPath = ".")
        {
            if (views.Count == 1)
            {
                return(CreateBoundCellRenderer(views [0], dataPath));
            }

            FrameworkElementFactory container = new FrameworkElementFactory(typeof(StackPanel));

            container.SetValue(StackPanel.OrientationProperty, Orientation.Horizontal);

            foreach (CellView view in views)
            {
                container.AppendChild(CreateBoundCellRenderer(view, dataPath));
            }

            return(container);
        }
Пример #10
0
 public ListViewColumn()
 {
     views = new CellViewCollection (this);
 }
Пример #11
0
        internal static FrameworkElementFactory CreateBoundColumnTemplate(ApplicationContext ctx, WidgetBackend parent, CellViewCollection views, string dataPath = ".")
        {
            if (views.Count == 1)
            {
                return(CreateBoundCellRenderer(ctx, parent, views[0], dataPath));
            }

            FrameworkElementFactory container = new FrameworkElementFactory(typeof(Grid));

            int i = 0;

            foreach (CellView view in views)
            {
                var factory = CreateBoundCellRenderer(ctx, parent, view, dataPath);

                factory.SetValue(FrameworkElement.MarginProperty, CellMargins);

                if (view.VisibleField != null)
                {
                    var binding = new Binding(dataPath + "[" + view.VisibleField.Index + "]");
                    binding.Converter = new BooleanToVisibilityConverter();
                    factory.SetBinding(UIElement.VisibilityProperty, binding);
                }
                else if (!view.Visible)
                {
                    factory.SetValue(UIElement.VisibilityProperty, Visibility.Collapsed);
                }

                factory.SetValue(FrameworkElement.HorizontalAlignmentProperty, view.Expands ? HorizontalAlignment.Stretch : HorizontalAlignment.Left);
                factory.SetValue(Grid.ColumnProperty, i);
                var column = new FrameworkElementFactory(typeof(ColumnDefinition));
                column.SetValue(ColumnDefinition.WidthProperty, new GridLength(1, view.Expands ? GridUnitType.Star : GridUnitType.Auto));

                container.AppendChild(column);
                container.AppendChild(factory);

                i++;
            }

            return(container);
        }
Пример #12
0
		public void SetViews (CellViewCollection views)
		{
			Widget.Clear ();
			foreach (var v in views)
				CellUtil.CreateCellRenderer (ApplicationContext, Frontend, this, null, v);
		}
Пример #13
0
 public void SetViews(CellViewCollection views)
 {
     ComboBox.ItemTemplate = GetDataTemplate (views);
 }
Пример #14
0
 public void SetViews(CellViewCollection views)
 {
 }
Пример #15
0
 public void SetViews(CellViewCollection views)
 {
     ComboBox.DisplayMemberPath = null;
     ComboBox.ItemTemplate      = GetDataTemplate(views);
 }
Пример #16
0
 public void SetViews(CellViewCollection views)
 {
     Widget.Clear ();
     foreach (var v in views)
         CellUtil.CreateCellRenderer (this, null, v);
 }
Пример #17
0
 public ComboBox()
 {
     views = new CellViewCollection ((ICellContainer)WidgetEventSink);
 }
Пример #18
0
 public void SetViews(CellViewCollection views)
 {
     ComboBox.DisplayMemberPath = null;
     ComboBox.ItemTemplate = GetDataTemplate(views);
 }
Пример #19
0
        internal static FrameworkElementFactory CreateBoundColumnTemplate(ApplicationContext ctx, Widget parent, CellViewCollection views, string dataPath = ".")
        {
            if (views.Count == 1)
            {
                return(CreateBoundCellRenderer(ctx, parent, views[0], dataPath));
            }

            FrameworkElementFactory container = new FrameworkElementFactory(typeof(StackPanel));

            container.SetValue(StackPanel.OrientationProperty, System.Windows.Controls.Orientation.Horizontal);

            foreach (CellView view in views)
            {
                var factory = CreateBoundCellRenderer(ctx, parent, view, dataPath);

                factory.SetValue(FrameworkElement.MarginProperty, CellMargins);

                if (view.VisibleField != null)
                {
                    var binding = new Binding(dataPath + "[" + view.VisibleField.Index + "]");
                    binding.Converter = new BooleanToVisibilityConverter();
                    factory.SetBinding(UIElement.VisibilityProperty, binding);
                }
                else if (!view.Visible)
                {
                    factory.SetValue(UIElement.VisibilityProperty, Visibility.Collapsed);
                }

                container.AppendChild(factory);
            }

            return(container);
        }
Пример #20
0
 public void SetViews(CellViewCollection views)
 {
     ComboBox.ItemTemplate = GetDataTemplate(views);
 }
Пример #21
0
 public void SetViews(CellViewCollection views)
 {
     column.Views.Clear ();
     foreach (var v in views)
         column.Views.Add (v);
 }
Пример #22
0
		public void SetViews (CellViewCollection views)
		{
			ListBox.DisplayMemberPath = null;
            ListBox.ItemTemplate = new DataTemplate { VisualTree = CellUtil.CreateBoundColumnTemplate(Context, Frontend, views) };
		}
Пример #23
0
 public void SetViews(CellViewCollection views)
 {
     theColumn.Clear ();
     foreach (var v in views)
         CellUtil.CreateCellRenderer (this, theColumn, v);
 }
Пример #24
0
 public ComboBox()
 {
     views = new CellViewCollection ((ICellContainer)BackendHost);
 }
Пример #25
0
 public void SetViews(CellViewCollection views)
 {
     theColumn.Clear ();
     foreach (var v in views)
         CellUtil.CreateCellRenderer (ApplicationContext, this, theColumn, v, Widget.Model);
 }