public void EditLesson(LESSON lesson, onQueryComplete onComplete) { ctx.UpdateObject(lesson); this.onUQC = onComplete; ctx.BeginSaveChanges(onQueryComplete2, null); }
private Grid GenerateALessonBox(LESSON les) { if (les == null) { return null; } TextBlock lessonName = new TextBlock { FontSize = 50, Height = 65, Margin = new Thickness(5, 0, 0, 0), Foreground = new SolidColorBrush(Colors.White), HorizontalAlignment = HorizontalAlignment.Left, Text = les.TITLE, }; /* Image docImage = new Image { Source = new BitmapImage(new Uri("ms-appx:///Images/Upload/doc_white.png")), Margin = new Thickness(4, 0, 4, 0), }; Image audioImage = new Image { Source = new BitmapImage(new Uri("ms-appx:///Images/Upload/audio_white.png")), Margin = new Thickness(4, 0, 4, 0) }; Image videoImage = new Image { Source = new BitmapImage(new Uri("ms-appx:///Images/Upload/video_white.png")), Margin = new Thickness(8, 0, 8, 0) }; */ StackPanel imagesStackPanel = new StackPanel { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right, }; //imagesStackPanel.Children.Add(docImage); //imagesStackPanel.Children.Add(audioImage); //imagesStackPanel.Children.Add(videoImage); Image noteImage = new Image { Source = new BitmapImage(new Uri("ms-appx:///Images/Coursing/Lectures/newnote.png")), Margin = new Thickness(4, 0, -40, 0) }; noteImage.Height = 30; noteImage.Width = 30; noteImage.HorizontalAlignment = HorizontalAlignment.Right; Grid newLesson = new Grid() { Background = this.Resources["LessonBackgroundBrush"] as SolidColorBrush, Margin = new Thickness(2, 2, 80, 2) }; newLesson.Children.Add(lessonName); newLesson.Children.Add(imagesStackPanel); newLesson.Children.Add(noteImage); noteImage.Tapped += noteImage_Tapped; AddImageButton(les.ID, imagesStackPanel); return newLesson; }