コード例 #1
0
        private void _Create()
        {
            var model = new SteamKeyViewModel();

            model.PropertyChanged += Model_PropertyChanged;

            _models.Add(model);
            _repository.Add(model);

            SelectedIndex = Models.IndexOf(model);
        }
コード例 #2
0
        public SteamKeyRepositoryViewModel(JsonFile file)
        {
            Search = new Command(_Search);
            Create = new Command(_Create);
            Delete = new Command(_Delete);

            _repository = new SteamKeyRepository(file);

            foreach (var key in _repository.Items.Where(x => x.hidden == false).OrderBy(x => x.title))
            {
                var model = new SteamKeyViewModel(key);
                model.PropertyChanged += Model_PropertyChanged;

                _models.Add(model);
            }
        }