2011/10/20

[WP7] UriMapper.UriMappings

// App.xaml
xmlns:nav="clr-namespace:System.Windows.Navigation;assembly=Microsoft.Phone"

<nav:UriMapper x:Key="UriMapper">
    <nav:UriMapper.UriMappings>
        <nav:UriMapping MappedUri="/Views/Info/Default.xaml?V={Value}"
                       Uri="/Info/{Value}"></nav:UriMapping>
    </nav:UriMapper.UriMappings>
</nav:UriMapper>

// App.xaml.cs

public App()
{
    this.RootFrame.UriMapper = Resources["UriMapper"] as UriMapper;
}


[WP7] NavigationContext.QuerySring

NavigationContext.QueryString.Values.First();
NavigationContext.QueryString["KeyName"];

[WP7] SupportedOrientations OrientationChanged Event

this.OrientationChanged += (s, e) => { if (e.Orientation == PageOrientation.Landscape || e.Orientation == PageOrientation.LandscapeLeft || e.Orientation == PageOrientation.LandscapeRight) { TitlePanel.Visibility = System.Windows.Visibility.Collapsed; ContentPanel.SetValue(Grid.RowSpanProperty, 2); ContentPanel.SetValue(Grid.RowProperty, 0); } else { TitlePanel.Visibility = System.Windows.Visibility.Visible; ContentPanel.SetValue(Grid.RowSpanProperty, 1); ContentPanel.SetValue(Grid.RowProperty, 1); } };

가장 많이 본 글