53 lines
1.9 KiB
C#
53 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Navigation;
|
|
using Microsoft.Phone.Controls;
|
|
using Microsoft.Phone.Shell;
|
|
using CampusAppWP8.Resources;
|
|
|
|
namespace CampusAppWP8
|
|
{
|
|
public partial class MainPage : PhoneApplicationPage
|
|
{
|
|
// Konstruktor
|
|
public MainPage()
|
|
{
|
|
InitializeComponent();
|
|
|
|
// Datenkontext des Listenfeldsteuerelements auf die Beispieldaten festlegen
|
|
DataContext = App.ViewModel;
|
|
|
|
// Beispielcode zur Lokalisierung der ApplicationBar
|
|
//BuildLocalizedApplicationBar();
|
|
}
|
|
|
|
// Daten für die ViewModel-Elemente laden
|
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
|
{
|
|
if (!App.ViewModel.IsDataLoaded)
|
|
{
|
|
App.ViewModel.LoadData();
|
|
}
|
|
}
|
|
|
|
// Beispielcode zur Erstellung einer lokalisierten ApplicationBar
|
|
//private void BuildLocalizedApplicationBar()
|
|
//{
|
|
// // ApplicationBar der Seite einer neuen Instanz von ApplicationBar zuweisen
|
|
// ApplicationBar = new ApplicationBar();
|
|
|
|
// // Eine neue Schaltfläche erstellen und als Text die lokalisierte Zeichenfolge aus AppResources zuweisen.
|
|
// ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
|
|
// appBarButton.Text = AppResources.AppBarButtonText;
|
|
// ApplicationBar.Buttons.Add(appBarButton);
|
|
|
|
// // Ein neues Menüelement mit der lokalisierten Zeichenfolge aus AppResources erstellen
|
|
// ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
|
|
// ApplicationBar.MenuItems.Add(appBarMenuItem);
|
|
//}
|
|
}
|
|
} |