// ----------------------------------------------------------------------
partial         void OnChange_Slide(Slide oldValue, Slide newValue, ref bool handled);
Beispiel #2
0
partial         void Command_NewSlide(CommandType commandType, object parameter, ref bool canExecute)
        {
            canExecute = true;
             if (CommandType.Execute == commandType)
             {
            ModelContext.RunGroup (() =>
               {
                  var slides = GetSlides ();

                  var newSlide =
                     new Slide (ModelContext)
                     {
                        Elements =
                           new ObservableCollection<BaseElement>
                           {
                              new TextElement (ModelContext)
                                 {
                                    Left = 40,
                                    Top = 40,
                                    Width = 1200,
                                    Height = 64,
                                    Text = "Title Text",
                                    FontSize = 48,
                                 },
                              new TextElement (ModelContext)
                                 {
                                    Left = 40,
                                    Top = 200,
                                    Width = 1200,
                                    Height = 48,
                                    Text = "Content Text",
                                    FontSize = 32,
                                 },
                           },
                     };

                  slides.Add (newSlide);
                  newSlide.Update (this);
                  CurrentSlide = slides[slides.Count - 1];
               });
             }
        }