Exemplo n.º 1
0
        public void StartUpdateManager(NewsListViewModel newsListView)
        {
            this.newsListView = newsListView;

            autoReset = new AutoResetEvent(false);
            updTimer = new Timer(new TimerCallback(Update), autoReset, 0, OptionsManager.Instance.RefreshTime * 1000);
        }
Exemplo n.º 2
0
        //public static  Dispatcher dispatcher;
        public MainPage()
        {
            InitializeComponent();

            //dispatcher = this.Dispatcher;

            if (newsListView == null)
            {
                newsListView = new NewsListViewModel();
                PivotItemNews.DataContext = newsListView;

                UpdateTaskManager.Instance.StartUpdateManager(newsListView); // when newsListView is created, start update manager to download news periodically
            }

            if (optionsView == null)
            {
                optionsView = new OptionsViewModel();
                PivotItemOpt.DataContext = optionsView;
            }
        }
 public NetNewsServerConnection(NewsListViewModel newsListView)
 {
     this.newsListView = newsListView;
 }
Exemplo n.º 4
0
 // method for refresh button
 public void Update(NewsListViewModel newsListView)
 {
     NetNewsServerConnection netNewsServerConnection = new NetNewsServerConnection(newsListView);
     netNewsServerConnection.DownloadData();
 }