Пример #1
0
        public EditorBase(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            // Get services from the global service container.
            var services = (ServiceContainer)ServiceLocator.Current;
            UIContentManager = services.GetInstance<ContentManager>("UIContent");
            InputService = services.GetInstance<IInputService>();
            AnimationService = services.GetInstance<IAnimationService>();
            GraphicsService = services.GetInstance<IGraphicsService>();
            GameObjectService = services.GetInstance<IGameObjectService>();
            UIService = services.GetInstance<IUIService>();

            // Create a local service container which can be modified in samples:
            // The local service container is a child container, i.e. it inherits the
            // services of the global service container. Samples can add new services
            // or override existing entries without affecting the global services container
            // or other samples.
            Services = services.CreateChildContainer();

            // Load a UI theme, which defines the appearance and default values of UI controls.
            Theme theme = UIContentManager.Load<Theme>("BlendBlue/Theme");

            FigureRenderer = new FigureRenderer(GraphicsService, 2000);
            DebugRenderer = new DebugRenderer(GraphicsService, UIContentManager.Load<SpriteFont>("BlendBlue/Default"));
            UIRenderer = new UIRenderer(GraphicsService.GraphicsDevice, theme);

            UIScreen = new UIScreen("Main Screen", UIRenderer)
            {
                Background = Color.TransparentBlack,
            };

            UIService.Screens.Add(UIScreen);

            Scene = new Scene();
        }
Пример #2
0
        protected Sample(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            // Get services from the global service container.
              var services = (ServiceContainer)ServiceLocator.Current;
              SampleFramework = services.GetInstance<SampleFramework>();
              ContentManager = services.GetInstance<ContentManager>();
              UIContentManager = services.GetInstance<ContentManager>("UIContent");
              InputService = services.GetInstance<IInputService>();
              AnimationService = services.GetInstance<IAnimationService>();
              Simulation = services.GetInstance<Simulation>();
              ParticleSystemService = services.GetInstance<IParticleSystemService>();
              GraphicsService = services.GetInstance<IGraphicsService>();
              GameObjectService = services.GetInstance<IGameObjectService>();
              UIService = services.GetInstance<IUIService>();

              // Create a local service container which can be modified in samples:
              // The local service container is a child container, i.e. it inherits the
              // services of the global service container. Samples can add new services
              // or override existing entries without affecting the global services container
              // or other samples.
              Services = services.CreateChildContainer();

              // Store a copy of the original graphics screens.
              _originalGraphicsScreens = GraphicsService.Screens.ToArray();

              // Mouse is visible by default.
              SampleFramework.IsMouseVisible = true;
        }
Пример #3
0
        protected Sample(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            // Get services from the global service container.
            var services = (ServiceContainer)ServiceLocator.Current;

            SampleFramework       = services.GetInstance <SampleFramework>();
            ContentManager        = services.GetInstance <ContentManager>();
            UIContentManager      = services.GetInstance <ContentManager>("UIContent");
            InputService          = services.GetInstance <IInputService>();
            AnimationService      = services.GetInstance <IAnimationService>();
            Simulation            = services.GetInstance <Simulation>();
            ParticleSystemService = services.GetInstance <IParticleSystemService>();
            GraphicsService       = services.GetInstance <IGraphicsService>();
            GameObjectService     = services.GetInstance <IGameObjectService>();
            UIService             = services.GetInstance <IUIService>();

            // Create a local service container which can be modified in samples:
            // The local service container is a child container, i.e. it inherits the
            // services of the global service container. Samples can add new services
            // or override existing entries without affecting the global services container
            // or other samples.
            Services = services.CreateChildContainer();

            // Store a copy of the original graphics screens.
            _originalGraphicsScreens = GraphicsService.Screens.ToArray();

            // Mouse is visible by default.
            SampleFramework.IsMouseVisible = true;
        }
