public ConversationView(Conversation conv) { InitializeComponent(); conversationScrollView.IsVisible = true; setConversationInfo(conv); conversation = conv; entryBottom.IsVisible = true; conversationList.ItemSelected += OnItemSelected; type = MessageApiManager.CommentType.Converzation; ConversationId = conv.ConversationID; UpdateList(true); setSize(true); bool scrollDelay = false; commentEntryBottom.Focused += async (sender, e) => { conversationList.TranslationY = 90; conversationScrollView.HeightRequest = 1000; conversationInfo.IsVisible = false; try { await Task.Delay(1); if (conversationList.ItemsSource.OfType<Comment>().Last() != null) { conversationList.ScrollTo(conversationList.ItemsSource.OfType<Comment>().Last(), ScrollToPosition.End, true); } } catch (Exception ex) { } scrollDelay = true; await Task.Delay(200); scrollDelay = false; }; commentEntryBottom.Unfocused += (sender, e) => { conversationList.TranslationY = 0; }; conversationScrollView.Scrolled += (sender, e) => { System.Diagnostics.Debug.WriteLine(conversationScrollView.ScrollY); if (conversationScrollView.ScrollY > 0 && conversationScrollView.ScrollY < 100 && !scrollDelay) { DependencyService.Get<ForceCloseKeyboard>().CloseKeyboard(); } if (conversationScrollView.ScrollY < 10 && !scrollDelay) { if (conversation.ModelType != ConversationModelType.Profile) { conversationInfo.IsVisible = true; } } }; App.coreView.viewdConversation = this; }
public ConversationView(List<Comment> coms, MessageApiManager.CommentType mT, string id, StackLayout layout) //public ConversationView(List<Comment> coms, MessageApiManager.CommentType mT, string id) { InitializeComponent(); commentView.IsVisible = true; comments = coms; entryTop.IsVisible = true; commentList.ItemSelected += OnItemSelected; type = mT; ConversationId = id; wallLayout = layout; UpdateList(true); postCommentButtonTop.Clicked += async (sender, e) => { await PostNewComment(commentEntryTop.Text); }; setSize(false); }