Ejemplo n.º 1
0
        public async Task PlayStory(XambStoryline story)
        {
            foreach (XambStoryFrame storyFrame in story)
            {
                FrameworkElement actor = XambEngine.GetActor(storyFrame.Actor);
                var adornerLayer       = AdornerLayer.GetAdornerLayer(actor);
                var adorner            = new XambAdorner(actor, storyFrame.Content, XambEngine.TemplateSelector);
                adornerLayer.Add(adorner);
                await Task.Delay(storyFrame.TransitionDelay);

                adornerLayer.Remove(adorner);
            }
        }
Ejemplo n.º 2
0
        private void CreateOnboardingStory()
        {
            // This could be a deserialized object
            _demoStoryLine = new XambStoryline();
            _customType    = new DemoType {
                Count = 0, Description = "This is the custom type. change this text using text field"
            };

            _demoStoryLine.AddStoryFrameAt(0, new XambStoryFrame {
                Actor = "demo", Content = "Click this button to start Demo", TransitionDelay = TimeSpan.FromSeconds(2)
            });
            _demoStoryLine.AddStoryFrameAt(1, new XambStoryFrame {
                Actor = "entry", Content = "This is an entry field to enter some demo text", TransitionDelay = TimeSpan.FromSeconds(4)
            });
            _demoStoryLine.AddStoryFrameAt(2, new XambStoryFrame {
                Actor = "end", Content = _customType, TransitionDelay = TimeSpan.FromSeconds(2)
            });
        }