コード例 #1
0
        public MakeShortcutCommand()
        {
            _addAppViewModel = IoC.Get <AddAppViewModel>();
            _addAppViewModel.PropertyChanged += AddAppViewModelOnPropertyChanged;

            if (_addAppViewModel.Application != null)
            {
                _lastConfig = _addAppViewModel.Application.Config;
                _lastConfig.PropertyChanged += ApplicationOnLocationPropertyChanged;
            }
        }
コード例 #2
0
        public AddAppPage() : base()
        {
            InitializeComponent();

            // Setup ViewModel
            _model                  = IoC.Get <AddAppViewModel>();
            this.DataContext        = _model;
            this.AnimateOutStarted += SaveCurrentSelection;

            _setApplicationImageCommand = new SetApplicationImageCommand();
        }
コード例 #3
0
        public AddAppPage() : base()
        {
            InitializeComponent();

            // Setup ViewModel
            ViewModel                       = IoC.Get <AddAppViewModel>();
            this.DataContext                = ViewModel;
            this.AnimateOutStarted         += SaveCurrentSelectedItem;
            this.AnimateOutStarted         += Dispose;
            IoC.Get <MainWindow>().Closing += OnMainWindowClosing;
            this.AnimateInStarted          += SetDefaultSelectionIndex;
        }
コード例 #4
0
        public AddAppViewModel CreateNewApp()
        {
            string          guid   = Guid.NewGuid().ToString();
            AddAppViewModel result = new AddAppViewModel()
            {
                Guid = guid
            };

            repository.Add(guid, result);
            result.Saved += OnAppSaved;
            return(result);
        }
コード例 #5
0
        public async Task <IActionResult> App(int id, AddAppViewModel AddAppViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(Ok(new { code = 0, msg = BadRequest(ModelState).Value }));
            }

            _context.Project.SingleOrDefault(m => m.Id == id).App.Add(new App {
                Name = AddAppViewModel.Name, CreateTime = DateTime.Now, Number = AddAppViewModel.Number, FileUrl = AddAppViewModel.FileUrl
            });

            await _context.SaveChangesAsync();

            return(Ok(new { code = 1, msg = "ok" }));
        }
コード例 #6
0
 public DeployAsiLoaderCommand(AddAppViewModel addAppViewModel)
 {
     ViewModel = addAppViewModel;
     ViewModel.PropertyChanged += AddAppViewModelOnPropertyChanged;
     SetCurrentApplication();
 }
コード例 #7
0
 public SetApplicationImageCommand()
 {
     _addAppViewModel = IoC.Get <AddAppViewModel>();
 }
コード例 #8
0
 public AddApplicationCommand()
 {
     _addAppViewModel   = IoC.Get <AddAppViewModel>();
     _mainPageViewModel = _addAppViewModel.MainPageViewModel;
 }
コード例 #9
0
 public DeleteApplicationCommand(AddAppViewModel addAppViewModel)
 {
     _addAppViewModel = addAppViewModel;
     _addAppViewModel.MainPageViewModel.ApplicationsChanged += RaiseCanExecute;
     _addAppViewModel.PropertyChanged += AddAppViewModelOnPropertyChanged;
 }
コード例 #10
0
 public AddApplicationCommand(AddAppViewModel addAppViewModel)
 {
     _addAppViewModel   = addAppViewModel;
     _mainPageViewModel = _addAppViewModel.MainPageViewModel;
 }
コード例 #11
0
 public DeleteApplicationCommand()
 {
     _addAppViewModel = IoC.Get <AddAppViewModel>();
     _addAppViewModel.MainPageViewModel.ApplicationsChanged += RaiseCanExecute;
     _addAppViewModel.PropertyChanged += AddAppViewModelOnPropertyChanged;
 }
コード例 #12
0
 public AddApplicationCommand()
 {
     _addAppViewModel = IoC.Get <AddAppViewModel>();
 }
コード例 #13
0
 public SetApplicationImageCommand(AddAppViewModel model)
 {
     _addAppViewModel = model;
 }
コード例 #14
0
        private void OnAppSaved(object sender, EventArgs e)
        {
            AddAppViewModel model = (AddAppViewModel)sender;

            repository.Remove(model.Guid);
        }