Beispiel #1
0
        public EditBeaconViewModel(Beacon beacon)
        {
            //if no beacon - we create new temporary beacon without ID to determine on this page closing is this beacon should be saved
            _model = beacon ?? new Beacon();

            //we never save beacon without a name, so if no beacon - it is creating of new
            Title  = _model.Name ?? Resources.Strings.AddBeaconTitle;
            Name   = _model.Name;
            Device = new BeaconDeviceViewModel();
            Device.Set(_model.Device);

            Category = _model.Category != null?_model.Category.GetFullPath() : Resources.Strings.SelectCategoryTitle;

            EditCategoryCommand = new Command(EditCategoryCommandExecute);
            ChangeBeaconCommand = new Command(ChangeBeaconCommandExecute);
        }
Beispiel #2
0
		public EditBeaconViewModel (Beacon beacon)
		{
			//if no beacon - we create new temporary beacon without ID to determine on this page closing is this beacon should be saved
			_model = beacon ?? new Beacon ();

			//we never save beacon without a name, so if no beacon - it is creating of new
			Title = _model.Name ?? Resources.Strings.AddBeaconTitle;
			Name = _model.Name;
			Device = new BeaconDeviceViewModel ();
			Device.Set (_model.Device);

			Category = _model.Category != null ? _model.Category.GetFullPath () : Resources.Strings.SelectCategoryTitle;

			EditCategoryCommand = new Command (EditCategoryCommandExecute);
			ChangeBeaconCommand = new Command (ChangeBeaconCommandExecute);	
		}
Beispiel #3
0
		private void EditBeacon (Beacon beacon)
		{
			App.Navigation.PushAsync (new EditBeaconPage { BindingContext = new EditBeaconViewModel (beacon) });
		}
Beispiel #4
0
        public BeaconViewModel(Beacon beacon)
        {
            Model = beacon;

            DeleteCommand = new Command(DeleteCommandExecute);
        }
Beispiel #5
0
 private void EditBeacon(Beacon beacon)
 {
     App.Navigation.PushAsync(new EditBeaconPage {
         BindingContext = new EditBeaconViewModel(beacon)
     });
 }
Beispiel #6
0
		public BeaconViewModel (Beacon beacon)
		{
			Model = beacon;

			DeleteCommand = new Command (DeleteCommandExecute);
		}