summaryrefslogtreecommitdiff
path: root/Juick/ViewModels/MessageViewModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewModels/MessageViewModel.cs')
-rw-r--r--Juick/ViewModels/MessageViewModel.cs186
1 files changed, 0 insertions, 186 deletions
diff --git a/Juick/ViewModels/MessageViewModel.cs b/Juick/ViewModels/MessageViewModel.cs
deleted file mode 100644
index 750864a..0000000
--- a/Juick/ViewModels/MessageViewModel.cs
+++ /dev/null
@@ -1,186 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Net;
-using System.Windows.Media.Imaging;
-using JuickApi;
-
-namespace Juick.ViewModels
-{
- public class MessageViewModel : INotifyPropertyChanged
- {
- public MessageViewModel()
- {
-
- }
-
- public MessageViewModel(Message message)
- {
- MID = message.Mid;
- MessageUri = string.Format("/ThreadView.xaml?mid={0}", MID);
- RID = message.Rid;
- Username = message.User.UName;
- MessageText = HttpUtility.HtmlDecode(message.Body);
-
- if (message.Tags != null)
- {
- MessageText = string.Join(", ", message.Tags) + Environment.NewLine + MessageText;
- }
- }
- private int _mid;
- /// <summary>
- /// Sample _viewModelBase property; this property is used in the view to display its value using a Binding.
- /// </summary>
- /// <returns></returns>
- public int MID
- {
- get
- {
- return _mid;
- }
- set
- {
- if (value != _mid)
- {
- _mid = value;
- NotifyPropertyChanged("MID");
- }
- }
- }
-
- private int _rid;
- /// <summary>
- /// Sample _viewModelBase property; this property is used in the view to display its value using a Binding.
- /// </summary>
- /// <returns></returns>
- public int RID
- {
- get
- {
- return _rid;
- }
- set
- {
- if (value != _rid)
- {
- _rid = value;
- NotifyPropertyChanged("RID");
- }
- }
- }
- private string _username;
- /// <summary>
- /// Sample _viewModelBase property; this property is used in the view to display its value using a Binding.
- /// </summary>
- /// <returns></returns>
- public string Username
- {
- get
- {
- return _username;
- }
- set
- {
- if (value != _username)
- {
- _username = value;
- NotifyPropertyChanged("Username");
- }
- }
- }
-
- private Uri _avatarUri;
- public Uri AvatarUri
- {
- get { return _avatarUri; }
- set
- {
- if (value != _avatarUri)
- {
- _avatarUri = value;
- NotifyPropertyChanged("AvatarUri");
- }
- }
- }
-
- private Uri _attach;
- public Uri Attachment
- {
- get { return _attach; }
- set
- {
- if (value != _attach)
- {
- _attach = value;
- NotifyPropertyChanged("Attachment");
- }
- }
- }
-
- private string _messageText;
- /// <summary>
- /// Sample _viewModelBase property; this property is used in the view to display its value using a Binding.
- /// </summary>
- /// <returns></returns>
- public string MessageText
- {
- get
- {
- return _messageText;
- }
- set
- {
- if (value != _messageText)
- {
- _messageText = value;
- NotifyPropertyChanged("MessageText");
- }
- }
- }
-
- private string _status;
-
-
- /// <summary>
- /// Sample _viewModelBase property; this property is used in the view to display its value using a Binding.
- /// </summary>
- /// <returns></returns>
- public string Status
- {
- get
- {
- return _status;
- }
- set
- {
- if (value != _status)
- {
- _status = value;
- NotifyPropertyChanged("Status");
- }
- }
- }
-
- private string _messageUri;
-
- public string MessageUri
- {
- get { return _messageUri; }
- set
- {
- _messageUri = value;
- NotifyPropertyChanged("MessageUri");
- }
- }
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- public void NotifyPropertyChanged(String propertyName)
- {
- PropertyChangedEventHandler handler = PropertyChanged;
- if (null != handler)
- {
- handler(this, new PropertyChangedEventArgs(propertyName));
- }
- }
- }
-} \ No newline at end of file