SupportedOrientations unavailable in XAML of windows phone 8.1 app? - xaml

What is the equivalent of this in Windows Phone 8.1 App. When I create a new app, there is no more phone:ApplicationPage
<phone:PhoneApplicationPage
...
...
SupportedOrientations="Landscape" Orientation="LandscapeLeft"
shell:SystemTray.IsVisible="False">

You can force the orientation of any page via code, writing just after the this.InitializeComponent():
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;
or
DisplayInformation.AutoRotationPreferences = DisplayOrientations.LandscapeFlipped;
or
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait;

Yes, In windows phone 8.1, We can't set supportedOrientations in page's XAML. We can set supportedOrientations of App in Package.appxmanifest only.

Related

Xamarin forms win phone silverlight 8.1 Toast notifications not working

I am trying to make a toast notification show in a Xamarin Forms, windows phone 8.1 silverlight project. Inside the Windows Phone project I have a method that creates a toast notification, however, nothing happens when it is executed. No error is thrown everything seems to execute correctly but nothing happens on the phone.
I have tested it on an emulator and an actual cell phone. Everything I have found online until now is practically the same as what I have (with slight differences, but nothing that should make a difference).
The code in the method is the following:
private void CreateNotification(string title, string message)
{
ToastNotifier toastNotifier = ToastNotificationManager.CreateToastNotifier();
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
toastTextElements[0].AppendChild(toastXml.CreateTextNode(title));
toastTextElements[1].AppendChild(toastXml.CreateTextNode(message));
ToastNotification toast = new ToastNotification(toastXml);
toast.ExpirationTime = DateTimeOffset.UtcNow.AddSeconds(5);
toastNotifier.Show(toast);
}
Any help would be greatly appreciated.
Thanks in advance!
If you are using Xamarin Forms there is a NuGet package: https://www.nuget.org/packages/Toasts.Forms.Plugin/
It doesn't use the standard toast notification system in windows phone though as it needed to expand beyond it.
As for showing Toast Notifications have you set Toast Capable to Yes in your Package.appxmanifest?

MessageDialog ignores RequestedTheme in windows phone universal app

In my application I set Light theme as requested theme App.Current.RequestedTheme = ApplicationTheme.Light; all the application is applying this Light theme no matter what is the current phone theme. But all MessageDialog are using Phone theme. e.g phone theme is Dark MessageDialog is applying Dark theme.
Is there any way to set MessageDialog theme?
Try to use ContentDialog for Windows Phone part of Universal app, for Windows part use Flyout or Popup

How to open store of windows phone when clicking the button in wp8

i have developing an app in windows phone 8 visual studio 2012 and xaml
i have a requirement to open a windows store from my app button click
please tell me how to open windows phone store from my app
To open Windows Phone Store, You can use MarketplaceHubTask like this:
add namespace:
using namespace Microsoft.Phone.Tasks;
and the C# code:
MarketplaceHubTask task = new MarketplaceHubTask();
task.Show();
MarketPlaceDetailTask is documented as able to go to the current application's page in the windows phone store. If you wanted to navigate to a paricular app's page try this out.
Or else if you want to naviagate to the windows phone store use the WebBrowserTask.
MarketplaceDetailTask marketplaceDetailTask =
new MarketplaceDetailTask
{
//give the app id as your ContentIdentifier
ContentIdentifier = null,
ContentType = MarketplaceContentType.Applications
};
marketplaceDetailTask.Show();
Hope it helps :)
Try this if it works
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.Uri = new Uri("www.windowsphone.com/store");
webBrowserTask.Show();

Use a DrawingSurface with the 3D Starter Kit WP8

The default Windows Phone 8 D3D + XAML template works fine with a DrawingSurface. However the 3D Starter Kit does not.
The problem is that it seems to be that the C++ is returning a IDrawingSurfaceBackgroundContentProvider instead of the DrawingSurface equivalent.
I've attempted to change the 3D Starter Kit sample to be closer to the normal template, but am just getting errors.
Does anyone know how to do this?
If you create the Visual C++ Windows Phone Template, Windows Phone Direct3D with XAML app, you'll see that it uses a DrawingSurfaceBackgroundGrid.
It's the Visual C# Windows Phone template, Windows Phone XAML with Direct3D App that uses a DrawingSurface.

Tile Based UI inside windows 8 store app

I am creating window 8 store app that will run on windows 8 tablets,
In my application I want to give tile based UI,
Can any one guide, how will it be possible or is there any controls available like HubTile Control for WP7... ?
Thanks And Regards,
:)
Telerik has released the Windows 8 controls which includes the Hub tile as you mentioned for WP 7.
Check it out : http://www.telerik.com/products/windows-metro/controls/hubtile.aspx