public void PublishLocationResult(object sender, PublishLocationEventArgs args)
        {
            if (args.Error != null)
            {
                DispatcherHelper.CheckBeginInvokeOnUI(() =>
                {
                    IsBusy = false;
                    if (args.Error is WebException)
                    {
                        MessageBox.Show(args.Error.Message);
                    }
                    else
                    {
                        var exception = new ExceptionPrompt();
                        exception.Show(args.Error);
                    }
                });
            }
            else
            {
                if (!args.IsSuccess)
                {
                    DispatcherHelper.CheckBeginInvokeOnUI(() =>
                    {
                        IsBusy = false;
                        var message = new DialogMessage(
                            "Communication error!", DialogMessageCallback)
                        {
                            Button = MessageBoxButton.OK,
                            Caption = "Error!"
                        };

                        Messenger.Default.Send(message);
                    });
                }
                else
                {
                    //update also the picture
                    byte[] img = IsolatedStorageHelper.LoadFromLocalStorageArray(Constants.MYPICTURE_FILE_NAME, "profiles");
                    if (img != null)
                    {
                        ServiceAgent.PublishMyPicture(Identification.GetDeviceId(), img, new EventHandler<PublishLocationEventArgs>(PublishMyPictureResult));
                    }
                    else
                    {
                        //update friends list
                        ServiceAgent.GetFriends(this.GetFriendsResult);
                    }
                }
            }

        }
        public void PublishMyPictureResult(object sender, PublishLocationEventArgs args)
        {
            //
            if (args.Error != null)
            {
                DispatcherHelper.CheckBeginInvokeOnUI(() =>
                {
                    IsBusy = false;
                    if (args.Error is WebException)
                    {
                        MessageBox.Show(args.Error.Message);
                    }
                    else
                    {
                        var exception = new ExceptionPrompt();
                        exception.Show(args.Error);
                    }
                });
            }
            else
            {
                if (!args.IsSuccess)
                {
                    DispatcherHelper.CheckBeginInvokeOnUI(() =>
                    {
                        IsBusy = false;
                        var message = new DialogMessage(
                            "Communication error!", DialogMessageCallback)
                        {
                            Button = MessageBoxButton.OK,
                            Caption = "Error!"
                        };

                        Messenger.Default.Send(message);
                    });
                }
                else
                {
                    //update friends list
                    ServiceAgent.GetFriends(this.GetFriendsResult);
                }
            }
        }