summaryrefslogtreecommitdiff
path: root/Juick/ViewModels/UserFeedViewModel.cs
blob: 597687fdd25c99b9fd918e54d4523c9103b14dfd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Juick.Classes;
using JuickApi;

namespace Juick.ViewModels
{
    public class UserFeedViewModel : PageViewModel
    {
        public UserFeedViewModel(AppViewModel context) : base(context)
        {
                        
        }
        static readonly string CaptionPropertyName = ExpressionHelper.GetPropertyName<ThreadViewModel>(x => x.Caption);

        private int _uid;
        public int Uid
        {
            get { return _uid; }
            set
            {
                _uid = value;
                RestUri = string.Format("/messages?user_id={0}", _uid);
                NotifyPropertyChanged(CaptionPropertyName);
            }
        }

        public override string Caption
        {
            get { return Items.Count == 0 ? "": Items[0].Username; }
        }
    }
}