Ejemplo n.º 1
0
		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);	
		}
Ejemplo n.º 2
0
		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();
		}
Ejemplo n.º 3
0
		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();
		}
Ejemplo n.º 4
0
        //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);
        }