Example #1
0
        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            //if (Frame.BackStack.Count != 0 && Frame.BackStack.First().SourcePageType == typeof(LoginPage))
            //    Frame.BackStack.Remove(Frame.BackStack.First());
            // TODO: Create an appropriate data model for your problem domain to replace the sample data
            //var sampleDataGroups = await SampleDataSource.GetGroupsAsync();
            //this.DefaultViewModel["Groups"] = sampleDataGroups;
            //var posts = await Posts.GetActivities(null, null, null);
            //FontIcon icon = new FontIcon();
            //icon.Glyph = (await Notifications.GetNotificationCount()).ToString();
            //notificationAppBarButton.Icon = icon;
            //itemGridView.ItemsSource = posts.posts;
            var squares = await Squares.GetSquares();

            //communitiesGridView.Source = squares;
            communitiesHub.DataContext = squares;
            var circles = await Circles.GetCircles();

            circlesHub.DataContext = circles;
            FontIcon icon = new FontIcon();

            icon.Glyph = (await Notifications.GetNotificationCount()).ToString();
            notificationAppBarButton.Icon = icon;
            favouritesHub.DataContext     = commands;
        }
Example #2
0
        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            var squares = await Squares.GetSquares();

            itemsViewSource.Source = squares;
            // TODO: Assign a bindable collection of items to this.DefaultViewModel["Items"]
        }
Example #3
0
        /// <summary>
        /// Populates the page with content passed during navigation. Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session. The state will be null the first time a page is visited.</param>
        private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            reshareId = e.NavigationParameter as string;
            List <AclItem> items = new List <AclItem>();

            items.Add(new AclItem(null, null, "Public", AclType.Public));
            items.Add(new AclItem(null, null, "Your circles", AclType.YourCircles));
            var circles = await Circles.GetCircles();

            foreach (var c in circles)
            {
                items.Add(new AclItem(c.id, null, c.name, AclType.SpecifiedCircle));
            }
            aclListBox.ItemsSource = items;

            var squares = await Squares.GetSquares();

            foreach (var c in squares)
            {
                items.Add(new AclItem(c.id, null, c.name, AclType.Square));
            }
            squaresListBox.ItemsSource = await Squares.GetSquares();

            ObservableCollection <string> emoticons = new ObservableCollection <string>();

            emoticons.Add("frustrated");
            emoticons.Add("crying");
            emoticons.Add("happy");
            emoticons.Add("angry");
            emoticons.Add("scared");
            emoticons.Add("joy");
            emoticons.Add("kiss");
            emoticons.Add("lol");
            emoticons.Add("meh");
            emoticons.Add("sad");
            emoticons.Add("sick");
            emoticons.Add("silly");
            emoticons.Add("smirk");
            emoticons.Add("wink");
            emoticons.Add("worried");
            emoticons.Add("winter");
            emoticons.Add("new_year");
            emoticons.Add("valentines_day");
            emoticons.Add("st_paddys_day");
            emoticons.Add("spring");
            emoticonsComboBox.ItemsSource = emoticons;
        }
Example #4
0
        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            //Other.info
            reshareId = e.NavigationParameter as string;
            items     = new List <AclItem>();

            items.Add(new AclItem(null, null, "Public", AclType.Public));
            items.Add(new AclItem(null, null, "Your circles", AclType.YourCircles));
            var circles = await Circles.GetCircles();

            foreach (var c in circles)
            {
                items.Add(new AclItem(c.id, null, c.name, AclType.SpecifiedCircle));
            }
            //aclListBox.ItemsSource = items;
            var squares = await Squares.GetSquares();

            foreach (var c in squares)
            {
                items.Add(new AclItem(c.id, null, c.name, AclType.Square));
            }
            //squaresListBox.ItemsSource = await Squares.GetSquares();
            aclItemFlyout.ItemsSource = items;
            authorAvatar.Source       = new BitmapImage(new Uri(Other.info.avatar));
            authorName.Text           = Other.info.name;
            emoticons = new ObservableCollection <string>();
            emoticons.Add("frustrated");
            emoticons.Add("crying");
            emoticons.Add("happy");
            emoticons.Add("angry");
            emoticons.Add("scared");
            emoticons.Add("joy");
            emoticons.Add("kiss");
            emoticons.Add("lol");
            emoticons.Add("meh");
            emoticons.Add("sad");
            emoticons.Add("sick");
            emoticons.Add("silly");
            emoticons.Add("smirk");
            emoticons.Add("wink");
            emoticons.Add("worried");
            emoticons.Add("winter");
            emoticons.Add("new_year");
            emoticons.Add("valentines_day");
            emoticons.Add("st_paddys_day");
            emoticons.Add("spring");
            if (reshareId != null)
            {
                /*
                 * Line 1: this extracts the data we want from the shared data bundle (ShareOperation.Data)
                 * sent to our app. In this example we knew we could only receive a hyperlink, so we just went
                 * and extracted a hyperlink. You can alternately use ShareOperation.Data.Contains() to determine
                 * if the data you want is present (e.g. if your app can receive different data types).
                 */
                moodButton.IsEnabled = linkButton.IsEnabled = cameraButton.IsEnabled = locationCheckBox.IsEnabled = false;
            }
            if (e.NavigationParameter != null)
            {
                operation = (ShareOperation)e.NavigationParameter;
                if (operation.Data.Contains(StandardDataFormats.WebLink))
                {
                    link = operation.Data.GetWebLinkAsync().GetResults().ToString();
                    moodButton.IsEnabled = linkButton.IsEnabled = cameraButton.IsEnabled = locationCheckBox.IsEnabled = false;
                }
                else if (operation.Data.Contains(StandardDataFormats.Text))
                {
                    contentTextBox.Text = operation.Data.GetTextAsync().GetResults().ToString();
                }
                else if (operation.Data.Contains(StandardDataFormats.StorageItems))
                {
                    var file = (StorageFile)(await operation.Data.GetStorageItemsAsync()).FirstOrDefault();
                    imageContent = await Other.StorageFileToBase64(file);

                    //BitmapImage img = new BitmapImage();
                    //img.SetSource(await file.OpenReadAsync());
                    //ImagePhoto.Source = img;
                }
            }
            //emoticonsComboBox.ItemsSource = emoticons;
        }