void buttonClick(object sender, RoutedEventArgs e) { Button item = (Button)sender; SolidColorBrush brush = new SolidColorBrush(); brush.Color = Windows.UI.Colors.LightGreen; item.Background = brush; brush.Color = Windows.UI.Colors.Black; item.Foreground = brush; Button item1 = new Button(); item1 = (Button) LastSender; foreach (String notepad in notepadRepository.GetNotepadesNames()) { if (notepad.Equals(item1.ToString().ToLower())) Notepad = notepad; } //NoteContent noteContent = new NoteContent(item1); Window.Current.Content = new NoteContent(item1,item); }