예제 #1
0
        public static Tuple<UIElement, Func<object>> GetStringPropertyEditControls(this NodeProperty property)
        {
            var panel = new StackPanel();
            TextBox textBox = panel.AddTextBoxForPropertyEditing(property);

            Func<object> callback = () => textBox.Text;
            return Tuple.Create(panel as UIElement, callback);
        }
예제 #2
0
        public static Tuple<UIElement, Func<object>> GetIntPropertyEditControls(this NodeProperty property)
        {
            var panel = new StackPanel();
            TextBox textBox = panel.AddTextBoxForPropertyEditing(property);
            // Maybe add some validation here later ...

            Func<object> callback = () =>
                                        {
                                            int value;
                                            int.TryParse(textBox.Text, out value);
                                            return value;
                                        };
            return Tuple.Create(panel as UIElement, callback);
        }