kailun92

deleting a graphics layer on page load (WP7)

Discussion created by kailun92 on Jan 6, 2014
Latest reply on Jan 8, 2014 by odoe
I have allowed the page load to load the points on the map. How can I clear graphics of the points at the same time with the method ?

public MapPage()
        {
            InitializeComponent();
            this.Loaded += MapPage_Loaded;
        }

void MapPage_Loaded(object sender, RoutedEventArgs e)
        {
            recommendPlace_Checked(null, null);
            GraphicsLayer graphicsLayer = map.Layers["recommendPlaceCoords"] as GraphicsLayer;
            graphicsLayer.ClearGraphics();
        }

I cant seems to clear the graphics using the ClearGraphics. Help pls.

Outcomes