Пример #4
0
        protected Sample(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            // Enable mouse centering and hide mouse by default.
            EnableMouseCentering = true;

            // Get services from the global service container.
            var services = (ServiceContainer)ServiceLocator.Current;

            ContentManager        = services.GetInstance <ContentManager>();
            UIContentManager      = services.GetInstance <ContentManager>("UIContent");
            InputService          = services.GetInstance <IInputService>();
            AnimationService      = services.GetInstance <IAnimationService>();
            Simulation            = services.GetInstance <Simulation>();
            ParticleSystemService = services.GetInstance <IParticleSystemService>();
            GraphicsService       = services.GetInstance <IGraphicsService>();
            GameObjectService     = services.GetInstance <IGameObjectService>();
            UIService             = services.GetInstance <IUIService>();

            // Create a local service container which can be modified in samples:
            // The local service container is a child container, i.e. it inherits the
            // services of the global service container. Samples can add new services
            // or override existing entries without affecting the global services container
            // or other samples.
            Services = services.CreateChildContainer();
        }
 public RepeatingWordsViewModel(INavigationService navigationServcie, IDialogService dialogService, IUnitOfWork unitOfWork, IAnimationService animationService, ITextToSpeech speechService, IFirstLanguage firstLanguageService) : base(navigationServcie, dialogService)
 {
     _animationService     = animationService;
     _unitOfWork           = unitOfWork;
     _firstLanguageService = firstLanguageService;
     _speechService        = speechService;
     Model = new RepeatingWordsModel();
     VoiceActingCommand     = new Command(async() => await _speechService.Speak(Model.CurrentWord.EngWord));
     EditCurrentWordCommand = new Command(async() =>
     {
         _isEditing = true;
         await NavigationService.NavigateToAsync <CreateWordViewModel>(Model.CurrentWord);
     });
     EnterTranslateCommand = new Command(async() =>
     {
         await _animationService.AnimationFade(WorkContainerView, 0);
         await ShowEnterTranslate();
         await _animationService.AnimationFade(WorkContainerView, 1);
     });
     SelectFromWordsCommand = new Command(async() =>
     {
         await _animationService.AnimationFade(WorkContainerView, 0);
         await ShowSelectFromWords();
         await _animationService.AnimationFade(WorkContainerView, 1);
     });
     LearningCardsCommand = new Command(async() =>
     {
         await _animationService.AnimationFade(WorkContainerView, 0);
         await ShowLearningCards();
         await _animationService.AnimationFade(WorkContainerView, 1);
     });
     AppearingCommand = new Command(async() => await AppearingPage());
 }
Пример #6
0
    public AnimatedWindow(IServiceLocator services)
    {
      // Get the animation service.
      _animationService = services.GetInstance<IAnimationService>();

      // Catch closing event.
      Closing += OnClosing;
    }
Пример #7
0
        public AnimatedWindow(IServiceLocator services)
        {
            // Get the animation service.
            _animationService = services.GetInstance <IAnimationService>();

            // Catch closing event.
            Closing += OnClosing;
        }
Пример #8
0
        public Editor2DCameraObject(IServiceLocator services)
        {
            Name = "Editor2DCamera";

            _services         = services;
            _inputService     = services.GetInstance <IInputService>();
            _animationService = services.GetInstance <IAnimationService>();

            IsEnabled = true;
        }
Пример #9
0
        public Editor2DCameraObject(IServiceLocator services)
        {
            Name = "Editor2DCamera";

            _services = services;
            _inputService = services.GetInstance<IInputService>();
            _animationService = services.GetInstance<IAnimationService>();

            IsEnabled = true;
        }
Пример #10
0
 public CentauriGame(Game game)
     : base(game)
 {
     _inputService = (IInputService)game.Services.GetService(typeof(IInputService));
     _uiService = (IUIService)game.Services.GetService(typeof(IUIService));
     _animationService = (IAnimationService)game.Services.GetService(typeof(IAnimationService));
     _spritebatch = (SpriteBatch)game.Services.GetService(typeof(SpriteBatch));
     _consoleManager = (ConsoleManager)game.Services.GetService(typeof(ConsoleManager));
     _content = (ContentController)game.Services.GetService(typeof(ContentController));
     _eventManager = (EventManager) game.Services.GetService(typeof (EventManager));
 }
