コード例 #1
0
 public ConfigurationViewModel(IDiceService diceService, IDiceDataBase diceDataBase)
 {
     //first step
     _diceService    = diceService;
     _diceDataBase   = diceDataBase;
     ResetBagCommand = new Command(ExecuteResetBagCommand);
 }
コード例 #2
0
        public MasterViewModel(IDiceService diceService, IDiceDataBase diceDataBase)
        {
            //first step
            _diceService  = diceService;
            _diceDataBase = diceDataBase;

            ListBag = new ObservableCollection <Bag>();

            CreateNewBagCommand    = new Command(ExecuteCreateNewBagCommand);
            GoConfigurationCommand = new Command(ExecuteGoConfigurationCommand);
        }
コード例 #3
0
        public BagViewModel(IDiceService diceService, IDiceDataBase diceDataBase, Bag bag)
        {
            //first step
            _diceService  = diceService;
            _diceDataBase = diceDataBase;
            Bag           = bag;

            ListGroupDice = new ObservableCollection <GroupDice>();
            MarkItem      = new List <GroupDice>();

            //Commands
            GroupDicePageCommand = new Command(ExecuteGroupDicePageCommand);

            //Set proprety
            CreateBagState();
            LoadDataToObject();
        }
コード例 #4
0
        public RoomViewModel(IDiceService diceService, IDiceDataBase diceDataBase, Bag bag = null)
        {
            _diceService  = diceService;
            _diceDataBase = diceDataBase;
            Bag           = bag == null?GetBagConfiguration() : bag;

            IsLoading = false;

            GroupDices = new CustomObservableCollection <GroupDice>();
            LogRoll    = new CustomObservableCollection <LogRoll>();


            //Commands
            RollDiceCommand = new Command <GroupDice>(ExecuteRollDiceCommand);
            BagPageCommand  = new Command(ExecuteBagPageCommand);
            ResetBagCommand = new Command(ExecuteResetBagCommand);
            ClearLogCommand = new Command(ExecuteClearLogCommand);
        }
コード例 #5
0
        public GroupDiceViewModel(IDiceService diceService, IDiceDataBase diceDataBase, Bag bag)
        {
            //first step
            _diceService  = diceService;
            _diceDataBase = diceDataBase;
            Bag           = bag;

            ListDices = new ObservableCollection <Dice>();
            ListDices.Add(new Dice()
            {
                Quantity = 1, NumberFaceOfDice = 20
            });

            //Command
            AddDiceCommand        = new Command(ExecuteAddDiceCommand);
            RemoveLastDiceCommand = new Command(ExecuteRemoveLastDiceCommand);
            SaveCommand           = new Command(ExecuteSaveCommand);
            CancelDiceCommand     = new Command(ExecuteCancelDiceCommand);
            AddModifierCommand    = new Command(ExecuteAddModifierCommand);
        }