public MainPage() { this.InitializeComponent(); this.navigationHelper = new NavigationHelper(this); this.navigationHelper.LoadState += this.NavigationHelper_LoadState; this.navigationHelper.SaveState += this.NavigationHelper_SaveState; this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Required; // Set the data context to the friendsData global variable AppServices.friendsData._page = this; AppServices.friendsData.myUsername = AppServices.localUsername; DataContext = AppServices.friendsData; AppServices.mainPage = this; WarpClient.initialize(AppServices.apiKey, AppServices.secretKey); WarpClient.setRecoveryAllowance(AppServices.appWarpRecoveryTime); AppServices.warpClient = WarpClient.GetInstance(); AppServices.warpClient.AddConnectionRequestListener(AppServices.connListenObj); AppServices.warpClient.AddNotificationListener(AppServices.notificationListnerObj); AppServices.warpClient.AddUpdateRequestListener(AppServices.updateListenerObj); // Connect to Appwarp and update our online friends in the callback AppServices.appWarpConnectMode = appWarpConnectModes.sendAllUpdates; WarpClient.GetInstance().Connect(AppServices.localUsername); }
public AddFriendPage() { this.InitializeComponent(); this.navigationHelper = new NavigationHelper(this); this.navigationHelper.LoadState += this.NavigationHelper_LoadState; this.navigationHelper.SaveState += this.NavigationHelper_SaveState; // Get the NFC chip for this device this.InitializeProximityDevice(); }
public ChatPage() { this.InitializeComponent(); this.navigationHelper = new NavigationHelper(this); this.navigationHelper.LoadState += this.NavigationHelper_LoadState; this.navigationHelper.SaveState += this.NavigationHelper_SaveState; this.DataContext = AppServices.friendsData; AppServices.friendsData.chatHistory.CollectionChanged += (s, args) => ScrollToBottom(); }
//private ObservableDictionary defaultViewModel = new ObservableDictionary(); public LoginPage() { this.InitializeComponent(); this.navigationHelper = new NavigationHelper(this); this.navigationHelper.LoadState += this.NavigationHelper_LoadState; this.navigationHelper.SaveState += this.NavigationHelper_SaveState; AppServices.friendsData._page = this; // Create the default encryption key IBuffer keyBuffer = CryptographicBuffer.ConvertStringToBinary(AppServices.secretKey, BinaryStringEncoding.Utf8); AppServices.defaultEncryptionKey = AppServices.encryptionAlgorithim.CreateSymmetricKey(keyBuffer); }