public ButtonItem() { _touchEff = new TouchEffect(); Effects.Add(_touchEff); _touchEff.StateChanged += TouchStateChanged; TouchEffect.SetCommand(this, new Command(InternalExecuteCommand)); }
public FlatCheckBox() { InitializeComponent(); img.IsVisible = Icon != null; UpdateColors(); TouchEffect.SetCommand(this, TapCommand); }
protected override void OnApplyTemplate() { base.OnApplyTemplate(); _dialogFrame = (Frame)GetTemplateChild("ModalDialogFrame"); StackLayout modalDialogContainer = (StackLayout)GetTemplateChild("ModalDialogContainer"); TouchEffect.SetCommand(modalDialogContainer, DismissCommand); TouchEffect.SetShouldMakeChildrenInputTransparent(modalDialogContainer, false); }
public MainPage() { InitializeComponent(); var absoluteLabel = new Label { Text = "Absolute Navigation", HeightRequest = 50 }; TouchEffect.SetCommandParameter(absoluteLabel, "Absolute"); TouchEffect.SetCommand(absoluteLabel, new Command((obj) => { Console.WriteLine(obj); Application.Current.MainPage = new MainPage(); })); var relativeLabel = new Label { Text = "Relative Navigation", HeightRequest = 50 }; TouchEffect.SetCommandParameter(relativeLabel, "Relative"); TouchEffect.SetCommand(relativeLabel, new Command(async(obj) => { Console.WriteLine(obj); await Navigation.PushAsync(new MainPage()); })); var goBackLabel = new Label { Text = "Back Navigation", HeightRequest = 50 }; TouchEffect.SetCommandParameter(goBackLabel, "Back"); TouchEffect.SetCommand(goBackLabel, new Command(async(obj) => { Console.WriteLine(obj); await Navigation.PopAsync(); })); this.Content = new StackLayout { Children = { absoluteLabel, relativeLabel, goBackLabel } }; }