Example #1
0
        public MainViewModel(IDialogService dialogService, IFrameService frameService, ISurfaceService surfaceService)
        {
            _dialogService  = dialogService;
            _frameService   = frameService;
            _surfaceService = surfaceService;

            OpenFileDialogCommand = new RelayCommand(OpenFileDialog);
            MouseDownCommand      = new RelayCommand(OnMouseDown);
            MouseUpCommand        = new RelayCommand(OnMouseUp);
            MouseMoveCommand      = new RelayCommand(OnMouseMove);
            ClearAllCommand       = new RelayCommand(ClearAll);

            _backgroundWorker           = new BackgroundWorker();
            _backgroundWorker.DoWork   += WorkerDoWork;
            SystemEvents.SessionSwitch += HandleSessionSwitch;

            _drawLines = new List <CurveLine>();

            PenSize           = 1;
            FontSize          = 8;
            PenColor          = Color.FromRgb(0, 0, 0);
            AvailablePenSizes = new[] { 1, 2, 4, 8, 16 };

            _frameService.MFPreview.PreviewEnable("", 0, 1);
            _frameService.MFPreview.PropsSet("wpf_preview", "true");
        }
Example #2
0
        public DiagnosticsViewModel(ICommandService commandService, EventManager eventManager, IFrameService frameService)
        {
            _commandService = commandService;
            _eventManager   = eventManager;
            _frameService   = frameService;

            InitializeCommands();
        }
Example #3
0
        public FrameManagementViewModel(IFrameService frameService, IDeviceService deviceService)
        {
            _frameService  = frameService;
            _deviceService = deviceService;

            InitializeCommands();
            InitializeConstants();
        }
        public void Setup()
        {
            var mfPreview = new MFPreviewClass();

            _dialogServiceStub  = Substitute.For <IDialogService>();
            _surfaceServiceStub = Substitute.For <ISurfaceService>();
            _frameServiceStub   = Substitute.For <IFrameService>();

            _frameServiceStub.MFPreview.Returns(mfPreview);

            _vm = new MainViewModel(_dialogServiceStub, _frameServiceStub, _surfaceServiceStub);
        }
Example #5
0
        public MainViewModel(IFrameService _frameService, IFrameShopService _frameShopService, IMaterialService _materialService)
        {
            frameService     = _frameService;
            frameShopService = _frameShopService;
            materialService  = _materialService;
            CustomCheckBox   = new ObservableCollection <CheckedListItem <string> >();

            foreach (MaterialModel material in materialService.GetMaterials())
            {
                frameShopService.FrameShopFill(material, myFrameShop);
            }

            foreach (string name in frameShopService.NamesOfMaterials(myFrameShop))
            {
                CustomCheckBox.Add(new CheckedListItem <string>()
                {
                    Item = name
                });
            }
        }
 public DashboardViewModel(IEventAggregator eventAggregator, IFrameService frameService)
 {
     _eventAggregator = eventAggregator;
     _frameService    = frameService;
     eventAggregator.Subscribe(this);
 }
Example #7
0
 public GameService(IFrameService frameService)
 {
     _game = new Game() {FrameNumber = 1, Players = new List<Player>()};
     _frameService = frameService;
 }