0
votes

I have two simple questions since I'm very new to Windows Phone programming:

1: How do I cange the root frame, or show a different Page on startup, in a Windows Phone 8.1 Silverlight application? I have a LoginPage and then I want to check if the user is logged in show MainPage as root frame and if the user is not logged in show the LoginPage.

2: Windows Phone Silverlight applications seems so different to me compared to the Windows Phone WinRT applications, or maybe I'm just not experienced enough. For example I can't put a placeholder/hint text in a textBox in Silverlight but it's super easy in WinRT, why is it like that? Isn't that something very basic that many IDE's implements? Or have I missed something mayor when I'm developing a Silverlight application for Windows Phone?

I know that Windows Phone WinRT is used to create universal apps and Silverlight is used to create only mobile apps for Windows Phone, but why is developing a mobile app in Silverlight so much different (at least to me) compared to build a Windows Phone app i WinRT?

2

2 Answers

1
votes

For your first question, use the UriMapper. The basic principle is that you check if the user is logged in or not and based on that, navigate to the correct view.

The code is not all that complicated, there is a very good tutorial up on Shawn Kendrot his blog here...

For question 2, how to add some sort of hint/watermark can be done in several different ways. But a very simple version is presented on MSDN here... it uses events to set and clear the watermark.

0
votes

Point 1 You have to go to Package.appxmanifest and under the tab called Application the second field contains the startup page name. Currently it should be MainPage.xaml, just change it to LoginPage.xaml.

enter image description here

Point 2 I don't quite understand your question. Silverlight and Windows Runtime are two different platforms, they have in fact many different libraries. The goal of Windows Runtime is to run the same application on several different devices, so different hardware requirements and different resolutions. It was a need to organize the environment differently and of course Microsoft added some minor changes such as the hint text (e.g.).

What is so different to you? I did the porting of an app from SL to WinRT but it's not difficult nor tricky at all.