public void RemoveMessage(VKMessageModel message) { this.vkMessage.Remove(message); var messages = from item in this.vkMessage where item.uid == message.uid orderby item.date select item; VKMessageModel lastMessage = null; if (messages.Count() != 0) { lastMessage = messages.Last() as VKMessageModel; } else { lastMessage = message; lastMessage.body = ""; } AddDialog(new VKMessageModel[] { lastMessage }); this.NotifyPropertyChanged("VKDialogs"); }
public VKDialogModel(VKMessageModel message) { this.vkMessage = message; }
public void RefreshMessages(VKMessageModel[] VKMessage) { this.vkMessage.Clear(); foreach (var message in VKMessage) { var dialog = new VKDialogModel(message); this.vkMessage.Add(dialog); } this.NotifyPropertyChanged("VKMessages"); }
void OnPageLoaded(object sender, RoutedEventArgs e) { Dispatcher.BeginInvoke(() => { this.ListMessages.ScrollIntoView(scrollToMessage); ListBoxItem listBoxItem = (ListBoxItem)this.ListMessages.ItemContainerGenerator.ContainerFromItem(scrollToMessage); scrollToMessage = null; }); }
protected override void OnNavigatedTo(NavigationEventArgs args) { IDictionary<string, string> parameters = this.NavigationContext.QueryString; if (parameters.ContainsKey("UID")) { this.UID = parameters["UID"]; this.UserName = parameters["Name"].ToUpper(); this.NotifyPropertyChanged("UID"); this.Items = App.MainPageData.GetMessage(this.UID); this.NotifyPropertyChanged("Items"); this.NotifyPropertyChanged("UserName"); this.online = App.MainPageData.GetOnline(this.UID); this.NotifyPropertyChanged("OnlineVisibility"); if (parameters.ContainsKey("mid")) { scrollToMessage = App.MainPageData.GetMessageByMid(parameters["mid"]); this.Mid = parameters["mid"]; this.MarkMessagesAsRead(); } this.MarkMessagesAsRead(); } if (parameters.ContainsKey("ClearBackStack")) { NavigationService.RemoveBackEntry(); } this.NumberOfAttachments = App.Attachments.Count; //this.NotifyPropertyChanged("ManageAttachmentsVisibility"); //this.NotifyPropertyChanged("ImageIconVisibility"); //this.NotifyPropertyChanged("ManageAttachmentsIconUri"); base.OnNavigatedTo(args); }
public void RemoveMessage(VKMessageModel message) { this.vkMessage.Remove(message); var messages = from item in this.vkMessage where item.uid == message.uid orderby item.date select item; VKMessageModel lastMessage = null; if (messages.Count() != 0) { lastMessage = messages.Last() as VKMessageModel; } else { lastMessage = message; lastMessage.body = ""; } AddDialog(new VKMessageModel[]{lastMessage}); this.NotifyPropertyChanged("VKDialogs"); }
public void AddMessage(VKMessageModel[] VKMessage) { foreach (var message in VKMessage) this.vkMessage.Add(message); this.NotifyPropertyChanged("VKMessage"); }
public void AddDialog(VKMessageModel[] VKMessage) { foreach (var message in VKMessage) { /*if (message.uid == "146877606") { var t = ""; }*/ foreach (var dialog in this.vkDialogs) if (dialog.UID == message.uid) { this.vkDialogs.Remove(dialog); break; } this.vkDialogs.Add(new VKDialogModel(message)); } this.NotifyPropertyChanged("VKDialogs"); }