Esempio n. 1
0
        public MainWindow()
        {
            #region Command Setup
            OpenImageViewer = new RelayCommand(
                (o) =>
                {
                    _imageViewer = new ImageViewerDialog();
                    _imageViewer.Owner = this;
                    _imageViewer.Closed += ImageViewer_Closed;
                    _imageViewer.Show();
                },
                (o) =>
                {
                    return _imageViewer == null;
                }
            );

            SaveScene = new RelayCommand(
                (o) => { SceneViewControl.SaveSelectedScene(); },
                (o) => { return SceneViewControl.SelectedScene != null; }
            );

            SaveAllScenes = new RelayCommand(
                (o) => { },
                (o) => { return true; }
            );

            Undo = new RelayCommand(
                (o) => { SceneViewControl.Undo(); },
                (o) => { return SceneViewControl.CanUndo; }
            );

            Redo = new RelayCommand(
                (o) => { SceneViewControl.Redo(); },
                (o) => { return SceneViewControl.CanRedo; }
            );

            Puppeteer = new RelayCommand(
                (o) =>
                {
                    _puppeteerWindow = new PuppeteerEditorDialog();
                    _puppeteerWindow.Owner = this;
                    _puppeteerWindow.Closed += PuppeteerDialog_Closed;
                    _puppeteerWindow.Show();
                },
                (o) =>
                {
                    return _puppeteerWindow == null;
                }
            );

            ParticleEditor = new RelayCommand(
                (o) =>
                {
                    _particleEditorWindow = new ParticleEditorDialog();
                    _particleEditorWindow.Owner = this;
                    _particleEditorWindow.Closed += ParticleEditor_Closed;
                    _particleEditorWindow.Show();
                },
                (o) =>
                {
                    return _particleEditorWindow == null;
                }
            );

            /*TransformMode = new RelayCommand(
                (o) =>
                {
                    _mode = (WidgetMode)o;
                    _controller.WidgetMode = _mode;
                    //(SceneViewControl.SelectedActor as ITransformableWidget).WidgetMode = _mode.Value;
                },
                (o) =>
                {
                    if (!(o is WidgetMode)) return false;
                    return _controller.HasActorSelected;
                    //return SceneViewControl.SelectedActor != null && SceneViewControl.SelectedActor is ITransformableWidget;
                });*/

            #endregion

            InitializeComponent();

            SceneViewControl.OnActorAdded += OnActorAddedHandler;
            var model =
                DependencyInjectorHelper
                    .MainWindowKernel
                    .Get<TransformModeViewModel>();

            TranslateButton.DataContext = model;
            RotateButton.DataContext = model;
            ScaleButton.DataContext = model;

            ApplicationUtils.SetupApplicationFolders();

            if (DesignerProperties.GetIsInDesignMode(this))
                return;
        }
Esempio n. 2
0
 private void PuppeteerDialog_Closed(object sender, EventArgs e)
 {
     _puppeteerWindow = null;
 }