コード例 #1
0
        public static ScenePickerViewModel Create(InteractiveScene interactiveScene)
        {
            if (null == interactiveScene)
            {
                throw new ArgumentNullException("interactiveScene");
            }

            return new ScenePickerViewModel()
            {
                InteractiveScene = interactiveScene
            };
        }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: kasparov/StoryTeller
 private void libraryPanel_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
 {
     LibraryItem libraryItem = libraryPanel.SelectedItem as LibraryItem;
     IScene scene = new InteractiveScene(libraryItem);
     projectViewModel.Story.AddScene(scene);
     UpdateFullscreenButton();
 }
コード例 #3
0
        internal void AddStoryline(StoryLineViewModel storyline)
        {
            if (storyline.Count > 0)
            {
                SceneViewModel lastScene = storyline.Last();

                InteractiveScene interactiveScene;
                if (lastScene.CurrentScene is InteractiveScene)
                {
                    interactiveScene = lastScene.CurrentScene as InteractiveScene;
                    if (null != interactiveScene)
                    {
                        interactiveScene.Type = SceneType.Interactive;
                    }
                }
                else
                {
                    interactiveScene = new InteractiveScene(lastScene.CurrentScene.LibraryItem);
                    storyline.Remove(lastScene);
                    storyline.Add(CreateSceneViewModel(interactiveScene));
                }

                int index = FindStoryLineIndex(storyline);
                if (index > -1)
                {
                    IStorylinePositioner positioner = new StorylineInserter(StoryLines, index);
                    _builder.ConstructStoryLines(this, storyline, null, storyline.Depth + storyline.Count, positioner);
                    SelectStoryline(StoryLines[index + 1]);
                }
            }
        }