Пример #11
0
 public MainComponent(Game game)
     : base(game)
 {
     // Get the required services from the game's service provider.
     _inputService     = (IInputService)game.Services.GetService(typeof(IInputService));
     _uiService        = (IUIService)game.Services.GetService(typeof(IUIService));
     _animationService = (IAnimationService)game.Services.GetService(typeof(IAnimationService));
     Content           = Game.Content;
     _emoEngine        = new EmoEngineManager();
     _emoEngine.StartEmoEngine();
 }
Пример #12
0
        //--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="ModelDocument"/> class.
        /// </summary>
        /// <param name="editor">The editor.</param>
        /// <param name="documentType">The type of the document.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="editor"/> or <paramref name="documentType"/> is <see langword="null"/>.
        /// </exception>
        internal ModelDocument(IEditorService editor, DocumentType documentType)
            : base(editor, documentType)
        {
            _modelsExtension        = editor.Extensions.OfType <ModelsExtension>().FirstOrDefault().ThrowIfMissing();
            _useDigitalRuneGraphics = _modelsExtension.UseDigitalRuneGraphics;

            var services = Editor.Services;

            _documentService   = services.GetInstance <IDocumentService>().ThrowIfMissing();
            _statusService     = services.GetInstance <IStatusService>().ThrowIfMissing();
            _outputService     = services.GetInstance <IOutputService>().ThrowIfMissing();
            _animationService  = services.GetInstance <IAnimationService>().ThrowIfMissing();
            _monoGameService   = services.GetInstance <IMonoGameService>().ThrowIfMissing();
            _outlineService    = services.GetInstance <IOutlineService>().WarnIfMissing();
            _propertiesService = services.GetInstance <IPropertiesService>().WarnIfMissing();
            _errorService      = services.GetInstance <IErrorService>().WarnIfMissing();

            Editor.ActiveDockTabItemChanged += OnEditorDockTabItemChanged;

            UpdateProperties();
            UpdateOutline();
        }
Пример #13
0
        public EditorBase(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            // Get services from the global service container.
            var services = (ServiceContainer)ServiceLocator.Current;

            UIContentManager  = services.GetInstance <ContentManager>("UIContent");
            InputService      = services.GetInstance <IInputService>();
            AnimationService  = services.GetInstance <IAnimationService>();
            GraphicsService   = services.GetInstance <IGraphicsService>();
            GameObjectService = services.GetInstance <IGameObjectService>();
            UIService         = services.GetInstance <IUIService>();

            // Create a local service container which can be modified in samples:
            // The local service container is a child container, i.e. it inherits the
            // services of the global service container. Samples can add new services
            // or override existing entries without affecting the global services container
            // or other samples.
            Services = services.CreateChildContainer();

            // Load a UI theme, which defines the appearance and default values of UI controls.
            Theme theme = UIContentManager.Load <Theme>("BlendBlue/Theme");

            FigureRenderer = new FigureRenderer(GraphicsService, 2000);
            DebugRenderer  = new DebugRenderer(GraphicsService, UIContentManager.Load <SpriteFont>("BlendBlue/Default"));
            UIRenderer     = new UIRenderer(GraphicsService.GraphicsDevice, theme);

            UIScreen = new UIScreen("Main Screen", UIRenderer)
            {
                Background = Color.TransparentBlack,
            };

            UIService.Screens.Add(UIScreen);

            Scene = new Scene();
        }
