private void ListViewItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { //extract selected Pie from ListView var listItem = sender as ListViewItem; SmartMirror weather = listItem.Content as SmartMirror; SmartMirror selectedWeather = forecast.FirstOrDefault(x => x.ID == 3); if (weather != null) { var detailView = new WeatherDetailView(weather); detailView.ShowDialog(); } }
public MainWindow() { InitializeComponent(); myMirrorCodeBehind = new SmartMirror { Name = "Emma", Temperature = -3, Today = DateTime.Now, }; news = GetNews(); stocks = GetStocks(); forecast = GetForecast(); myGrid.DataContext = myMirrorCodeBehind; NewsOverviewList.ItemsSource = news; StocksOverviewList.ItemsSource = stocks; ForecastOverviewList.ItemsSource = forecast; }
public WeatherDetailView(SmartMirror mirror) { InitializeComponent(); MyDetailedWeather = mirror; this.DataContext = mirror; }