Windows Phone 8.1 open link in other app - c#

I have a program which can show some links (music/video/ etc....).
I want when Clicked on download button, my app send that link to UC Downloader for download. I can open link with Internet Explorer but I want open in UC Downloader.

You can launch an app from your code if you know. From the msdn :
By using the association launching API, your app can automatically launch another app by launching a custom URI. To do this, use the Launcher.LaunchUriAsync(Uri) method from the Launcher object of the Windows.System namespace. For example, the following code launches a fictitious Contoso app to display new products.
Example :
private async void LaunchContosoNewProductsButton_Click(object sender, RoutedEventArgs rea)
{
// Launch URI.
Windows.System.Launcher.LaunchUriAsync(new System.Uri("contoso:NewProducts"));
}
You can find a tutorial here.

Here's how.
Windows.System.Launcher.LaunchUriAsync(new Uri("uc-url:http://www.microsoft.com"));

private async void Button_Click(object sender, RoutedEventArgs e)
{
string uriToLaunch = #"http://www.bing.com";
var uri = new Uri(uriToLaunch);
var success = await Windows.System.Launcher.LaunchUriAsync(uri);
}
In windows phone 8.1

Related

UWP/C# LaunchUriAsync Size issues

Sorry for the mess of a title.
Ive got the following C# script handling an Async Button press:
private async void CalcButton_ClickAsync(object sender, RoutedEventArgs e)
{
await Windows.System.Launcher.LaunchUriAsync(new Uri("calculator:"));
}
Issue i have is that the calculator is loading up the exact same size as the main program window. I was wondering if there is a way to over-ride the sizing of the launched windows, i want the calculator to open up as small as possible really.
Come to think of it, i think every popup windows is doing this (save/open file dialogues) any thoughts/suggestions would be amazing
You can request the desired remaining view. Keep in mind that it is specifying the remaining view of the app that is launching the calculator... not the size of the calculator app.
link here
private async void LaunchCalculator(object sender, RoutedEventArgs e)
{
var options = new Windows.System.LauncherOptions();
options.DesiredRemainingView = Windows.UI.ViewManagement.ViewSizePreference.UseMore;
await Windows.System.Launcher.LaunchUriAsync(new Uri("calculator:"), options);
}

ShareStatusTask doubles Status on WP8.1 Facebook share

I have a simple C# WP8.0 application from where I launch, on a button click, the ShareStatusTask.
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
var task = new ShareStatusTask { Status = "Test message", };
task.Show();
}
When I choose to share on Facebook, Messaging, OneNote etc everything works fine on a WP8 device.
The same application running on a WP8.1 device doubles the Status text only on Facebook share.
I would like to have same behavior as on WP8. What am I missing here?
I ended up using ShareLinkTask instead of ShareStatusTask. Lucky me I needed anyway to add a link to the message.

Managing _blank links

I'm using xulrunner to show some content from a website, it works perfectly for the most, but we have included a facebook like box with stream (div+javascript), and clicking on any link in it does nothing.
We would like to open it in a new window of the default browser, it's possible?
the code for the xulrunner is pretty simple
private void Form_browser_Load(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Maximized;
geckoBrowser.Navigate(Properties.Settings.Default.redirect);
}

Windows Phone 8 Webbrowser (zoom)

I'm creating a Windows Phone 8 app, but I'm stuck at the last part...
It's an app to view the calendars on school: see calendar
Now I open the link of every class (I have the changes for every class, but it opens small... What can I do to solve this ? (See picture) + I can't acces the website codes.
See the picture:
I only want the calendar of the website and not the rest at the left side.
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser1.Document.Body.Style = "zoom:300%;";
}
assuming webBrowser1 is the name of your control

Facebook Like button doesn't work in GeckoFX browser

I wanted to implement the Facebook Like button into my C# application using the Web Browser control but i encountred a problem with Internet Explorer (After clicking on like button, the facebook login popup appears) but iexplore block and ask me whether to recover the page.
Therfore, i downloaded geckoFx to embed Mozilla on my application instead of the in built Web Browser control ! But now when i click on the Like button on the Gecko browser, i get a blank page. And when i right click the page to view the source i don't see anything (blank page)
Maybe the problem is either the GeckoFX browser doesn't support Popups or doesn't support Javascript
How to implement Facebook Like Button inside GeckoFX browser in C# Windows Forms ?
I'm using XUL runner 1.9.1.19
New Windows and tabs are not handled automatically. You need to create events for those:
private void webBrowser_CreateWindow(object sender, GeckoCreateWindowEventArgs e) {
e.WebBrowser = NewWindow();
}
private void webBrowser_CreateTab(object sender, GeckoCreateTabEventArgs e) {
e.WebBrowser = NewWindow();
}
private GeckoWebBrowser NewWindow() {
BrowserForm frm = new BrowserForm();
frm.Show();
return frm.WebBrowser;
}
Here BrowserForm must contain a public property that points to the GeckoWebBrowser control.

Categories