Пример #14
0
    public EasingWindow(IServiceLocator services) 
      : base(services)
    {
      _inputService = services.GetInstance<IInputService>();
      _animationService = services.GetInstance<IAnimationService>();

      Title = "EasingWindow";

      StackPanel stackPanel = new StackPanel { Margin = new Vector4F(8) };
      Content = stackPanel;

      TextBlock textBlock = new TextBlock
      {
        Text = "Test different Easing Functions in this window.",
        Margin = new Vector4F(0, 0, 0, 8),
      };
      stackPanel.Children.Add(textBlock);

      StackPanel horizontalPanel = new StackPanel
      {
        Orientation = Orientation.Horizontal,
        Margin = new Vector4F(0, 0, 0, 8)
      };
      stackPanel.Children.Add(horizontalPanel);

      textBlock = new TextBlock
      {
        Text = "Easing Function:",
        Width = 80,
        Margin = new Vector4F(0, 0, 8, 0),
      };
      horizontalPanel.Children.Add(textBlock);

      _functionDropDown = new DropDownButton
      {
        Width = 100,

        // The DropDownButton automatically converts the items to string (using ToString) and 
        // displays this string. This is not helpful for this sort of items. We want to display
        // the type name of the items instead. The following is a callback which creates a
        // TextBlock for each item. It is called when the drop-down list is opened.
        CreateControlForItem = item => new TextBlock { Text = item.GetType().Name },
      };
      horizontalPanel.Children.Add(_functionDropDown);

      _functionDropDown.Items.Add(new BackEase());
      _functionDropDown.Items.Add(new BounceEase());
      _functionDropDown.Items.Add(new CircleEase());
      _functionDropDown.Items.Add(new CubicEase());
      _functionDropDown.Items.Add(new ElasticEase());
      _functionDropDown.Items.Add(new ExponentialEase());
      _functionDropDown.Items.Add(new LogarithmicEase());
      _functionDropDown.Items.Add(new HermiteEase());
      _functionDropDown.Items.Add(new PowerEase());
      _functionDropDown.Items.Add(new QuadraticEase());
      _functionDropDown.Items.Add(new QuinticEase());
      _functionDropDown.Items.Add(new SineEase());
      _functionDropDown.SelectedIndex = 0;

      horizontalPanel = new StackPanel
      {
        Orientation = Orientation.Horizontal,
        Margin = new Vector4F(0, 0, 0, 8)
      };
      stackPanel.Children.Add(horizontalPanel);

      textBlock = new TextBlock
      {
        Text = "Easing Mode:",
        Width = 80,
        Margin = new Vector4F(0, 0, 8, 0),
      };
      horizontalPanel.Children.Add(textBlock);

      _modeDropDown = new DropDownButton
      {
        Width = 100,
      };
      horizontalPanel.Children.Add(_modeDropDown);

      _modeDropDown.Items.Add(EasingMode.EaseIn);
      _modeDropDown.Items.Add(EasingMode.EaseOut);
      _modeDropDown.Items.Add(EasingMode.EaseInOut);
      _modeDropDown.SelectedIndex = 0;

      _slider = new Slider
      {
        Margin = new Vector4F(0, 16, 0, 0),
        SmallChange = 0.01f,
        LargeChange = 0.1f,
        Minimum = -0.5f,
        Maximum = 1.5f,
        Width = 250,
        HorizontalAlignment = HorizontalAlignment.Center,
      };
      stackPanel.Children.Add(_slider);

      // Display the current value of the slider.
      var valueLabel = new TextBlock
      {
        Text = _slider.Value.ToString("F2"),
        HorizontalAlignment = HorizontalAlignment.Center,
        Margin = new Vector4F(0, 0, 0, 8),
      };
      stackPanel.Children.Add(valueLabel);

      // Update the text every time the slider value changes.
      var valueProperty = _slider.Properties.Get<float>("Value");
      valueProperty.Changed += (s, e) => valueLabel.Text = e.NewValue.ToString("F2");

      Button button = new Button
      {
        Content = new TextBlock { Text = "Animate" },
        HorizontalAlignment = HorizontalAlignment.Center,
        Margin = new Vector4F(0, 0, 0, 8),
      };
      button.Click += OnButtonClicked;
      stackPanel.Children.Add(button);

      textBlock = new TextBlock
      {
        Text = "(Press the Animate button to animate the slider\n"
                + "value using the selected EasingFunction.\n"
                + "The slider goes from -0.5 to 1.5. The animation\n"
                + "animates the value to 0 or to 1.)",
      };
      stackPanel.Children.Add(textBlock);

      // When the window is loaded, the window appears under the mouse cursor and flies to
      // its position.
      Vector2F mousePosition = _inputService.MousePosition;

      // The loading animation is a timeline group of three animations:
      // - One animations animates the RenderScale from (0, 0) to its current value.
      // - The other animations animate the X and Y positions from the mouse position 
      //   to current values.
      // The base class AnimatedWindow will apply this timeline group on this window 
      // when the window is loaded.
      TimelineGroup timelineGroup = new TimelineGroup
      {
        new Vector2FFromToByAnimation
        {
          TargetProperty = "RenderScale",
          From = new Vector2F(0, 0),
          Duration = TimeSpan.FromSeconds(0.3),
          EasingFunction = new HermiteEase { Mode = EasingMode.EaseOut },
        },
        new SingleFromToByAnimation
        {
          TargetProperty = "X",     
          From = mousePosition.X, 
          Duration = TimeSpan.FromSeconds(0.3),
        },        
        new SingleFromToByAnimation
        {
          TargetProperty = "Y",     
          From = mousePosition.Y, 
          Duration = TimeSpan.FromSeconds(0.3),
          EasingFunction = new QuadraticEase { Mode = EasingMode.EaseIn },
        },
      };
      // The default FillBehavior is "Hold". But this animation can be removed when it is finished. 
      // It should not "Hold" the animation value. If FillBehavior is set to Hold, we cannot
      // drag the window with the mouse because the animation overrides the value.
      timelineGroup.FillBehavior = FillBehavior.Stop;
      LoadingAnimation = timelineGroup;

      // The closing animation is a timeline group of three animations:
      // - One animations animates the RenderScale to (0, 0).
      // - The other animations animate the X and Y positions to the mouse position.
      // The base class AnimatedWindow will apply this timeline group on this window 
      // when the window is loaded.
      ClosingAnimation = new TimelineGroup
      {
        new Vector2FFromToByAnimation
        {
          TargetProperty = "RenderScale",
          To = new Vector2F(0, 0),
          Duration = TimeSpan.FromSeconds(0.3),
          EasingFunction = new HermiteEase { Mode = EasingMode.EaseIn },
        },
        new SingleFromToByAnimation
        {
          TargetProperty = "X",
          To = mousePosition.X,
          Duration = TimeSpan.FromSeconds(0.3),
        },        
        new SingleFromToByAnimation
        {
          TargetProperty = "Y",
          To = mousePosition.Y,
          Duration = TimeSpan.FromSeconds(0.3),
          EasingFunction = new QuadraticEase { Mode = EasingMode.EaseOut },
        },
      };
    }
