コード例 #1
0
        /// <summary>
        /// Nézetmodell példányosítása.
        /// </summary>
        /// <param name="model">A modell.</param>
        public LoginViewModel(ICarServiceModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            _model   = model;
            UserName = String.Empty;

            ExitCommand = new DelegateCommand(param => OnExitApplication());

            LoginCommand = new DelegateCommand(param => LoginAsync(param as PasswordBox));
        }
コード例 #2
0
        public MainViewModel(ICarServiceModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            _model = model;


            LoadAsync();
            LoadCommand            = new DelegateCommand(param => LoadAsync());
            SaveCommand            = new DelegateCommand(param => SaveAsync());
            OpenEditorCommand      = new DelegateCommand(param => EditWorksheet(param as AppointmentDTO));
            CloseWorksheetCommand  = new DelegateCommand(param => CloseWorksheet());
            SaveWorksheetCommand   = new DelegateCommand(param => SaveWorksheet());
            CancelWorksheetCommand = new DelegateCommand(param => CancelWorksheet());
            //ExitCommand = new DelegateCommand(param => OnExitApplication());
            LogoutCommand         = new DelegateCommand(param => OnLogout());
            AddWorkItemCommand    = new DelegateCommand(param => AddWorkItem());
            DeleteWorkItemCommand = new DelegateCommand(param => DeleteWorkItem());
        }
コード例 #3
0
ファイル: App.xaml.cs プロジェクト: sarkanyjulia/CarService
 private void App_Startup(object sender, StartupEventArgs e)
 {
     _model = new CarServiceModel(new CarServicePersistence("https://localhost:44300/")); // megadjuk a szolgáltatás címét
     ShowLoginWindow();
 }