public FeedDetailsViewModel()
        {
            RootChannel = new Channel();
            RootChannel.Title = "Titre du channel";
            RootChannel.Description =   "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet eleifend ante." +
                                        "In vel mauris metus, ac viverra lectus. Aenean dui sapien, pretium eu gravida ut, sollicitudin" +
                                        "et nisi. In hac habitasse platea dictumst. Quisque egestas ligula in lorem sodales sed" +
                                        " congue turpis varius. Maecenas vel quam at tortor viverra tristique vitae at lorem. Maecenas" +
                                        " augue augue, convallis tristique congue ut, porta sed felis. Nam nisi libero, vehicula" +
                                        " ac ultricies quis, imperdiet lobortis tellus.";
            RootChannel.Link = "http://www.google.com";

            Items = new List<Item>();
            for (int i = 0; i < 20; ++i)
            {
                Item item = new Item();
                item.Title = "Titre de l'item " + i.ToString();
                item.Description =  "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet eleifend ante." +
                                    "In vel mauris metus, ac viverra lectus. Aenean dui sapien, pretium eu gravida ut, sollicitudin" +
                                    "et nisi. In hac habitasse platea dictumst. Quisque egestas ligula in lorem sodales sed" +
                                    " congue turpis varius. Maecenas vel quam at tortor viverra tristique vitae at lorem. Maecenas" +
                                    " augue augue, convallis tristique congue ut, porta sed felis. Nam nisi libero, vehicula" +
                                    " ac ultricies quis, imperdiet lobortis tellus.";
                item.PubDate = DateTime.Now;
                Items.Add(item);

            }

            ReadItem = new RelayCommand((param) => ReadItemBody(param as Item));
            //feedDetailsDataModel = new FeedDetailsDataModel();
        }
        public FeedsPageViewModel()
        {
            FeedsManager = FeedManagerDataModel.Instance;
            FeedsManager.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(FeedsManager_PropertyChanged);

            RefreshFeeds = new RelayCommand((param) => FeedsManager.GetAllRootFeeds());
            RefreshFeed = new RelayCommand((param) => FeedsManager.RefreshFeed(param as Channel));
            AddFeed = new RelayCommand((param) => AddFeedBody(param as string));
            RemoveFeed = new RelayCommand((param) => FeedsManager.RemoveFeed(param as Channel));
            LoadFeedItems = new RelayCommand((param) => FeedsManager.LoadFeedItems(param as Channel));

            /*OpenFeedDetails = new RelayCommand((param) => (new ChannelFeedsPage()
            {
                DataContext = new FeedDetailsViewModel(param as Channel)
            }));*/
            OpenFeedDetails = new RelayCommand((param) => OpenDetails(param as Channel));
            //LogOut = new RelayCommand((param) => Logout(param as string[]));

            PhoneApplicationFrame frame = (PhoneApplicationFrame)Application.Current.RootVisual;
            bool success = frame.Navigate(new Uri("/View/DetailedFeedsPage.xaml", UriKind.Relative));

            Channels = new List<Channel>();
            FeedsManager.GetAllRootFeeds();
            SearchDataModel.Instance.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Instance_PropertyChanged);
        }
 public RegisterPageViewModel()
 {
     UserData = UserDataModel.Instance;
     PropertyChangedHandler = new System.ComponentModel.PropertyChangedEventHandler(UserData_PropertyChanged);
     UserDataModel.Instance.PropertyChanged += PropertyChangedHandler;
     Login = new RelayCommand((param) => LoginBody(param as string[]));
 }
        public FeedDetailsViewModel(Channel channel)
        {
            RootChannel = channel;
            feedDetailsDataModel = new FeedDetailsDataModel(channel);
            feedDetailsDataModel.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(feedDetailsDataModel_PropertyChanged);
            Items = feedDetailsDataModel.Items;

            ReadItem = new RelayCommand((param) => ReadItemBody(param as Item));
        }
        public FeedManagerViewModel()
        {
            FeedManager = FeedManagerDataModel.Instance;
            FeedManager.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(FeedManager_PropertyChanged);
            SearchDataModel.Instance.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Search_PropertyChanged);

            RemoveFeed      = new RelayCommand((param) => FeedManager.RemoveFeed(param as Channel));
            AddFollowFeed   = new RelayCommand((param) => FeedManager.AddNewFeed((param as Channel).Url));
        }
        public RibbonViewModel()
        {
            Connect     = new RelayCommand((param) => ConnectBody(param as string[]));
            Register    = new RelayCommand((param) => RegisterBody(param as string[]));
            AddFeed     = new RelayCommand((param) => AddFeedBody(param as string));
            RefreshFeeds= new RelayCommand((param) => RefreshFeedsBody());

            UserData.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(UserData_PropertyChanged);
            IsConnected = UserData.IsConnected;
        }
        public AdminViewModel()
        {
            PropertyChangeAdminDataModel = new PropertyChangedEventHandler(AdminDataModel_PropertyChanged);
            AdminDataModel.Instance.PropertyChanged += PropertyChangeAdminDataModel;
            Channels = AdminDataModel.Instance.Channels;
            Users = AdminDataModel.Instance.Users;

            UpdateUser = new RelayCommand((param) => AdminDataModel.Instance.UpdateUser(param as AccountData));
            GetFeedDetails = new RelayCommand((param) => AdminDataModel.Instance.GetFeedDetails(param as Channel));
            RemoveUser = new RelayCommand((param) => AdminDataModel.Instance.DeleteUser(param as AccountData));
        }
        public FeedsManagerViewModel()
        {
            FeedsManager = FeedManagerDataModel.Instance;
            FeedsManager.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(FeedsManager_PropertyChanged);

            RefreshFeeds = new RelayCommand((param) => FeedsManager.GetAllRootFeeds());
            RefreshFeed = new RelayCommand((param) => FeedsManager.RefreshFeed(param as Channel));
            AddFeed = new RelayCommand((param) => AddFeedBody(param as string));
            RemoveFeed = new RelayCommand((param) => FeedsManager.RemoveFeed(param as Channel));
            LoadFeedItems = new RelayCommand((param) => FeedsManager.LoadFeedItems(param as Channel));

            OpenFeedDetails = new RelayCommand((param) => (new ChannelDetails()
            {
                DataContext = new FeedDetailsViewModel(param as Channel)
            }).Show());

            Channels = new List<Channel>();

            SearchDataModel.Instance.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Instance_PropertyChanged);
        }
        public MenuViewModel()
        {
            CloseCommand = new RelayCommand((param) => Application.Current.Shutdown());
            ShowConnectionDialog = new RelayCommand((param) =>
            {
                ShowConnectionModel_IFN();
            });
            Logout = new RelayCommand((param) => UserDataModel.Instance.Logout());
            PropertyChangedHandler = new System.ComponentModel.PropertyChangedEventHandler(UserData_PropertyChanged);
            OpenAdmin = new RelayCommand((param) =>
                {
                    new AdminWindow().Show();
                });
            UserDataModel.Instance.PropertyChanged += PropertyChangedHandler;

            search = SearchDataModel.Instance.Search;
            IsAdmin = UserDataModel.Instance.IsConnected;
            IsAdmin = false;

            ErrorModel = new ErrorViewModel();
        }