Inheritance: IItemsChangedEventArgs
Ejemplo n.º 1
0
        private void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e)
        {
            if (e.Action == 1)
            {
                Position item = lstPositions.Items.Last() as Position;
                layers = new MapLayer();
                image = new BitmapImage();
                image.UriSource = (new Uri(SelectedFriend.Picture, UriKind.Absolute));

                grid = new Grid();
                grid.DataContext = item;
                grid.RightTapped += grid_RightTapped;
                textBlock = new TextBlock();
                textBlock.Text = item.Counter.ToString();
                textBlock.VerticalAlignment = VerticalAlignment.Bottom;
                textBlock.HorizontalAlignment = HorizontalAlignment.Center;
                brush = new ImageBrush();
                brush.ImageSource = image;
                ellipse = new Ellipse();
                ellipse.Height = 100;
                ellipse.Width = 100;
                ellipse.Fill = brush;
                grid.Children.Add(ellipse);
                grid.Children.Add(textBlock);
                layers.Children.Add(grid);
                MapLayer.SetPosition(grid, new Location(item.Latitude, item.Longitude));
                myMap.Children.Add(layers);
            }
        }
Ejemplo n.º 2
0
        void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e)
        {
            if (e.Action == 1)
            {
                try
                {
                    RedZone newRedZone = lstRedZones.Items.Last() as RedZone;
                layers = new MapLayer();

                image = new BitmapImage();
                image.UriSource = (new Uri(newRedZone.FbUser.Picture.data.url, UriKind.Absolute));

                brush = new ImageBrush();
                brush.ImageSource = image;
                ellipse = new Ellipse();
                ellipse.DataContext = newRedZone;
                ellipse.Height = newRedZone.Radius / 5;
                ellipse.Width = newRedZone.Radius / 5;
                ellipse.Fill = brush;
                ellipse.RightTapped += ellipse_RightTapped;

                layers.Children.Add(ellipse);
                MapLayer.SetPosition(ellipse, new Location(newRedZone.Latitude, newRedZone.Longitude));

                myMap.Children.Add(layers);
                }
                catch (Exception)
                {
                    ///ToDo
                    ///Remover la lista de usuarios que ya no se encuentran
                }
            }
        }
Ejemplo n.º 3
0
        private void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e)
        {
            if (e.Action == 1)
            {
                Friend addedFriend = (lstFriends.Items.Last() as Friend);
                layers = new MapLayer();
                image = new BitmapImage();
                image.UriSource = (new Uri(addedFriend.Picture, UriKind.Absolute));

                brush = new ImageBrush();
                brush.ImageSource = image;
                ellipse = new Ellipse();
                ellipse.DataContext = addedFriend;
                ellipse.RightTapped += ellipse_RightTapped;
                ellipse.Height = 100;
                ellipse.Width = 100;
                ellipse.Fill = brush;

                layers.Children.Add(ellipse);
                myMap.Children.Add(layers);
                MapLayer.SetPosition(ellipse, new Location(addedFriend.LastPosition.Latitude, addedFriend.LastPosition.Longitude));
            }
        }