Ejemplo n.º 1
0
        public GeneralRequestVisualizer()
        {
            title = NameValuePanel.Create("Title", new TextBox());

            var url = NameValuePanel.Create("URL", new TextBox());
            var method = new ComboBox
            {
                VerticalAlignment = VerticalAlignment.Bottom,
                Margin = new Thickness(0, 0, 5, 0),
                SelectedIndex = 0
            };

            var urlAndMethod = new Grid();
            urlAndMethod.AddColumn(1, GridUnitType.Star);
            urlAndMethod.AddColumn(100, GridUnitType.Pixel);
            urlAndMethod.AddRow(GridLength.Auto);
            urlAndMethod.Add(url, 0, 0);
            urlAndMethod.Add(method, 0, 1);

            var apiGeneralStackPanel = new StackPanel
            {
                Margin = new Thickness(0, 0, 0, 10)
            };
            apiGeneralStackPanel.Children.Add(title);
            apiGeneralStackPanel.Children.Add(urlAndMethod);
            Children.Add(apiGeneralStackPanel);

            this.Bind(x => x.Model.Title).Mate(title.Value);
            this.Bind(x => x.Model.Url).Mate(url.Value);
            this.Bind(x => x.Model.Method).Mate(method, x => x.MainWindow.Methods);
        }