Пример #15
0
        public EasingWindow(IServiceLocator services)
            : base(services)
        {
            _inputService     = services.GetInstance <IInputService>();
            _animationService = services.GetInstance <IAnimationService>();

            Title = "EasingWindow";

            StackPanel stackPanel = new StackPanel {
                Margin = new Vector4(8)
            };

            Content = stackPanel;

            TextBlock textBlock = new TextBlock
            {
                Text   = "Test different Easing Functions in this window.",
                Margin = new Vector4(0, 0, 0, 8),
            };

            stackPanel.Children.Add(textBlock);

            StackPanel horizontalPanel = new StackPanel
            {
                Orientation = Orientation.Horizontal,
                Margin      = new Vector4(0, 0, 0, 8)
            };

            stackPanel.Children.Add(horizontalPanel);

            textBlock = new TextBlock
            {
                Text   = "Easing Function:",
                Width  = 80,
                Margin = new Vector4(0, 0, 8, 0),
            };
            horizontalPanel.Children.Add(textBlock);

            _functionDropDown = new DropDownButton
            {
                Width = 100,

                // The DropDownButton automatically converts the items to string (using ToString) and
                // displays this string. This is not helpful for this sort of items. We want to display
                // the type name of the items instead. The following is a callback which creates a
                // TextBlock for each item. It is called when the drop-down list is opened.
                CreateControlForItem = item => new TextBlock {
                    Text = item.GetType().Name
                },
            };
            horizontalPanel.Children.Add(_functionDropDown);

            _functionDropDown.Items.Add(new BackEase());
            _functionDropDown.Items.Add(new BounceEase());
            _functionDropDown.Items.Add(new CircleEase());
            _functionDropDown.Items.Add(new CubicEase());
            _functionDropDown.Items.Add(new ElasticEase());
            _functionDropDown.Items.Add(new ExponentialEase());
            _functionDropDown.Items.Add(new LogarithmicEase());
            _functionDropDown.Items.Add(new HermiteEase());
            _functionDropDown.Items.Add(new PowerEase());
            _functionDropDown.Items.Add(new QuadraticEase());
            _functionDropDown.Items.Add(new QuinticEase());
            _functionDropDown.Items.Add(new SineEase());
            _functionDropDown.SelectedIndex = 0;

            horizontalPanel = new StackPanel
            {
                Orientation = Orientation.Horizontal,
                Margin      = new Vector4(0, 0, 0, 8)
            };
            stackPanel.Children.Add(horizontalPanel);

            textBlock = new TextBlock
            {
                Text   = "Easing Mode:",
                Width  = 80,
                Margin = new Vector4(0, 0, 8, 0),
            };
            horizontalPanel.Children.Add(textBlock);

            _modeDropDown = new DropDownButton
            {
                Width = 100,
            };
            horizontalPanel.Children.Add(_modeDropDown);

            _modeDropDown.Items.Add(EasingMode.EaseIn);
            _modeDropDown.Items.Add(EasingMode.EaseOut);
            _modeDropDown.Items.Add(EasingMode.EaseInOut);
            _modeDropDown.SelectedIndex = 0;

            _slider = new Slider
            {
                Margin              = new Vector4(0, 16, 0, 0),
                SmallChange         = 0.01f,
                LargeChange         = 0.1f,
                Minimum             = -0.5f,
                Maximum             = 1.5f,
                Width               = 250,
                HorizontalAlignment = HorizontalAlignment.Center,
            };
            stackPanel.Children.Add(_slider);

            // Display the current value of the slider.
            var valueLabel = new TextBlock
            {
                Text = _slider.Value.ToString("F2"),
                HorizontalAlignment = HorizontalAlignment.Center,
                Margin = new Vector4(0, 0, 0, 8),
            };

            stackPanel.Children.Add(valueLabel);

            // Update the text every time the slider value changes.
            var valueProperty = _slider.Properties.Get <float>("Value");

            valueProperty.Changed += (s, e) => valueLabel.Text = e.NewValue.ToString("F2");

            Button button = new Button
            {
                Content = new TextBlock {
                    Text = "Animate"
                },
                HorizontalAlignment = HorizontalAlignment.Center,
                Margin = new Vector4(0, 0, 0, 8),
            };

            button.Click += OnButtonClicked;
            stackPanel.Children.Add(button);

            textBlock = new TextBlock
            {
                Text = "(Press the Animate button to animate the slider\n"
                       + "value using the selected EasingFunction.\n"
                       + "The slider goes from -0.5 to 1.5. The animation\n"
                       + "animates the value to 0 or to 1.)",
            };
            stackPanel.Children.Add(textBlock);

            // When the window is loaded, the window appears under the mouse cursor and flies to
            // its position.
            Vector2F mousePosition = _inputService.MousePosition;

            // The loading animation is a timeline group of three animations:
            // - One animations animates the RenderScale from (0, 0) to its current value.
            // - The other animations animate the X and Y positions from the mouse position
            //   to current values.
            // The base class AnimatedWindow will apply this timeline group on this window
            // when the window is loaded.
            TimelineGroup timelineGroup = new TimelineGroup
            {
                new Vector2FFromToByAnimation
                {
                    TargetProperty = "RenderScale",
                    From           = new Vector2F(0, 0),
                    Duration       = TimeSpan.FromSeconds(0.3),
                    EasingFunction = new HermiteEase {
                        Mode = EasingMode.EaseOut
                    },
                },
                new SingleFromToByAnimation
                {
                    TargetProperty = "X",
                    From           = mousePosition.X,
                    Duration       = TimeSpan.FromSeconds(0.3),
                },
                new SingleFromToByAnimation
                {
                    TargetProperty = "Y",
                    From           = mousePosition.Y,
                    Duration       = TimeSpan.FromSeconds(0.3),
                    EasingFunction = new QuadraticEase {
                        Mode = EasingMode.EaseIn
                    },
                },
            };

            // The default FillBehavior is "Hold". But this animation can be removed when it is finished.
            // It should not "Hold" the animation value. If FillBehavior is set to Hold, we cannot
            // drag the window with the mouse because the animation overrides the value.
            timelineGroup.FillBehavior = FillBehavior.Stop;
            LoadingAnimation           = timelineGroup;

            // The closing animation is a timeline group of three animations:
            // - One animations animates the RenderScale to (0, 0).
            // - The other animations animate the X and Y positions to the mouse position.
            // The base class AnimatedWindow will apply this timeline group on this window
            // when the window is loaded.
            ClosingAnimation = new TimelineGroup
            {
                new Vector2FFromToByAnimation
                {
                    TargetProperty = "RenderScale",
                    To             = new Vector2F(0, 0),
                    Duration       = TimeSpan.FromSeconds(0.3),
                    EasingFunction = new HermiteEase {
                        Mode = EasingMode.EaseIn
                    },
                },
                new SingleFromToByAnimation
                {
                    TargetProperty = "X",
                    To             = mousePosition.X,
                    Duration       = TimeSpan.FromSeconds(0.3),
                },
                new SingleFromToByAnimation
                {
                    TargetProperty = "Y",
                    To             = mousePosition.Y,
                    Duration       = TimeSpan.FromSeconds(0.3),
                    EasingFunction = new QuadraticEase {
                        Mode = EasingMode.EaseOut
                    },
                },
            };
        }
