Question 26


70-486 Skills Measured >> 2.5 Plan an adaptive UI layout >>

Question

Drag and Drop
You are developing an ASP.NET MVC application that has pages for users who browse the site with Windows Phone 7.

The pages for Windows Phone 7 include the following files:
  • _Layout.WP7.cshtml
  • Index.WP7.cshtml
You need to update the application so that it renders the customized files correctly to Windows Phone 7 users.

How should you update the Application_Start method?
(To answer, drag the appropriate line of code to the correct location or locations. Each line of code may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

  • DefaultDisplayMode("WP7")
  • ("Windows Phone OS",
  • StringComparison.OrdinalIgnoreCase
  • DefaultDisplayMode("Mobile")
  • ("Mobile",
  • AreaRegistration.RegisterAllDevices()
protected void Application_Start()
{
DisplayModeProvider.Instance.Modes.Insert(0,new

    {
    Context.Condition = (context => context.GetOverridenUserAgent().indexOf
        ) => 0)
        });
        AreaRegistration.RegisterAllAreas();
        }

        Answer:

        • DefaultDisplayMode("Mobile")
        • ("Mobile",
        • AreaRegistration.RegisterAllDevices()
        protected void Application_Start()
        {
        DisplayModeProvider.Instance.Modes.Insert(0,new
        • DefaultDisplayMode("WP7")

        {
        Context.Condition = (context => context.GetOverridenUserAgent().indexOf
        • ("Windows Phone OS",
        • StringComparison.OrdinalIgnoreCase
        ) => 0)
        });
        AreaRegistration.RegisterAllAreas();
        }