コード例 #1
0
 public ButtonItem()
 {
     _touchEff = new TouchEffect();
     Effects.Add(_touchEff);
     _touchEff.StateChanged += TouchStateChanged;
     TouchEffect.SetCommand(this, new Command(InternalExecuteCommand));
 }
コード例 #2
0
    public FlatCheckBox()
    {
        InitializeComponent();

        img.IsVisible = Icon != null;

        UpdateColors();
        TouchEffect.SetCommand(this, TapCommand);
    }
コード例 #3
0
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _dialogFrame = (Frame)GetTemplateChild("ModalDialogFrame");

            StackLayout modalDialogContainer = (StackLayout)GetTemplateChild("ModalDialogContainer");

            TouchEffect.SetCommand(modalDialogContainer, DismissCommand);
            TouchEffect.SetShouldMakeChildrenInputTransparent(modalDialogContainer, false);
        }
コード例 #4
0
        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
                }
            };
        }