public MainPage() { InitializeComponent(); viewModel = new TwitterSearchesViewModel(this.Dispatcher); this.DataContext = viewModel; //handling a "suspend" event, new to win 8 (similar to win phone 7) Application.Current.Suspending += new SuspendingEventHandler(Current_Suspending); }
public TwitterSearchViewModel(TwitterSearchesViewModel viewModel, string searchTerm) { _viewModel = viewModel; Model = new TwitterSearchModel(searchTerm); PinToStart = new PinToStartCommand(this); Remove = new RemoveCommand(this); _timer = new DispatcherTimer(); _timer.Tick += new Windows.UI.Xaml.EventHandler(_timer_Tick); _timer.Interval = TimeSpan.FromSeconds(60); _timer.Start(); }
public SearchCommand(TwitterSearchesViewModel viewModel) { _viewModel = viewModel; }