Example #1
0
        public NinjaModificationDialog(ninja ninja = null)
        {
            InitializeComponent();

            DataContext = new NinjaModificationViewModel
            {
                Ninja = new NinjaCrudModel(ninja)
            };
        }
Example #2
0
        public void SaveNinja(ninja ninja)
        {
            Context.ninjas.AddOrUpdate(ninja);

            NinjasChanged();
            if (ninja == CurrentNinja)
            {
                CurrentNinjaChanged();
            }
        }
Example #3
0
        public void DeleteNinja(ninja ninja)
        {
            ninja.equipment.Clear();
            Context.ninjas.Remove(ninja);

            NinjasChanged();
            if (ninja == CurrentNinja)
            {
                CurrentNinjaChanged();
            }
        }
Example #4
0
        public NinjaCrudModel(ninja ninja = null)
        {
            OriginalNinja = ninja ?? new ninja();

            Name = OriginalNinja.name;
        }
Example #5
0
        public void SetModel(ninja ninja)
        {
            _ninja = new NinjaCrudModel(ninja);

            RaisePropertyChanged(nameof(Ninja));
        }