{"id":639,"date":"2016-11-21T13:50:38","date_gmt":"2016-11-21T13:50:38","guid":{"rendered":"https:\/\/ibex.tech\/windows-iot\/?p=124"},"modified":"2016-11-21T13:50:38","modified_gmt":"2016-11-21T13:50:38","slug":"grid-2","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/uwp-programming-in-c\/grid\/grid-2","title":{"rendered":".Grid"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Grid Properties<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Background<\/h5>\n\n\n\n<p>By default the &lt;Page&gt; has a background defined:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;Page\n...\nBackground=\"{ThemeResource ApplicationPageBackgroundThemeBrush}\"&gt;<\/code><\/pre>\n\n\n\n<p>But you can set a grid background if you want:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;Grid Background=\"{ThemeResource ApplicationPageBackgroundThemeBrush}\"&gt;\n\n&lt;Grid Background=\"Black\"&gt;<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Columns<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\t&lt;Grid.ColumnDefinitions&gt;\n\t\t&lt;ColumnDefinition Width=\"30\"\/&gt;\n\t\t&lt;ColumnDefinition Width=\"1*\"\/&gt;\n\t&lt;\/Grid.ColumnDefinitions&gt;<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Rows<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\t&lt;Grid.RowDefinitions&gt;\n\t\t&lt;RowDefinition Height=\"30\"\/&gt;\n\t\t&lt;RowDefinition Height=\"50\"\/&gt;\n\t\t&lt;RowDefinition Height=\"3*\"\/&gt;\n\t\t&lt;RowDefinition Height=\"1*\" MinHeight=\"40\"\/&gt;\n\t&lt;\/Grid.RowDefinitions&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Placing Objects In The Grid<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\t&lt;Rectangle Grid.Row=\"1\" Grid.Column=\"1\" Grid.ColumnSpan=\"2\" ... <\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Grid Example 1<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>    &lt;Grid&gt;\n        &lt;Grid.RowDefinitions&gt;\n            &lt;RowDefinition Height=\"30\"\/&gt;\n            &lt;RowDefinition Height=\"1*\" MinHeight=\"40\"\/&gt;\n            &lt;RowDefinition Height=\"30\"\/&gt;\n            &lt;RowDefinition Height=\"30\"\/&gt;\n            &lt;RowDefinition Height=\"30\"\/&gt;\n            &lt;RowDefinition Height=\"30\"\/&gt;\n            &lt;RowDefinition Height=\"1*\"\/&gt;\n            &lt;RowDefinition Height=\"30\"\/&gt;\n            &lt;RowDefinition Height=\"30\"\/&gt;\n            &lt;RowDefinition Height=\"3*\"\/&gt;\n        &lt;\/Grid.RowDefinitions&gt;\n        &lt;Grid.ColumnDefinitions&gt;\n            &lt;ColumnDefinition Width=\"30\"\/&gt;\n            &lt;ColumnDefinition Width=\"100\"\/&gt;\n            &lt;ColumnDefinition Width=\"100\"\/&gt;\n            &lt;ColumnDefinition Width=\"100\"\/&gt;\n            &lt;ColumnDefinition Width=\"1*\"\/&gt;\n        &lt;\/Grid.ColumnDefinitions&gt;\n\n        &lt;TextBlock Grid.Column=\"1\" Grid.Row=\"1\" TextWrapping=\"Wrap\" Text=\"UWP App Transitions\" FontSize=\"24\" Grid.ColumnSpan=\"3\"\/&gt;\n\n        &lt;TextBlock Grid.Column=\"1\" Grid.Row=\"2\" TextWrapping=\"Wrap\" Text=\"To Transition\" Grid.ColumnSpan=\"3\" \/&gt;\n        &lt;ComboBox x:Name=\"toTransitions\" Grid.Column=\"1\" Grid.Row=\"3\" HorizontalAlignment=\"Left\" Width=\"275\" SelectionChanged=\"toTransitions_SelectionChanged\" Grid.ColumnSpan=\"3\" \/&gt;\n\n        &lt;TextBlock Grid.Column=\"1\" Grid.Row=\"4\" TextWrapping=\"Wrap\" Text=\"From Transition\" Grid.ColumnSpan=\"3\" \/&gt;\n        &lt;ComboBox x:Name=\"fromTransitions\" Grid.Column=\"1\" Grid.Row=\"5\" HorizontalAlignment=\"Left\" Width=\"275\" SelectionChanged=\"fromTransitions_SelectionChanged\" Grid.ColumnSpan=\"3\" \/&gt;\n\n        &lt;Button Content=\"Navigate\" Grid.Column=\"1\" Grid.Row=\"7\" VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Stretch\" Click=\"Button_Click\" Grid.ColumnSpan=\"3\" \/&gt;\n        &lt;Button Content=\"Left\" Grid.Column=\"1\" Grid.Row=\"8\" VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Stretch\" Click=\"ButtonLeft_Click\" \/&gt;\n        &lt;Button Content=\"Popup\" Grid.Column=\"2\" Grid.Row=\"8\" VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Stretch\" Click=\"ButtonPop_Click\" \/&gt;\n        &lt;Button Content=\"Right\" Grid.Column=\"3\" Grid.Row=\"8\" VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Stretch\" Click=\"ButtonRight_Click\" \/&gt;\n    &lt;\/Grid&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Grid Properties Background By default the &lt;Page&gt; has a background defined: But you can set a grid background if you want: Columns Rows Placing Objects In The Grid Grid Example 1<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[],"class_list":["post-639","post","type-post","status-publish","format-standard","hentry","category-grid"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=639"}],"version-history":[{"count":0,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/639\/revisions"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}