Пример #16
0
 public WorkSpaceCardsViewModel(IDialogService _dialogService, INavigationService _navigationService, IUnlearningWordsService unlearningManager, IAnimationService animation) : base(_dialogService, _navigationService, unlearningManager, animation)
 {
     SwipeWordCommand = new Command <string>((direction) => { SwipeWord(direction); });
 }
Пример #17
0
        //--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="ModelDocument"/> class.
        /// </summary>
        /// <param name="editor">The editor.</param>
        /// <param name="documentType">The type of the document.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="editor"/> or <paramref name="documentType"/> is <see langword="null"/>.
        /// </exception>
        internal ModelDocument(IEditorService editor, DocumentType documentType)
          : base(editor, documentType)
        {
            _modelsExtension = editor.Extensions.OfType<ModelsExtension>().FirstOrDefault().ThrowIfMissing();
            _useDigitalRuneGraphics = _modelsExtension.UseDigitalRuneGraphics;

            var services = Editor.Services;
            _documentService = services.GetInstance<IDocumentService>().ThrowIfMissing();
            _statusService = services.GetInstance<IStatusService>().ThrowIfMissing();
            _outputService = services.GetInstance<IOutputService>().ThrowIfMissing();
            _animationService = services.GetInstance<IAnimationService>().ThrowIfMissing();
            _monoGameService = services.GetInstance<IMonoGameService>().ThrowIfMissing();
            _outlineService = services.GetInstance<IOutlineService>().WarnIfMissing();
            _propertiesService = services.GetInstance<IPropertiesService>().WarnIfMissing();
            _errorService = services.GetInstance<IErrorService>().WarnIfMissing();

            Editor.ActiveDockTabItemChanged += OnEditorDockTabItemChanged;

            UpdateProperties();
            UpdateOutline();
        }
