Exemplo n.º 1
0
        public RFiDChipChildLayerViewModel(
            MifareDesfireAppModel appID,
            RFiDChipParentLayerViewModel parentUID,
            CARD_TYPE cardType,
            ObservableCollection <IDialogViewModel> _dialogs = null,
            bool?_isTask = null)
        {
            if (_dialogs != null)
            {
                dialogs = _dialogs;
            }

            isTask = _isTask;

            //device = _device;
            appModel   = appID;
            _cardType  = cardType;
            _parentUid = parentUID != null ? parentUID.UidNumber : null;

            _cmdReadSectorWithDefaults  = new RelayCommand(ReadSectorWithDefaults);
            _cmdEditAuthAndModifySector = new RelayCommand(ReadSectorWithCustoms);

            ContextMenuItems = new List <MenuItem>();
            ContextMenuItems.Add(new MenuItem()
            {
                Header  = "Read Sector using default Configuration",
                Command = _cmdReadSectorWithDefaults
            });

            ContextMenuItems.Add(new MenuItem()
            {
                Header  = "Edit Authentication Settings and Modify Sector",
                Command = _cmdEditAuthAndModifySector
            });

            children = new ObservableCollection <RFiDChipGrandChildLayerViewModel>();

            LoadChildren();
        }
Exemplo n.º 2
0
//		public RFiDChipChildLayerViewModel(
//			MifareClassicSectorModel _sectorModel,
//			MifareClassicSetupViewModel _setupViewModel)
//		{
//			sectorModel = _sectorModel;
//			setupViewModel = _setupViewModel;
//
//			isTask = true;
//			children = new ObservableCollection<RFiDChipGrandChildLayerViewModel>();
//
//			LoadChildren();
//		}

        public RFiDChipChildLayerViewModel(
            MifareClassicSectorModel _sectorModel,
            RFiDChipParentLayerViewModel parent,
            CARD_TYPE cardType,
            ObservableCollection <IDialogViewModel> _dialogs = null,
            bool?_isTask = null)
        {
            if (_dialogs != null)
            {
                dialogs = _dialogs;
            }

            isTask      = _isTask;
            sectorModel = _sectorModel;
            _cardType   = cardType;
            _parent     = parent;

            _cmdReadSectorWithDefaults  = new RelayCommand(ReadSectorWithDefaults);
            _cmdEditAuthAndModifySector = new RelayCommand(ReadSectorWithCustoms);
            _cmdReadSectorWithCustoms   = new RelayCommand(ReadSectorWithCustoms);

            ContextMenuItems = new List <MenuItem>();
            ContextMenuItems.Add(new MenuItem()
            {
                Header  = "Read Sector with default Keys",
                Command = _cmdReadSectorWithDefaults
            });

            ContextMenuItems.Add(new MenuItem()
            {
                Header  = "Read Sector with custom Keys",
                Command = _cmdReadSectorWithCustoms
            });

            children = new ObservableCollection <RFiDChipGrandChildLayerViewModel>();

            LoadChildren();
        }