public AtomChooserPage(AtomChooser chooser) { InitializeComponent(); this.Chooser = chooser; DoneCommand = new AtomCommand(async() => await OnDoneCommandAsync()); Init(); }
//ScrollView scrollView = new ScrollView(); public AtomImageCropper() { //this.Padding = new Thickness(10); //Children.Add(zoomView); //croppedImage.Margin = new Thickness(320, 320, 320, 320); //zoomView.Padding = new Thickness(320, 320, 320, 320); maskView.SetBinding(AtomMaskBox.BackgroundColorProperty, new Binding { Path = nameof(CropMarginColor), Source = this }); zoomView.Content = croppedImage; zoomView.SetBinding(AtomZoomView.IsEnabledProperty, new Binding() { Path = nameof(CanUndo), Source = this, Converter = NegateBooleanConverter.Instance }); //cropContainer.Content = zoomView; cropContainer.Children.Add(zoomView); cropContainer.HorizontalOptions = LayoutOptions.Center; cropContainer.VerticalOptions = LayoutOptions.Center; //cropContainer.BackgroundColor = Color.Red; cropContainer.SetBinding(Grid.BackgroundColorProperty, new Binding { Path = nameof(CropErrorColor), Source = this }); Children.Add(cropContainer); Children.Add(maskView); //this.Margin = new Thickness(50, 50, 50, 50); //this.IsClippedToBounds = true; croppedImage.PropertyChanged += OnImagePropertyChanged; cropContainer.PropertyChanged += OnCropContainerPropertyChanged; zoomView.PropertyChanged += OnZoomViewPropertyChanged; //ResizeCropContainer(); CropCommand = new AtomCommand(async() => { await OnCropCommandAsync(); }); UndoCommand = new AtomCommand(() => { // try to delete... System.IO.File.Delete(CroppedFile); CroppedFile = null; Source = originalSource; originalSource = null; CanUndo = false; return(Task.CompletedTask); }); }
public NavigatorListSampleViewModel() { this.TapCommand = new AtomCommand <Country>(async country => await OnTapCommandAsync(country)); this.DeleteCommand = new AtomCommand <IEnumerable <Country> >(async countries => await OnDeleteCommandAsync(countries)); }
public ItemSelectorPageViewModel() { this.CancelCommand = new AtomCommand(async() => await OnCancelCommandAsync()); this.SelectCommand = new AtomCommand(async() => await OnSelectCommandAsync()); }
public AtomPopupToolbarItem() { Command = new AtomCommand(async() => await OnCommandAsync()); }
public MediaPlayerPageViewModel() { NextCommand = new AtomCommand(async() => await PlayNextVideos()); PlayCommand = new AtomCommand(async() => await PlayVideos()); }
public FormDemoPageViewModel() { //Refresh(); LoginCommand = new AtomCommand(async() => await OnLoginAsync()); }