コード例 #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);
        }
コード例 #2
0
ファイル: EditBeaconViewModel.cs プロジェクト: Fitabase/Prox
		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);	
		}
コード例 #3
0
		private void EditBeacon (Beacon beacon)
		{
			App.Navigation.PushAsync (new EditBeaconPage { BindingContext = new EditBeaconViewModel (beacon) });
		}
コード例 #4
0
        public BeaconViewModel(Beacon beacon)
        {
            Model = beacon;

            DeleteCommand = new Command(DeleteCommandExecute);
        }
コード例 #5
0
 private void EditBeacon(Beacon beacon)
 {
     App.Navigation.PushAsync(new EditBeaconPage {
         BindingContext = new EditBeaconViewModel(beacon)
     });
 }
コード例 #6
0
ファイル: BeaconViewModel.cs プロジェクト: Fitabase/Prox
		public BeaconViewModel (Beacon beacon)
		{
			Model = beacon;

			DeleteCommand = new Command (DeleteCommandExecute);
		}