Windowns Phone 8 link to setting - windows-phone-8

Can I make link into setting in phone from my application? For example like a link to other page (NavigateTo)?
I would like to make buttun, witch navigate you to mobile setting....
thanks for the answer.

Check this link. You can do that by invoking LaunchUriAsync method passing one of available settings Uri as parameter :
public async void OpenSettings(string settingsName)
{
var op = await Windows.System.Launcher.LaunchUriAsync(new Uri(settingsName));
}
Available Uri :
1. ms-settings-airplanemode: .
2. ms-settings-bluetooth:
3. ms-settings-cellular:
4. ms-settings-emailandaccounts:
5. ms-settings-location:
6. ms-settings-power:
7. ms-settings-screenrotation:
8. ms-settings-wifi:

Related

I am not able to redirect registered user to dashboard page with link

if (response.success) {
this.redirectURL = response.data.loginUrl;
// this.URL='http://'+location.host+'/login'+'/'+this.redirectURL;
this.router.navigate(['/login?token=', this.redirectURL]);}
Here is the code ,it should move me to cognito page but its moving to login page in angular I am not sure where I am wrong
use +(plus) instead of ,(comma)
this.router.navigate(['/login?token='+this.redirectURL]);}
If you want to use query params, you can also adopt this approach.
this.router.navigate(['login'], { queryParams: { token: 20 } });
Most likely the reason behind the issue you are facing is that the comma-separated navigation turns to slash-separated one, e.g.
let redirectURL = '1234'
this.router.navigate(['/login?token=', redirectURL])
// this line above results to /login?token=/1234'
So in order to avoid that you should either use the solution that I suggest or the one mentioned by abhishek sahu, where the usage of + for concatenation is encouraged.

Add #id suffix to RedirectToAction() in controller ASP NET MVC

Somehow I find this hard to describe, but here I go:
I have a div in my SelectClasses Razor view page with an id="id152".
In order for me to show that div on the page at reload, I have to add the suffix #id152 to my page url.
<div id="id152">blabla</div>
...
..
Section 7
Now my question: Is there a way to add/pass this suffix to a 'RedirectToAction()'?
public ActionResult Index()
{
//All we want to do is redirect to the class selection page and add a suffix
return RedirectToAction("SelectClasses", "Registration", new { id = 99 })); //add suffix here somewhere
}
So when my SelectClasses view is shown, the url looks something like this:
'[url]/SelectClasses/99#id152'
The RedirectToActionResult (among the rest of RedirectTo* results) is meant to be used for generation of URLs based on registered routing data.
In your case, you wish to concatenate a hash parameter value (#id152) that is not being sent to the server and only used by the browser. That's why said methods don't bother dealing with it.
I suggest you do this instead:
var redirUrl = Url.Action("SelectClasses", "Registration", new { id = 99 });
redirUrl = String.Concat(redirUrl, "#id152");
return Redirect(redirUrl);

Xamarin Forms: Html label is showing blank content in ios

I am using Xam.Plugin.HtmlLabel for showing data on my project. It is working fine on android and windows. But nothing is showing in ios devices.
My code:
<htmllabel:HtmlLabel
x:Name="message_label"
VerticalOptions="Start"
VerticalTextAlignment="Center"
TextColor="Black">
<htmllabel:HtmlLabel.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>20</OnIdiom.Phone>
<OnIdiom.Tablet>30</OnIdiom.Tablet>
<OnIdiom.Desktop>20</OnIdiom.Desktop>
</OnIdiom>
</htmllabel:HtmlLabel.FontSize>
</htmllabel:HtmlLabel>
message_label.Text = "htmldata";
I have uploaded a sample here for the reference.
In your case , you seems forget to init the renderer in specific platforms .
in iOS
using LabelHtml.Forms.Plugin.iOS;
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
HtmlLabelRenderer.Initialize();
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
I used the tag <u> to add under line of the label .
You could check the demo from https://github.com/luczha/HtmlLabel_demo .

hash key "#" stripped from ussd code in "tel:" links on html pages

Good day all.
I have a simple link on a webpage, in where the user can call an USSD number:
*CLICK HERE AND CALL *111*2#
this is pretty straight forward; now, if I test it on desktop browser, it popups an alert asking me if I want to call (with skype) the number *111*2#, and thats ok.
with my Android phone (S Note 3), when testing this page, the phone (or something) stripped out the last "#" (only the last) from the link, resulting in a call to *111*2.
does anyone has experienced this? or knows how to prevent this?
Use URL encoding for special character in a URL. For example # equals %23
This worked for me:
<a ng-href="tel:%23 224">#224</a>
As you can see:
You need to use Uri.encode("#")
For example String number = "tel:*111*2" + Uri.encode("#");
Try this way,hope this will help you to solve your problem.
webview = (WebView) findViewById(R.id.webview);
webview.loadData("*CLICK HERE AND CALL *111*2#","text/html", "utf-16");
webview.setWebViewClient(new CustomWebViewClient());
private class CustomWebViewClient extends WebViewClient {
#Override
public boolean shouldOverrideUrlLoading(WebView wv, String url) {
if(url.startsWith("tel:")) {
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse(url.replace("#","%23")));
startActivity(intent);
return true;
}
return false;
}
}
You can use below way to display the USSD in dialer
*CLICK HERE AND CALL *111*2#

how to search a name of text-file c# windows phone

I'm a newbie wp dev. I want to create a many text file name like 1.text 2.text 3.text ......1760.text and I want user to type the number in text box then click the button and the result is read that typed number.text. how can I do it ? please help
you can try this method:
1. put these txt-files into a path,like:TxtFiles/1.txt,2.txt...
2. when user type the number and click button, execute a method to combine file-path and read the file. and you should check the number first.
StreamResourceInfo resourceInfo = Application.GetResourceStream(new Uri(string.Format("yourFilePath/{0}.txt",userTypedNumber), UriKind.Relative));
using (StreamReader reader = new StreamReader(resourceInfo.Stream))
{
yourContentControl.Text = reader.ReadToEnd();
reader.Close();
}