Пример #18
0
 public AnimationController(IAnimationService animationService, ICommentService commentService, IParserService parserService)
 {
     _animationService = animationService;
     _commentService   = commentService;
     _parserService    = parserService;
 }
Пример #19
0
 public DownloadImageService(IAnimationService animation)
 {
     Animation = animation;
     ImgCount  = 0;
 }
Пример #20
0
 public SaveService(IAnimationService animation) =>
 public WorkSpaceSelectWordViewModel(IDialogService _dialogService, INavigationService _navigationService, IUnlearningWordsService unlearningManager, IAnimationService animation) : base(_dialogService, _navigationService, unlearningManager, animation)
 {
     TapWordCommand = new Command <string>(TapWord);
 }
 public UserController(IAnimationService animationService)
 {
     _animationService = animationService;
 }
 public GetTopicService(IAnimationService animation) =>
Пример #24
0
 public WorkSpaceEnterWordViewModel(IDialogService _dialogService, INavigationService _navigationService, IUnlearningWordsService unlearningManager, IAnimationService animation, IEntryWordValidator wordValidator) : base(_dialogService, _navigationService, unlearningManager, animation)
 {
     CheckWordCommand = new Command(async() => await CheckWord());
     HintWordCommand  = new Command(async() => await HintWord());
     ColorEnterWord   = Color.LightGray;
     _wordValidator   = wordValidator ?? throw new ArgumentNullException(nameof(wordValidator));
 }