Skip to content

Instantly share code, notes, and snippets.

@mrlacey
Last active October 12, 2015 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrlacey/f5d77c64faea295f9154 to your computer and use it in GitHub Desktop.
Save mrlacey/f5d77c64faea295f9154 to your computer and use it in GitHub Desktop.
Example of how to change the size of the AdMediatorControl depending on the device width.
<Grid>
<Universal:AdMediatorControl x:Name="AdControl"
Id="ecba2d7a-f2d9-43bb-ab12-f8c5df300987"
Height="90"
Width="728" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="VisualStateGroup">
<VisualState x:Name="Mobile">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="320" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="AdControl.Height" Value="80" />
<Setter Target="AdControl.Width" Value="480" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Desktop">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="720" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="AdControl.Height" Value="90" />
<Setter Target="AdControl.Width" Value="728" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment