Esempio n. 1
0
        public void SetCurrentSlide(int slideNumber)
        {
            if (slideNumber >= this.Slideshow.Slides.Count ||
                slideNumber < 0)
            {
                return;
            }
            CurrentIndex = slideNumber;
            ISlideSection currentSlide  = this.Slideshow.Slides[this.CurrentIndex];
            ISlideSection currentFooter = this.Slideshow.GetFooter(this.CurrentIndex);

            UpdateSlide?.Invoke(currentSlide, CurrentIndex);
            UpdateFooter?.Invoke(currentFooter, CurrentIndex);
        }
        public void UpdateSlide(ISlideSection slide, int currentIndex)
        {
            var themes = Themes.GetSingleton();
            var used   = !string.IsNullOrWhiteSpace(themes.GetBackgroundImage(currentIndex));

            BackGroundUsed = used;

            if (used)
            {
                BackgroundImage = AppDomain.CurrentDomain.BaseDirectory + "\\" + themes.GetBackgroundImage(currentIndex);
            }

            if (!BackGroundUsed)
            {
                BackgroundColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString(themes.GetBackgroundColor(currentIndex)));
            }

            CurrentSlideVM = new SlideSectionViewModel(slide, currentIndex);
        }
Esempio n. 3
0
        public SlideSectionViewModel(ISlideSection slide, int index)//slide
        {
            var elements = new ObservableCollection <FrameworkElement>();

            wpfContentManager.Index = index;

            foreach (var content in slide.Contents)
            {
                foreach (var behaviour in content.Value.Behaviours)
                {
                    var uiElement = wpfContentManager.GetControl(behaviour);
                    if (uiElement != null)
                    {
                        elements.Add(uiElement);
                    }
                }
            }

            ContentElements = elements;
        }
Esempio n. 4
0
        private static IContent GetWpfContent(slideshowSlideContent contentData, ISlideSection parent)
        {
            IContentFactory factory;

            switch (contentData.type)
            {
            case "text":
                factory = new TextContentFactory(contentData.text.value, contentData.level.value);
                break;

            case "image":
            case "media":
                factory = new ImageContentFactory(contentData.reference.value);
                break;

            case "list":
            default:
                factory = null;
                break;
            }
            return(factory.GetContent(parent));
        }
 public void UpdateFooter(ISlideSection slide, int currentIndex)
 {
     CurrentThemeFooterVM = new SlideSectionViewModel(slide, currentIndex);
 }