예제 #1
0
        public ConfirmDialogViewModel()
        {
            Result = ConfirmResult.Cancel;

            YesCommand = new RelayCommand(() => Result = ConfirmResult.Yes);
            CancelCommand = new RelayCommand(() => Result = ConfirmResult.Cancel);
            SaveCommand = new RelayCommand(() => Result = ConfirmResult.Save);
        }
예제 #2
0
 public Project()
 {
     Figures = new BindingList<GeometryFigure>();
     scale = 1f;
     WasNeverSaved = true;
     Name = "Untitled";
     RemoveCommand = new RelayCommand(OnRemovingRequested);
 }
예제 #3
0
        private MainViewModel()
        {
            NewCommand = new RelayCommand(CreateNew);
            OpenCommand = new RelayCommand(Open);
            SaveCommand = new RelayCommand(Save, CanSave);
            SaveAsCommand = new RelayCommand(SaveAs, CanSave);
            ExportCommand = new RelayCommand(Export, CanSave);
            UndoCommand = new RelayCommand(Undo, CanUndo);
            RedoCommand = new RelayCommand(Redo, CanRedo);

            OpenProjects = new BindingList<Project>();
            EditorModes = new BindingList<EditorMode>
            {
                EditorMode.Cursor,
                EditorMode.Line,
                EditorMode.Arc,
                EditorMode.Bezier,
                EditorMode.Spline,
            };
            currentEditorMode = EditorModes.First();
        }