Beispiel #1
0
 void Layer_ShapeSelectionChanged(object sender, ShapeSelectedEventArgs e)
 {
     if (e.Data != null)
     {
         NSDictionary dic = (NSDictionary)e.Data;
         displayToastWithMessage((NSString)(dic["Country"] + "\n"), (NSString)dic["Type"]);
     }
 }
        private void mapsControl1_ShapeSelected(object sender, ShapeSelectedEventArgs e)
        {
            countryListBox.Items.Clear();

            if (e.Data != null)
            {
                foreach (Countries shape in e.Data)
                {
                    countryListBox.Items.Add(shape.Country);
                }
            }
        }
Beispiel #3
0
        private void MapsTicketBooking_ShapeSelectionChanged(object sender, ShapeSelectedEventArgs e)
        {
            TicketData data = e.Data as TicketData;

            if (data != null)
            {
                // if ((this.Maps.Layers[0] as ShapeFileLayer).SelectedItems.Contains(e.Data))
                //  (this.Maps.Layers[0] as ShapeFileLayer).SelectedItems.Remove(e.Data);
                this.ClearButton.Opacity   = 1;
                this.ClearButton.IsEnabled = true;
                SelectedLabel.Text         = data.SeatNumber;
            }
        }
Beispiel #4
0
        void BookingSelectionChanged(object sender, ShapeSelectedEventArgs args)
        {
            label5.Text = layer.SelectedItems.Count.ToString();
            var    selected = layer.SelectedItems;
            string text     = "";

            if (layer.SelectedItems.Count == 0)
            {
                button4.Enabled = false;
                button4.Alpha   = (float)0.5;
            }
            for (int i = 0; i < layer.SelectedItems.Count; i++)
            {
                NSObject     item = (NSObject)layer.SelectedItems[i];
                NSDictionary dic1 = (NSDictionary)item;

                if ((NSString)(dic1["SeatNumber"]) == "1" || (NSString)(dic1["SeatNumber"]) == "2" || (NSString)(dic1["SeatNumber"]) == "8" || (NSString)(dic1["SeatNumber"]) == "9")
                {
                    selected.RemoveAt(i);
                    layer.SelectedItems = selected;
                    label5.Text         = layer.SelectedItems.Count.ToString();
                    if (selected.Count == 0)
                    {
                        button4.Enabled = false;
                        button4.Alpha   = (float)0.5;
                    }
                    else
                    {
                        if (text.EndsWith(","))
                        {
                            text = text.Remove(text.Length - 1);
                        }
                    }
                }
                else
                {
                    if (i == layer.SelectedItems.Count - 1)
                    {
                        text += "S" + ((NSString)(dic1["SeatNumber"]));
                    }
                    else
                    {
                        text += "S" + ((NSString)(dic1["SeatNumber"]) + ",");
                    }
                    button4.Enabled = true;
                    button4.Alpha   = (float)1;
                }
            }

            selection(text);
        }
Beispiel #5
0
        private void MapsTicketBooking_ShapeSelectionChanged(object sender, ShapeSelectedEventArgs e)
        {
            TicketData data = e.Data as TicketData;

            if (data != null)
            {
                if (data.SeatNumber == "1" || data.SeatNumber == "2" || data.SeatNumber == "8" || data.SeatNumber == "9")
                {
                    if ((this.Maps.Layers[0] as ShapeFileLayer).SelectedItems.Contains(e.Data))
                    {
                        (this.Maps.Layers[0] as ShapeFileLayer).SelectedItems.Remove(e.Data);
                    }
                }
            }
        }
