1
I’m programming in C# using Visual Studio Enterprise 2015 apps for Windows Phone 8.1.
I was able to make a simple application, a calculator, but I would like to know: how do I use a shaman for the landscape mode and one for the portrait mode, in this case I would have a simple calculator in portrait mode and an advanced calculator in landscape.
The images below show this in the standard Windows Phone calculator.
Code xaml:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App12"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:WindowsPhone81="using:Microsoft.AdMediator.WindowsPhone81"
x:Class="App12.MainPage"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<Image x:Name="image" Source="Assets/03.jpg" Stretch="UniformToFill"/>
<TextBox x:Name="textBox" Margin="34,36,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="337" Background="{x:Null}" SelectionHighlightColor="#FF297ACC" FontFamily="Segoe UI Black" Foreground="White" BorderBrush="{x:Null}" FontWeight="Bold" IsReadOnly="True" Height="81" FontSize="48" HorizontalAlignment="Left" HorizontalContentAlignment="Left"/>
<Button x:Name="button" Content="C" HorizontalAlignment="Left" Margin="34,143,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Click"/>
<Button x:Name="button_Copy" Content="/" HorizontalAlignment="Left" Margin="124,143,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy_Click"/>
<Button x:Name="button_Copy1" Content="*" HorizontalAlignment="Left" Margin="218,143,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy1_Click"/>
<Button x:Name="button_Copy2" Content="-" HorizontalAlignment="Left" Margin="311,143,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy2_Click"/>
<Button x:Name="button_Copy3" Content="7" HorizontalAlignment="Left" Margin="34,210,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy3_Click"/>
<Button x:Name="button_Copy4" Content="8" HorizontalAlignment="Left" Margin="124,210,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy4_Click"/>
<Button x:Name="button_Copy5" Content="9" HorizontalAlignment="Left" Margin="218,210,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy5_Click"/>
<Button x:Name="button_Copy6" Content="+" HorizontalAlignment="Left" Margin="311,210,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy6_Click"/>
<Button x:Name="button_Copy7" Content="4" HorizontalAlignment="Left" Margin="34,279,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy7_Click"/>
<Button x:Name="button_Copy8" Content="5" HorizontalAlignment="Left" Margin="124,279,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy8_Click"/>
<Button x:Name="button_Copy9" Content="6" HorizontalAlignment="Left" Margin="218,279,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy9_Click"/>
<Button x:Name="button_Copy10" Content="," HorizontalAlignment="Left" Margin="311,279,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy10_Click"/>
<Button x:Name="button_Copy11" Content="1" HorizontalAlignment="Left" Margin="34,346,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy11_Click"/>
<Button x:Name="button_Copy12" Content="2" HorizontalAlignment="Left" Margin="124,346,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy12_Click"/>
<Button x:Name="button_Copy13" Content="3" HorizontalAlignment="Left" Margin="218,346,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy13_Click"/>
<Button x:Name="button_Copy14" Content="=" HorizontalAlignment="Left" Margin="311,346,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy14_Click"/>
<WindowsPhone81:AdMediatorControl x:Name="AdMediator_app12" Id="AdMediator-Id-F7568647-90DB-48BC-B3CA-58E5B6EBC146-app12" HorizontalAlignment="Left" Height="50" Margin="42,575,0,0" VerticalAlignment="Top" Width="320" RenderTransformOrigin="0.5,0.5"/>
<Button x:Name="button_Copy15" Content="0" HorizontalAlignment="Left" Margin="34,414,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy15_Click"/>
<Button x:Name="button_Copy16" Content="M+" HorizontalAlignment="Left" Margin="124,414,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy16_Click"/>
<Button x:Name="button_Copy17" Content="M-" HorizontalAlignment="Left" Margin="218,414,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy17_Click"/>
<Button x:Name="button_Copy18" Content="MRC" HorizontalAlignment="Left" Margin="311,414,0,0" VerticalAlignment="Top" Width="41" MinWidth="60" Click="button_Copy18_Click"/>
</Grid>
Post the code of
Xaml
that you’ve ever done.– rubStackOverflow
@rubStackOverflow posted
– Giovani
I searched... and found this only http://stackoverflow.com/questions/10975706/how-to-detect-orientation-changes-and-change-layout
– PauloHDSousa