Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
 public VKDialogModel(VKMessageModel message)
 {
     this.vkMessage = message;
 }
Ejemplo n.º 3
0
        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");
        }
Ejemplo n.º 4
0
 void OnPageLoaded(object sender, RoutedEventArgs e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         this.ListMessages.ScrollIntoView(scrollToMessage);
         ListBoxItem listBoxItem = (ListBoxItem)this.ListMessages.ItemContainerGenerator.ContainerFromItem(scrollToMessage);
         scrollToMessage = null;
     });
 }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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");
        }
Ejemplo n.º 7
0
 public void AddMessage(VKMessageModel[] VKMessage)
 {
     foreach (var message in VKMessage)
         this.vkMessage.Add(message);
     this.NotifyPropertyChanged("VKMessage");
 }
Ejemplo n.º 8
0
 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");
 }
Ejemplo n.º 9
0
 public VKDialogModel(VKMessageModel message)
 {
     this.vkMessage = message;
 }