passing value from one page to another - silverlight

i m new developer to mobile apps and working on silverlight.
i want to knw how to pass value from textbox on one page to textbox on another page in mobile windows apps not in web apps using silverlight in c#.

So many options for this one:
Add variables to your app class
Global variable anywhere in the app (yuk)
Use a shared ViewModel if you are following the MVVM pattern
Store in App.Resource settings (these are easily bound to)
There is a shared app data store specifically for binding, but I can't remember what it is called or if it is in the mobile version (anybody?).
What are you doing with this value that is shared between to pages? The usage determines where/how it should be stored.

Related

Is Page Object Pattern suitable for Windows Application

I have read that Page Object Pattern is suitable for the Web Application Automation and I have used the Page object pattern with Selenium for one of the Web Apps I have automated.
How ever I am curious to know is Page Object suitable to Windows/Desktop applications ?. Though there is a scope in Windows Apps as well to create different Top level Windows as Pages and expose the operations as methods.
Has any one tried this and want to know the experiences/Advantages/disadvantages
The key equivalence here is page <=> dialog.
In a web app you encapsulate each page in a page object, while in a desktop app you encapsulate each dialog in an object that you might call a "dialog object".
The point is the encapsulation.
Over at my blog I've written about DRY page objects for testing web apps, but if you substitute dialog for page, it will apply equally well to dialog objects for desktop apps:
-- Keep Your Page Objects Clean and DRY
yes we can automate the desktop based application with Page object. you can refer WinAppDriverPageObjectModel

Silverlight object persistence

Is it possible to have the same Silverlight object host persist in memory as the user traverses our site? I'm interested in having my Silverlight objects stick around from page to page.
Using IE7.
In short: No.
Typically to achieve this you make the decision that the Silverlight application is your site (or at least a complete segment of your site) and use Silverlight Navigation framework to allow the user to navigate from "page to page" within the application. Where "page" refers to various Xaml pages within a single Silverlight application.
As a workaround, you could store the object in JSON or XML in the IsolatedStorage for the Site (not the application) and use the built in serialization methods to work with the object. Then just check for its existence for each app that is loaded.

Multi-shell application?

I am new to Prism.
Imagin a scenario where you want to develop a multi-region application, but there should are many types of screens and I want those regions to be in one screen only, whereas, for instance in the HomePage which is the application map (like in QuickBooks, see image bellow), there should be no regions, and the whole layout should be different.
Also I want that the application should be available for registered users only; unregistered users are automatically forwarded to the LoginView, and they're not supposed to see the regions etc.
How are these two aspects achieved?
I think I am going to implement the entire application using View-Based Navigation.

Windows Phone 7 - Using the Application bar and Prism (or MVVM)

I am playing around with the WP7 SDK and the Prism for WP7 beta and have come across a problem I can't figure out (or even a workaround for).
First of all, I'm new into WPF/Silverlight/WP7 and Prism, so I could be overlooking something very obvious.
So I have a Shell page that has my region that is used to hold my content pages, and all of this is working great! Now my problem is that I have a settings control that will allow the users to edit the settings of the application (names, locations, etc). Now I can get this page to work with no problems by having a button on one of my controls that will transition the region manager to the control.
However, I would like to use the application bar on the phone to have the button, but I cannot for the life of me figure out how to get access to my model object from within the page that is opened by the Application bar click. I can only do a NavigationService.Navigate() to a settings page, but the PhoneApplicationPage objects in WP7 do not allow injection on the constructors (the constructors must be parameterless) so I cannot pass in the object instance in that way.
So my question is, how can I access (or pass) objects between pages or controls?
Thanks!
In the examples they use this technique to set the data context of a form after it is navigated to from another form:
NavigationService.Navigate(new Uri("/Page2.xaml", UriKind.Relative));
FrameworkElement root = Application.Current.RootVisual as FrameworkElement;
root.DataContext = some_object;

Silverlight 4.0 IsolatedStorageFile

How to view all the content in my IsolatedStorageFile by setting a new page in your browser?
Thank you
I'm not sure what "setting a new page in your browser" has to do with it. I assume you are refering perhaps to the loading of a different Silverlight app from the site.
There are two Isolated Stores one per application and one per site. If you do mean moving from one app to another then you will only be able to share the site store between them.
You can get access to the site store with IsolatedStorageFile.GetUserStoreForSite().
Enumeration of Directories and Files in the store are preformed with the methods GetDirectories() and GetFiles(). Try having a read through the documentation here.

Resources