protected async override void OnAppearing()
        {
            base.OnAppearing();

            Xamarin.Forms.Application.Current.On <Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);

            this.BindingContext = new MessageThreadViewModel();

            vm = this.BindingContext as MessageThreadViewModel;

            if (vm != null)
            {
                if (!string.IsNullOrEmpty(Settings.TypedMessage))
                {
                    txtMessage.Text = Settings.TypedMessage;
                }

                if (NetworkCheck.IsInternet())
                {
                    await vm.PostReadThreadData();

                    await vm.FetchThreadUserData();
                }
                else
                {
                    await DisplayAlert("Simon", "No network is available.", "OK");
                }
            }
        }
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            Xamarin.Forms.Application.Current.On <Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);

            if (FirstTime)
            {
                FirstTime = false;

                if (vm != null)
                {
                    if (NetworkCheck.IsInternet())
                    {
                        await vm.PostReadThreadData();

                        await vm.FetchThreadUserData();
                    }
                    else
                    {
                        await DisplayAlert("Simon", "No network is available.", "OK");
                    }
                }
            }
            else
            {
                if (App.FrameImage != null)
                {
                    vm.ImageUrl       = App.FrameImage;
                    vm.isImageVisible = true;
                }
                if (App.FileName != null)
                {
                    vm.FileName      = App.FileName;
                    vm.isDocsVisible = true;
                }
            }

            if (App.IsFromAddParticipantPage == true)
            {
                if (App.FrameImage != null)
                {
                    vm.ImageUrl       = App.FrameImage;
                    vm.isImageVisible = true;
                }
                if (App.FileName != null)
                {
                    vm.FileName      = App.FileName;
                    vm.isDocsVisible = true;
                }
                txtMessage.HtmlText = Settings.TypedMessage;
            }
            else
            {
                txtMessage.HtmlText = null;
            }
        }
        public ThreadMessagePage()
        {
            InitializeComponent();

            if (Application.Current.Properties.ContainsKey("PARTYNAME"))
            {
                txtPartyName      = Convert.ToString(Application.Current.Properties["PARTYNAME"]);
                lblPartyName.Text = txtPartyName;
            }
            if (Application.Current.Properties.ContainsKey("TOPIC"))
            {
                txtTopic      = Convert.ToString(Application.Current.Properties["TOPIC"]);
                lblTopic.Text = txtTopic;
            }
            if (Application.Current.Properties.ContainsKey("THREADID"))
            {
                threadId = (int)Application.Current.Properties["THREADID"];
            }
            if (Application.Current.Properties.ContainsKey("USERID"))
            {
                userId = Convert.ToString(Application.Current.Properties["USERID"]);
            }
            this.BindingContext = this;
            if (NetworkCheck.IsInternet())
            {
                ViewModel = new MessageThreadViewModel();
                ViewModel.PostReadThreadData();
                ViewModel.FetchThreadUserData();
                BindingContext = ViewModel;
            }
            else
            {
                DisplayAlert("Simon", "No network is available.", "OK");
            }
            //SaveThreadMessageRead();
            GetJSON();
        }