コード例 #1
0
ファイル: EditorViewModel.cs プロジェクト: msachs/TestRepo2
        public EditorViewModel()
        {
            this.DeleteScriptBrickCommand = new RelayCommand<DataObject>(this.DeleteScriptBrickAction);
              this.CopyScriptBrickCommand = new RelayCommand<DataObject>(this.CopyScriptBrickAction);
              this.StartAddBroadcastMessageCommand = new RelayCommand<DataObject>(this.AddBroadcastMessageAction);

              this.DeleteSoundCommand = new RelayCommand<Sound>(this.DeleteSoundAction);
              this.DeleteSpriteCommand = new RelayCommand<Sprite>(this.DeleteSpriteAction);
              this.DeleteCostumeCommand = new RelayCommand<Costume>(this.DeleteCostumeAction);
              this.CopyCostumeCommand = new RelayCommand<Costume>(this.CopyCostumeAction);
              this.UndoCommand = new RelayCommand(this.UndoAction);
              this.RedoCommand = new RelayCommand(this.RedoAction);

              this.NothingItemHackCommand = new RelayCommand<object>(NothingItemHackAction);

              if (IsInDesignMode)
              {
            catrobatContext = new CatrobatContextDesign();
            selectedSprite = catrobatContext.CurrentProject.SpriteList.Sprites[0];
              }
              else
              {
            catrobatContext = CatrobatContext.Instance;
              }

              scriptBricks = new ScriptBrickCollection();
        }
コード例 #2
0
        public AddNewProjectViewModel()
        {
            // Commands
              SaveCommand = new RelayCommand(Save);

              if (IsInDesignMode)
            catrobatContext = new CatrobatContextDesign();
              else
            catrobatContext = CatrobatContext.Instance;
        }
コード例 #3
0
        public UploadProjectLoginViewModel()
        {
            // Commands
              LoginCommand = new RelayCommand(Login);

              if (IsInDesignMode)
            catrobatContext = new CatrobatContextDesign();
              else
            catrobatContext = CatrobatContext.Instance;
        }
コード例 #4
0
        private Sprite selectedSprite; // TODO (Memory): remove this and use Messageing instead

        #endregion Fields

        #region Constructors

        public ProjectSettingsViewModel()
        {
            if (IsInDesignMode)
            catrobatContext = new CatrobatContextDesign();
              else
            catrobatContext = CatrobatContext.Instance;

              if(catrobatContext.CurrentProject.SpriteList.Sprites.Count > 0)
            selectedSprite = catrobatContext.CurrentProject.SpriteList.Sprites[0];
        }
コード例 #5
0
        public UploadProjectViewModel()
        {
            // Commands
              UploadCommand = new RelayCommand(Upload);

              if (IsInDesignMode)
            catrobatContext = new CatrobatContextDesign();
              else
            catrobatContext = CatrobatContext.Instance;

              _projectName = catrobatContext.CurrentProject.ProjectName;
        }
コード例 #6
0
ファイル: MainViewModel.cs プロジェクト: msachs/TestRepo2
        public MainViewModel()
        {
            CatrobatContext.Instance.PropertyChanged += CatrobatContextPropertyChanged;
              CatrobatContext.Instance.CurrentProject.PropertyChanged += CurrentProjectPropertyChanged;

              (App.Current.Resources["ThemeChooser"] as ThemeChooser).PropertyChanged += ThemeChooserPropertyChanged;

              // Commands
              DeleteLocalProjectCommand = new RelayCommand<string>(DeleteLocalProject);
              CopyLocalProjectCommand = new RelayCommand<string>(CopyLocalProject);
              LazyLoadOnlineProjectsCommand = new RelayCommand(LazyLoadOnlineProjects);
              SetCurrentProjectCommand = new RelayCommand<string>(SetCurrentProject);

              if (IsInDesignMode)
            catrobatContext = new CatrobatContextDesign();
              else
            catrobatContext = CatrobatContext.Instance;
        }