当前位置: 首页>>代码示例>>C#>>正文


C# Grid.Add方法代码示例

本文整理汇总了C#中System.Windows.Controls.Grid.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Grid.Add方法的具体用法?C# Grid.Add怎么用?C# Grid.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.Grid的用法示例。


在下文中一共展示了Grid.Add方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddTwice

		public void AddTwice ()
		{
			ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
			ColumnDefinition d = new ColumnDefinition ();
			c.Add (d);
			c.Add (d);
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:7,代码来源:ColumnDefinitionCollectionTest.cs

示例2: GeneralRequestVisualizer

        public GeneralRequestVisualizer()
        {
            title = NameValuePanel.Create("Title", new TextBox());

            var url = NameValuePanel.Create("URL", new TextBox());
            var method = new ComboBox
            {
                VerticalAlignment = VerticalAlignment.Bottom,
                Margin = new Thickness(0, 0, 5, 0),
                SelectedIndex = 0
            };

            var urlAndMethod = new Grid();
            urlAndMethod.AddColumn(1, GridUnitType.Star);
            urlAndMethod.AddColumn(100, GridUnitType.Pixel);
            urlAndMethod.AddRow(GridLength.Auto);
            urlAndMethod.Add(url, 0, 0);
            urlAndMethod.Add(method, 0, 1);

            var apiGeneralStackPanel = new StackPanel
            {
                Margin = new Thickness(0, 0, 0, 10)
            };
            apiGeneralStackPanel.Children.Add(title);
            apiGeneralStackPanel.Children.Add(urlAndMethod);
            Children.Add(apiGeneralStackPanel);

            this.Bind(x => x.Model.Title).Mate(title.Value);
            this.Bind(x => x.Model.Url).Mate(url.Value);
            this.Bind(x => x.Model.Method).Mate(method, x => x.MainWindow.Methods);
        }
开发者ID:kswoll,项目名称:restless,代码行数:31,代码来源:GeneralRequestVisualizer.cs

示例3: AddToMultipleCollections

		public void AddToMultipleCollections ()
		{
			ColumnDefinitionCollection c1 = new Grid ().ColumnDefinitions;
			ColumnDefinitionCollection c2 = new Grid ().ColumnDefinitions;
			ColumnDefinition d = new ColumnDefinition ();
			c1.Add (d);
			c2.Add (d);
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:8,代码来源:ColumnDefinitionCollectionTest.cs

示例4: AddToMultipleCollectionsOne2

		public void AddToMultipleCollectionsOne2 ()
		{
			ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
			ColumnDefinition d = new ColumnDefinition ();
			c.Add (d);
			c.Remove (d);
			c = new Grid ().ColumnDefinitions;
			c.Add (d);
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:9,代码来源:ColumnDefinitionCollectionTest.cs

示例5: CreateControls

        public TestLineControls CreateControls(Grid grid)
        {
            var controls = new TestLineControls
            {
                Icon = icon,
                Path = path,
                Run = run,
                Status = status
            };

            int rowIndex = grid.RowDefinitions.Count;
            grid.RowDefinitions.Add(new RowDefinition
            {
                Height = new GridLength(30)
            });

            mainPanel.Children.Remove(namePanel);
            grid.Add(namePanel, rowIndex, 0);

            mainPanel.Children.Remove(status);
            grid.Add(status, rowIndex, 1);

            return controls;
        }
开发者ID:adymitruk,项目名称:storyteller,代码行数:24,代码来源:TestLinePanel.xaml.cs

示例6: IListCopyTo

		public void IListCopyTo ()
		{
			ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
			c.Add (new ColumnDefinition ());
			((IList)c).CopyTo (new object [1], 0);
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:6,代码来源:ColumnDefinitionCollectionTest.cs

示例7: IListIndexerSetNull

		public void IListIndexerSetNull ()
		{
			ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
			ColumnDefinition d = new ColumnDefinition ();
			c.Add (d);
			((IList)c) [0] = null;
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:7,代码来源:ColumnDefinitionCollectionTest.cs

示例8: IndexerSetOutOfRangeFromAnotherCollection

		public void IndexerSetOutOfRangeFromAnotherCollection ()
		{
			ColumnDefinitionCollection c1 = new Grid ().ColumnDefinitions;
			ColumnDefinition d = new ColumnDefinition ();
			c1.Add (d);
			ColumnDefinitionCollection c2 = new Grid ().ColumnDefinitions;
			c2 [0] = d;
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:8,代码来源:ColumnDefinitionCollectionTest.cs

示例9: IndexerSetSame

		public void IndexerSetSame ()
		{
			ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
			ColumnDefinition d = new ColumnDefinition ();
			c.Add (d);
			c [0] = d;
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:7,代码来源:ColumnDefinitionCollectionTest.cs

示例10: IndexerSetAtIndexInRange

		public void IndexerSetAtIndexInRange ()
		{
			ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
			ColumnDefinition d = new ColumnDefinition ();
			c.Add (d);
			c [0] = new ColumnDefinition ();
			Assert.AreNotEqual (c [0], d);
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:8,代码来源:ColumnDefinitionCollectionTest.cs


注:本文中的System.Windows.Controls.Grid.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。