コード例 #1
0
       // private ObservableDictionary defaultViewModel = new ObservableDictionary();
       // private readonly ResourceLoader resourceLoader = ResourceLoader.GetForCurrentView("Resources");
        public StartScreen()
        {
            this.InitializeComponent();

            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState += this.NavigationHelper_SaveState;
            vm = ViewModel.returnMyViewModel();
            
        }
コード例 #2
0
        public ItemPage()
        {
            this.InitializeComponent();

            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState += this.NavigationHelper_SaveState;
            vm = ViewModel.returnMyViewModel();                                         //creating an instance of ViewModel
            this.DataContext = vm;                                                      // for data binding
            
        } 
コード例 #3
0
 public PivotPage()
 {
     this.InitializeComponent();
     this.NavigationCacheMode = NavigationCacheMode.Required;
     this.navigationHelper = new NavigationHelper(this);
     this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
     this.navigationHelper.SaveState += this.NavigationHelper_SaveState;
     vm = ViewModel.returnMyViewModel();
     this.DataContext=vm;
     
 }
コード例 #4
0
 public static ViewModel returnMyViewModel()
 {
     return myViewModel ?? (myViewModel = new ViewModel());                  // singleton
 }