Windows Phone 8 ShellTile TargetUri

344 Views Asked by At

One Quick Question:

I want to navigate to settings(cellular..) from an secondary livetitle.

The Problem is the targetUrl for the Shelltitle(selectedShortcutsMenuControl.TargetUrl) in my app looks like this: "cellular", and thats not an valid Uri format.

Exception : "An exception of type 'System.UriFormatException' occurred in System.ni.dll but was not handled in user code"

  StandardTileData data = new StandardTileData();
        data.Title = selectedShortcutsMenuControl.Title;
        data.BackgroundImage = myUri;
        ShellTile.Create(new Uri(selectedShortcutsMenuControl.TargetUrl,UriKind.RelativeOrAbsolute), data);

Is there a way to fix this or is there a way, to directly navigate to cellular Settings form the livetitle?

 <ctl:MenuData x:Key="ShortcutsMenuControlData">
        <ctl:MenuItemData Title="Cellular" TargetUrl="wifi" Image="/Images/Item-fc0d2405-5b0f-4f3d-ba3e-5b93fbfe2c44.png"/>
        <ctl:MenuItemData Title="WiFi" TargetUrl="cellular" Image="/Images/Item-c9f6c2c7-44e1-4079-ad90-e31b8a59333e.png"/>
        <ctl:MenuItemData Title="Airplain Mode" TargetUrl="plaine" Image="/Images/Item-10845593-26f7-485a-bef7-cf9b9b0cf9fe.png"/>
        <ctl:MenuItemData Title="Bluetooth" TargetUrl="bluetooth" Image="/Images/Item-294e2b67-5534-43b3-ae4e-aecf180c9274.png"/>
    </ctl:MenuData>
1

There are 1 best solutions below

4
On

So inorder to navigate to the native phone settings you need to use the built in URI schemes.

They can be found on MSDN here

Specifically for the ones you are asking for the codes are

ms-settings-airplanemode: Launches the Airplane Mode Settings app.

ms-settings-cellular: Launches the Cellular Settings app.

ms-settings-bluetooth: Launches the Bluetooth Settings app.

ms-settings-wifi: Launches the Wi-Fi Settings app.

replace your target url's with these and it should work