ShareStatusTask doubles Status on WP8.1 Facebook share - c#

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.

Related

Xamarin Media Plugin Auto start or Timer

In my iOS Xamarin forms project I'm using Xam.Plugin.Media from https://github.com/jamesmontemagno/MediaPlugin as follows
async void Handle_Clicked(object sender, System.EventArgs e)
{
await CrossMedia.Current.Initialize();
var file = await CrossMedia.Current.TakeVideoAsync(new Plugin.Media.Abstractions.StoreVideoOptions
{
DefaultCamera = CameraDevice.Front,
SaveToAlbum = true,
});
}
Is it possible to automatically start video recording or set a timer for the recording to start?
Ultimately, I'm trying to build a lightweight remotely controllable camera app. So the device whose camera is controlled needs to be able to automatically trigger/start the camera.
Any hint appreciated.
You can't start a video or take a photo without user interaction with Xamarin Media Plugin.
At the following link you can find all StoreVideoOptions where offered
https://github.com/jamesmontemagno/MediaPlugin/blob/master/src/Media.Plugin/Shared/MediaStoreOptions.cs

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);
}

Windows Phone Universal App MediaCapture alternatives

I have a big problem with Universal App's MediaCapture. In this link I found that the problem might be the update installed on the phone which goes in conflict with this class.
I tryed some phones and all phones with Windows phone 8.1 Update crushes on MediaCapture initializing. No errors, just the phone quits the app.
In this article they said that it is due to a bug which closes the camera stopping the application.
Now, my problem is to find an alternative to MediaCapture, because half phones I need are with update 1 and half with update2 and I can't develop the app only for half customers.
Does any of you knows an alternative class?
PS: phones where app crushes have this update: 8.10.14219.341
Thanks all and sorry for my not perfect english.
Have you looked into using CameraCaptureTask instead? It can be as simple as this:
CameraCaptureTask cameraCaptureTask;
cameraCaptureTask = new CameraCaptureTask();
cameraCaptureTask.Completed += new EventHandler<PhotoResult>(cameraCaptureTask_Completed);
cameraCaptureTask.Show();
And then this is what you can do when the user is done capturing:
void cameraCaptureTask_Completed(object sender, PhotoResult e)
{
if (e.TaskResult == TaskResult.OK)
{
MessageBox.Show(e.ChosenPhoto.Length.ToString());
//Code to display the photo on the page in an image control named myImage.
System.Windows.Media.Imaging.BitmapImage bmp = new System.Windows.Media.Imaging.BitmapImage();
bmp.SetSource(e.ChosenPhoto);
myImage.Source = bmp;
}
}

Windows Phone 8.1 open link in other app

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

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

Categories