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(); }
public AddNewProjectViewModel() { // Commands SaveCommand = new RelayCommand(Save); if (IsInDesignMode) catrobatContext = new CatrobatContextDesign(); else catrobatContext = CatrobatContext.Instance; }
public UploadProjectLoginViewModel() { // Commands LoginCommand = new RelayCommand(Login); if (IsInDesignMode) catrobatContext = new CatrobatContextDesign(); else catrobatContext = CatrobatContext.Instance; }
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]; }
public UploadProjectViewModel() { // Commands UploadCommand = new RelayCommand(Upload); if (IsInDesignMode) catrobatContext = new CatrobatContextDesign(); else catrobatContext = CatrobatContext.Instance; _projectName = catrobatContext.CurrentProject.ProjectName; }
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; }