このOrientationChanged
イベントは、Windows Phone 8 でも動作するはずです。ページPortraitOrLandscape
のSupportedOrientations
プロパティに次のように入力してください。
<phone:PhoneApplicationPage
x:Class="WP8Application.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
shell:SystemTray.IsVisible="True"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
OrientationChanged="PhoneApplicationPage_OrientationChanged_1">
ポイントは、単純に、Portrait
またはLandscape
サポートされている向きで離れると、電話を回転させてもアプリケーションの向きが実際には変わらないためOrientationChanged
、イベントはトリガーされないということです。
あなたの他の質問については、SupportedOrientations
プロパティを正しく設定するとわかるように、Windows Phone は UI 要素を自動的に再配置するはずです。ほとんどの場合、要素の位置を明示的にピクセル単位で設定しない限り、自動レイアウトがニーズに合っているはずです。