title: How to change properties of a grid with visual state manager XAML
body: <p>I am developing a windows universal application using C# and XAML. When my app is run on a laptop I want to change the height of my child grid in this gridview named tabIcon.</p>
  
  <pre><code> &lt;Grid Name="tabGrid" Width="700"&gt;
              &lt;GridView  Name="SpecialtyGridView" HorizontalAlignment="Center" ItemsSource="{Binding Source={StaticResource SpecialtyCollectionViewSource}}" Grid.Row="2" SelectionMode="None" IsItemClickEnabled="True" ItemClick="SpecialtyGridView_ItemClick"&gt;
                  &lt;GridView.ItemsPanel&gt;
                      &lt;ItemsPanelTemplate&gt;
                          &lt;WrapGrid Margin="0,0,0,10" Orientation="Vertical" MaximumRowsOrColumns="4"/&gt;
                      &lt;/ItemsPanelTemplate&gt;
                  &lt;/GridView.ItemsPanel&gt;
                  &lt;GridView.ItemTemplate&gt;
                      &lt;DataTemplate&gt;
                          &lt;Grid Name="tabIcon"  Background="#21539E" Width="290" Height="140" Margin="5,0,5,8"&gt;
                              &lt;TextBlock x:Name="SpecialityTextBlock" FontSize="26" Foreground="White" FontFamily="Segoe UI" VerticalAlignment="Center" HorizontalAlignment="Center"&gt;
                          &lt;Run Text="{Binding speciality}"/&gt;
                              &lt;/TextBlock&gt;
                          &lt;/Grid&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/GridView.ItemTemplate&gt;
              &lt;/GridView&gt;
  
          &lt;/Grid&gt;
  </code></pre>
  
  <p>I use a visual state trigger to do this but it does not work. Here is my trigger code for laptop.</p>
  
  <pre><code>        &lt;VisualStateManager.VisualStateGroups&gt;
  
          &lt;VisualStateGroup&gt;
  
              &lt;VisualState x:Name="Phone"&gt;
  
                  &lt;VisualState.StateTriggers&gt;
                      &lt;AdaptiveTrigger MinWindowWidth = "0"/&gt;
                  &lt;/VisualState.StateTriggers&gt;
  
                  &lt;VisualState.Setters&gt;
                      &lt;Setter Target = "HeaderGrid.Height"
                   Value = "90" /&gt;
                      &lt;Setter Target = "Instruction.Visibility"
                   Value = "Collapsed" /&gt;
                      &lt;Setter Target = "TheatreName.FontSize"
                   Value = "14" /&gt;
                      &lt;Setter Target = "TheatreName.HorizontalAlignment"
                   Value = "Left" /&gt;
                      &lt;Setter Target = "TheatreName.Margin"
                   Value = "0,40" /&gt;
                      &lt;Setter Target = "PatientNameAndIDStackPanel.Margin"
                   Value = "10,0" /&gt;
  
  
                  &lt;/VisualState.Setters&gt;
  
              &lt;/VisualState&gt;
  
              &lt;VisualState x:Name="Tablets"&gt;
  
                  &lt;VisualState.StateTriggers&gt;
                      &lt;AdaptiveTrigger MinWindowWidth = "720"  /&gt;
                  &lt;/VisualState.StateTriggers&gt;
  
                  &lt;VisualState.Setters&gt;
  
                      &lt;!--&lt;Setter Target = "Body.Background"
                   Value = "Red" /&gt;--&gt;
                  &lt;/VisualState.Setters&gt;
  
              &lt;/VisualState&gt;
              &lt;VisualState x:Name="Laptop"&gt;
  
                  &lt;VisualState.StateTriggers&gt;
                      &lt;AdaptiveTrigger MinWindowWidth = "1024" /&gt;
                  &lt;/VisualState.StateTriggers&gt;
  
                 &lt;VisualState.Setters&gt;
                      &lt;Setter Target = "tabIcon.Height"
               Value = "60" /&gt;
  
                  &lt;/VisualState.Setters&gt;
  
              &lt;/VisualState&gt;
              &lt;VisualState x:Name="PCs"&gt;
  
                  &lt;VisualState.StateTriggers&gt;
                      &lt;AdaptiveTrigger MinWindowWidth = "1400" /&gt;
                  &lt;/VisualState.StateTriggers&gt;
  
                  &lt;VisualState.Setters&gt;
                      &lt;Setter Target = "Divider.Height"
                   Value = "80" /&gt;
                  &lt;/VisualState.Setters&gt;
  
              &lt;/VisualState&gt;
  
          &lt;/VisualStateGroup&gt;
  
      &lt;/VisualStateManager.VisualStateGroups&gt;
  </code></pre>
  
  <p>This code works if I use it for the grid named tabGrid but does not work for the grid named tabIcon. What can I do to get this to work?</p>