public HexagonInfo()
        {
            InitializeComponent();
            earthwatcherRequest = new EarthwatcherRequests(Constants.BaseApiUrl);
            commentRequests = new CommentRequests(Constants.BaseApiUrl);
            landRequests = new LandRequests(Constants.BaseApiUrl);
            hexagonLayer = (HexagonLayer)Current.Instance.LayerHelper.FindLayer(Constants.Hexagonlayername);

            //Add event listeners
            commentRequests.CommentsByLandReceived += CommentRequestCommentsByLandReceived;
            earthwatcherRequest.EarthwatcherReceived += EarthwatcherChanged;
            Current.Instance.MapControl.zoomFinished += MapControlZoomFinished;
            Current.Instance.MapControl.zoomStarted += MapControlZoomStarted;

            HtmlPage.RegisterScriptableObject("HexagonInfo", this);
        }
Example #2
0
 private void ApplicationStartup(object sender, StartupEventArgs e)
 {
     if (e.InitParams.ContainsKey("credentials"))
     {
         string[] credentials = e.InitParams["credentials"].Split(':');
         if (credentials.Length == 2 && !string.IsNullOrEmpty(credentials[0]) && !string.IsNullOrEmpty(credentials[1]))
         {
             EarthwatcherRequests earthwatcherRequest = new EarthwatcherRequests(new Uri(Application.Current.Host.Source, "/api").ToString());
             earthwatcherRequest.EarthwatcherReceived += earthwatcherRequest_EarthwatcherReceived;
             password = credentials[1].Trim();
             earthwatcherRequest.GetByName(credentials[0].Trim(), password);
         }
         else
         {
             BackToLoginPage();
         }
     }
     else
     {
         BackToLoginPage();
     }
 }
 private void Init()
 {
     earthwatcherRequest = new EarthwatcherRequests(Constants.BaseApiUrl);
     earthwatcherRequest.EarthwatcherReceived += EarthwatcherRequestEarthwatcherReceived;
     earthwatcherRequest.GetById(land.EarthwatcherId.ToString());
 }