Ejemplo n.º 1
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.PopupViewerSample);


            // Used in Callout to see feature details in PopupViewer
            _infoIcon = await RuntimeImage.FromStreamAsync(Assets.Open("info.png"));

            // Used to demonstrate display of EditSummary in PopupViewer
            // Provides credentials to token-secured layer that has editor-tracking enabled
            AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async(info) =>
            {
                return(await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, "user1", "user1"));
            });

            mapView                = FindViewById <MapView>(Resource.Id.mapView);
            mapView.Map            = new Map(Basemap.CreateLightGrayCanvasVector());
            mapView.GeoViewTapped += mapView_GeoViewTapped;

            // Webmap configured with Popup
            mapView.Map = new Map(new Uri("https://www.arcgis.com/home/item.html?id=d4fe39d300c24672b1821fa8450b6ae2"));

            popupViewer = FindViewById <UI.Controls.PopupViewer>(Resource.Id.popupViewer);
        }
Ejemplo n.º 2
0
        internal static void SetForeground(this UI.Controls.PopupViewer popupViewer, NativeColor color)
        {
#if NETFX_CORE
            popupViewer.Foreground = new Windows.UI.Xaml.Media.SolidColorBrush(color);
#else
            popupViewer.ForegroundColor = color;
#endif
        }
Ejemplo n.º 3
0
        internal PopupViewer(UI.Controls.PopupViewer nativePopupViewer)
        {
            NativePopupViewer = nativePopupViewer;

#if NETFX_CORE
            nativePopupViewer.SizeChanged += (o, e) => InvalidateMeasure();
#endif
        }
Ejemplo n.º 4
0
        private void OnPopupInfoButtonClicked(object tag)
        {
            Popup popup = (Popup)tag;
            // Create a popupviewer and show it in a PopupWindow
            var         popupViewer = new UI.Controls.PopupViewer(ApplicationContext);
            PopupWindow window      = new PopupWindow(ApplicationContext)
            {
                ContentView = popupViewer,
            };

            window.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(Android.Graphics.Color.White));
            window.OutsideTouchable = true;
            window.Touchable        = true;
            popupViewer.SetPadding(20, 20, 20, 20);
            popupViewer.PopupManager = new PopupManager(popup);
            window.ShowAtLocation(mapView, Android.Views.GravityFlags.Bottom, 0, 0);
        }