private void DeleteTree()
        {
            Baum baumToDelete = BaumCollection.Where(x => x.IsMarked == true).FirstOrDefault();

            if (baumToDelete != null)
            {
                BaumCollection.Remove(baumToDelete);
            }
            else
            {
            }
        }
        private async void RenderImage(NotificationMessageAction <SoftwareBitmap> notificationMessageAction)
        {
            if (BaumCollection != null && BaumCollection.Count > 0)
            {
                if (BaumCollection.Where(x => x.IsMarked == true).Count() > 0)
                {
                    SelectTree(BaumCollection.Where(x => x.IsMarked == true).First());
                }

                //_selectedBaum = _BaumCollection.Where(x => x.IsMarked = true).First();
                //RaisePropertyChanged(() => SelectedBaum);
            }

            RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap();

            await renderTargetBitmap.RenderAsync(mapGrid);

            if (renderTargetBitmap.PixelHeight != 0 && renderTargetBitmap.PixelWidth != 0)
            {
                SoftwareBitmap softwareBitmap = new SoftwareBitmap(BitmapPixelFormat.Bgra8, renderTargetBitmap.PixelWidth, renderTargetBitmap.PixelHeight);
                softwareBitmap.DpiX = 600;
                softwareBitmap.DpiY = 600;
                softwareBitmap.CopyFromBuffer(await renderTargetBitmap.GetPixelsAsync());

                notificationMessageAction.Execute(softwareBitmap);
            }



            //BitmapDecoder imagedecoder;
            //using (var imagestream = await Map.OpenAsync(FileAccessMode.Read))
            //{
            //    imagedecoder = await BitmapDecoder.CreateAsync(imagestream);

            //    CanvasDevice device = CanvasDevice.GetSharedDevice();
            //    CanvasRenderTarget renderTarget = new CanvasRenderTarget(device, imagedecoder.PixelWidth, imagedecoder.PixelHeight, 96);
            //    using (var ds = renderTarget.CreateDrawingSession())
            //    {
            //        ds.Clear(Colors.White);
            //        CanvasBitmap image = await CanvasBitmap.LoadAsync(device, imagestream);
            //        ds.DrawImage(image);
            //        //ds.DrawText(lblName.Text, new System.Numerics.Vector2(150, 150), Colors.Black);
            //    }

            //    await renderTarget.SaveAsync(imagestream, CanvasBitmapFileFormat.Jpeg);

            //    BitmapImage bitmap = new BitmapImage();
            //    bitmap.SetSource(imagestream);

            //    MapR = bitmap;
            //}
        }
        private void MoveTree(PointerPoint imagePoint, PointerPoint canvasPoint)
        {
            if (BaumCollection != null)
            {
                Baum selectedTree = (Baum)BaumCollection.Where(x => x.IsMarked == true).FirstOrDefault();

                if (selectedTree != null)
                {
                    selectedTree.CanvasPosition = canvasPoint.Position;
                    selectedTree.ImagePosition  = imagePoint.Position;

                    BaumCollection.Remove(selectedTree);
                    BaumCollection.Add(selectedTree);
                }
            }
        }