Beispiel #6
0
        private void ShapeLayer_ShapeSelectionChanged(object sender, ShapeSelectedEventArgs e)
        {
            AgricultureData data = e.Data as AgricultureData;

            if (data != null)
            {
                Toast.IsVisible = true;
                stateLabel.Text = data.Name;
                Device.StartTimer(new TimeSpan(0, 0, 3), () =>
                {
                    Toast.IsVisible = false;
                    return(false);
                });
            }
        }
        void DrilldownSelectionChanged(object sender, ShapeSelectedEventArgs args) 

        {
            
            if (args.Data != null)
            {
                
            {
                    
 NSDictionary dic = (NSDictionary)args.Data; 
 NSString continent = (NSString)(dic["continent"]); 
 label3.Text = continent; 
 header.Hidden = true; 
 layout.Hidden = false; 
 button.Hidden = false; 
                if (continent == "South America")

                    {
                        
                {
                            
 maps.BaseMapIndex = 1; 
 layer.ShapeSettings.SelectedShapeColor = UIColor.FromRGB(156, 51, 103); 

                        }
                    }
                    
                else if (continent == "North America")
                    {
                        
                {
                            
 maps.BaseMapIndex = 2; 
 layer.ShapeSettings.SelectedShapeColor = UIColor.FromRGB(193, 54, 100); 

                        }
                    }
                    
                else if (continent == "Europe")
                    {
                        
                {
                            
 maps.BaseMapIndex = 3; 
 layer.ShapeSettings.SelectedShapeColor = UIColor.FromRGB(98, 45, 108); 

                        }
                    }
                    
                else if (continent == "Africa")
                    {
                        
                {
                            
 maps.BaseMapIndex = 4; 
 layer.ShapeSettings.SelectedShapeColor = UIColor.FromRGB(128, 48, 106); 

                        }
                    }
                    
                else if (continent == "Australia")
                    {
                        
                {
                            
 maps.BaseMapIndex = 5; 
 layer.ShapeSettings.SelectedShapeColor = UIColor.FromRGB(42, 40, 112); 

                        }
                    }
                    
                else if (continent == "Asia")
                    {
                        
                {
                            
 maps.BaseMapIndex = 6; 
 layer.ShapeSettings.SelectedShapeColor = UIColor.FromRGB(70, 42, 109); 

                        }
                    }
                    

                }
            }
            

        }
        private void MapsTicketBooking_ShapeSelectionChanged(object sender, ShapeSelectedEventArgs e)
        {
            ShapeFileLayer shapeLayer = sender as ShapeFileLayer;
            ShapeData      data       = e.Data as ShapeData;

            if (data != null)
            {
                if (data.SeatNumber == "1" || data.SeatNumber == "2" || data.SeatNumber == "8" || data.SeatNumber == "9")
                {
                    if (shapeLayer.SelectedItems.Contains(e.Data))
                    {
                        shapeLayer.SelectedItems.Remove(e.Data);
                    }
                }
                else
                {
                    UpdateSelection(shapeLayer);
                }
            }
        }
        private void Layer_ShapeSelectionChanged(object sender, ShapeSelectedEventArgs args)
        {
            DrilldownModel data = args.Data as DrilldownModel;

            if (data != null)
            {
                continentLabel.Text   = data.Continent;
                stackLayout.IsVisible = true;
                header.IsVisible      = false;
                if (data.Continent == "South America")
                {
                    Map.BaseMapIndex = 1;
                    layer.ShapeSettings.SelectedShapeColor = Color.FromHex("#9C3367");
                }
                else if (data.Continent == "North America")
                {
                    Map.BaseMapIndex = 2;
                    layer.ShapeSettings.SelectedShapeColor = Color.FromHex("#C13664");
                }
                else if (data.Continent == "Europe")
                {
                    Map.BaseMapIndex = 3;
                    layer.ShapeSettings.SelectedShapeColor = Color.FromHex("#622D6C");
                }
                else if (data.Continent == "Africa")
                {
                    Map.BaseMapIndex = 4;
                    layer.ShapeSettings.SelectedShapeColor = Color.FromHex("#80306A");
                }
                else if (data.Continent == "Australia")
                {
                    Map.BaseMapIndex = 5;
                    layer.ShapeSettings.SelectedShapeColor = Color.FromHex("#2A2870");
                }
                else if (data.Continent == "Asia")
                {
                    Map.BaseMapIndex = 6;
                    layer.ShapeSettings.SelectedShapeColor = Color.FromHex("#462A6D");
                }
            }
        }
 /// <summary>
 /// Occurs when the user tap on a shape.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void scatter_ContactTapGesture(object sender, ContactEventArgs e)
 {
     for (int i = 0; i < this.scatter.Items.Count; i++)
     {
         ScatterViewItem svi = (ScatterViewItem)this.scatter.Items[i];
         if (svi.IsActive) //if a shape is selected
         {
             this.selectedShape = this.shapes[i];
             // trigger an event with this selected shape in parameter
             ShapeSelectedEventArgs eventShapeSelection = new ShapeSelectedEventArgs(this.selectedShape);
             if (eventShapeSelection != null) this.OnShapeSelected(this, eventShapeSelection);
         }
     }
 }