Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8858949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:56:33+00:00 2026-06-14T14:56:33+00:00

I’m currently working on an app and am having some architectural confusions. I’m implementing

  • 0

I’m currently working on an app and am having some “architectural confusions”.

I’m implementing my own (very simple) MVVM pattern, which ideally will only have one instance and will be updated about every 60 seconds.

When doing Xaml (Silverlight) in Windows Phone 7 on a previous App, I was able to put the ViewModel in my App class (where the application begins), I was then able to access this one model throughout the whole app after the initial loading process was done.

I’ve been searching the interwebs and downloading tutorials/samples to see if anywhere can provide a definitive answer for Windows 8 Store Apps.

And now I’m wondering if this is the correct way of working in Windows 8 Store Apps?

Here are a couple of ways of working that I have explored:

  • Having the ViewModel in the MainPage.cs file, then on each navigate method I have been passing the ViewModel as a page parameter for the next page to use.
  • Having the ViewModel in the App.cs file, tried this but can’t seem to access this from any other page
  • Having a static ViewModel class, which holds all of the information for the application. Not seen any other projects/samples which have done this so I’m a bit reluctant to “break away” from the norm and do this.

I’m sure this has been thought about and there is a way of doing this in Windows 8 Store Apps, however I’m stuggling to find a definitive answer and many of the official (MSDN) samples/tutorials that I have come across do not really address this issue. Many of the samples seem to cover very small aspects of the available APIs.

In summary: How can I build a Windows 8 Store Application and have one ViewModel that I all pages can bind to/use throughout the whole application?? Would this require an architectural change in terms of the Application and how the data is stored or is there a way i’ve missed that can make my ViewModel global?

Thanks again 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:56:34+00:00Added an answer on June 14, 2026 at 2:56 pm

    In general most applications use a different view model for each page, so you don’t often see examples with a shared view-model. It may be better using a separate view model for each view (with page specific code), but a shared data model.

    If you really want to make your ViewModel shared between all pages you could try a static ‘Instance’ property on your ViewModel (rather than a static class).

    For example,

    public class MyViewModel
    {
        private static MyViewModel instance;
    
        private MyViewModel()
        {
            // Private constructor
        }
    
        public static MyViewModel Instance
        {
            get
            {
                if (instance == null)
                    instance = new MyViewModel();
    
                return instance;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
We're building an app, our first using Rails 3, and we're having to build
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.