Ejemplo n.º 1
0
            public BindingDisplay(PluginSettingStore store)
            {
                var bindingCommand = new Command();

                bindingCommand.Executed += async(sender, e) =>
                {
                    var dialog = new BindingEditorDialog(Binding);
                    this.Binding = await dialog.ShowModalAsync(this);
                };
                var advancedBindingCommand = new Command();

                advancedBindingCommand.Executed += async(sender, e) =>
                {
                    var dialog = new AdvancedBindingEditorDialog(Binding);
                    this.Binding = await dialog.ShowModalAsync(this);
                };

                mainButton = new Button
                {
                    Command = bindingCommand
                };
                advancedButton = new Button
                {
                    Command = advancedBindingCommand,
                    Text    = "...",
                    Width   = 25
                };

                Spacing     = 5;
                Orientation = Orientation.Horizontal;
                Items.Add(new StackLayoutItem(mainButton, true));
                Items.Add(advancedButton);

                this.Binding = store;
            }
Ejemplo n.º 2
0
        public BindingDisplay()
        {
            this.DataContext = new BindingViewModel();
            this.TextBinding.BindDataContext((BindingViewModel m) => m.Binding);

            var bindingCommand = new Command();

            bindingCommand.BindDataContext(c => c.MenuText, (BindingViewModel m) => m.Binding);
            bindingCommand.Executed += async(sender, e) =>
            {
                var dialog = new BindingEditorDialog(ViewModel.Binding);
                ViewModel.Binding = await dialog.ShowModalAsync(this);
            };
            this.Command = bindingCommand;

            ViewModel.BindingUpdated += (s, e) => BindingUpdated?.Invoke(this, e);
        }
Ejemplo n.º 3
0
        public BindingDisplay()
        {
            this.Content = new StackLayout
            {
                Spacing     = 5,
                MinimumSize = new Size(300, 0),
                Orientation = Orientation.Horizontal,
                Items       =
                {
                    new StackLayoutItem
                    {
                        Expand  = true,
                        Control = mainButton = new Button()
                    },
                    new StackLayoutItem
                    {
                        Control = advancedButton = new Button
                        {
                            Text  = "...",
                            Width = 25
                        }
                    }
                }
            };

            mainButton.TextBinding.Bind(this.StoreBinding.Convert <string>(s => s?.GetHumanReadableString()));

            mainButton.Click += async(sender, e) =>
            {
                var dialog = new BindingEditorDialog(Store);
                this.Store = await dialog.ShowModalAsync(this);
            };

            advancedButton.Click += async(sender, e) =>
            {
                var dialog = new AdvancedBindingEditorDialog(Store);
                this.Store = await dialog.ShowModalAsync(this);
            };
        }
        public BindingDisplay(string binding)
        {
            Binding = BindingReference.FromString(binding);

            var bindingCommand = new Command();

            bindingCommand.Executed += async(sender, e) =>
            {
                var dialog = new BindingEditorDialog(Binding);
                Binding = await dialog.ShowModalAsync(this);
            };
            this.Command = bindingCommand;

            this.MouseDown += async(s, e) =>
            {
                if (e.Buttons.HasFlag(MouseButtons.Alternate))
                {
                    var dialog = new AdvancedBindingEditorDialog(Binding);
                    Binding = await dialog.ShowModalAsync(this);
                }
            };
        }
Ejemplo n.º 5
0
            public BindingDisplay(PluginSettingStore store)
            {
                this.Binding = store;

                var bindingCommand = new Command();

                bindingCommand.Executed += async(sender, e) =>
                {
                    var dialog = new BindingEditorDialog(Binding);
                    this.Binding = await dialog.ShowModalAsync(this);
                };
                this.Command = bindingCommand;

                this.MouseDown += async(s, e) =>
                {
                    if (e.Buttons.HasFlag(MouseButtons.Alternate))
                    {
                        var dialog = new AdvancedBindingEditorDialog(Binding);
                        this.Binding = await dialog.ShowModalAsync(this);
                    }
                };
            }