1

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>
user2127925
  • 67
  • 1
  • 7
  • Where is your code? What is the exact error it's showing? Stack overflow is very structured. Goal - Problem - What you've tried - Errors you've received - Stack Trace - Question. It is formatted this way so that people with similar issues in the future can find your question and any answers it generated. Please reformat your question and I will happily answer it. – DotNetRussell Dec 28 '13 at 00:36
  • Thank you for making the requested edits. I will look into this problem now and get back to you shortly – DotNetRussell Dec 28 '13 at 00:54
  • So when you say navigate to settings I am assuming you mean the ones built into the phones actual settings and not something you made in your app correct? – DotNetRussell Dec 28 '13 at 00:58
  • Yes the phones settings – user2127925 Dec 28 '13 at 00:58
  • what is this: selectedShortcutsMenuControl ? – crea7or Dec 28 '13 at 01:01
  • A selected item from an ListBox with the data you can see above in MenuItemData – user2127925 Dec 28 '13 at 01:03
  • If the answer below works for you please do not forget to upvote and check mark it as a working answer. Thanks – DotNetRussell Dec 28 '13 at 01:15

1 Answers1

1

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

DotNetRussell
  • 9,716
  • 10
  • 56
  • 111
  • I tried it navigation inside the app works this way. But creation of the livetitle still is not working: system.ArgumentException – user2127925 Dec 28 '13 at 01:32
  • 1
    After doing some research it appears that any live tile created by your app must point to your app. I would suggest creating a page that when navigated to launches the settings. It is an easy hack and shouldnt be noticeable to the user. – DotNetRussell Dec 28 '13 at 01:58
  • I dont understand what you are asking. Is there an example you can give? – DotNetRussell Dec 28 '13 at 02:26
  • Okay that is a separate question than what you posted. Please create a new question that is about navigating between pages. – DotNetRussell Dec 28 '13 at 02:45