public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel ref_row = new WDetailSingleRowViewModel(display_name);

            WActorReferenceControl ref_ctrl = new WActorReferenceControl();

            ref_ctrl.IsEnabled = is_editable;

            Binding tbind = new Binding(property.Name)
            {
                Source = source,
                Mode   = is_editable ? BindingMode.TwoWay : BindingMode.OneWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
                Converter           = new WDOMNodeConverter()
            };

            ref_ctrl.SetBinding(WActorReferenceControl.ActorReferenceProperty, tbind);

            ref_row.PropertyControl = ref_ctrl;

            return(new List <WDetailSingleRowViewModel>()
            {
                ref_row
            });
        }
        public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel file_row = new WDetailSingleRowViewModel(display_name);

            FileReferenceControl fileref = new FileReferenceControl();

            fileref.IsEnabled = is_editable;
            fileref.FieldName = property.Name;

            FileReference thing = property.GetValue(source) as FileReference;

            Binding tbind = new Binding("FilePath")
            {
                Source = thing,
                Mode   = BindingMode.TwoWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };

            fileref.SetBinding(FileReferenceControl.FileNameProperty, tbind);

            file_row.PropertyControl = fileref;

            return(new List <WDetailSingleRowViewModel>()
            {
                file_row
            });
        }
Beispiel #3
0
        public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel enum_row = new WDetailSingleRowViewModel(display_name);

            WatermarkComboBox cbox = new WatermarkComboBox();

            cbox.IsEnabled = is_editable;

            Array enum_values = Enum.GetValues(property.PropertyType);

            for (int i = 0; i < enum_values.Length; i++)
            {
                string display_value = enum_values.GetValue(i).ToString();
                display_value = display_value.Replace("_", " ").Trim();
                cbox.Items.Add(display_value);
            }

            Binding tbind = new Binding(property.Name)
            {
                Source = source,
                Mode   = is_editable ? BindingMode.TwoWay : BindingMode.OneWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
                Converter           = new EnumValueConverter()
            };

            cbox.SetBinding(WatermarkComboBox.SelectedIndexProperty, tbind);

            enum_row.PropertyControl = cbox;

            return(new List <WDetailSingleRowViewModel>()
            {
                enum_row
            });
        }
Beispiel #4
0
        public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel color_row = new WDetailSingleRowViewModel(display_name);

            ColorPicker colorpicker = new ColorPicker();

            colorpicker.IsEnabled = is_editable;

            Binding tbind = new Binding(property.Name)
            {
                Source = source,
                Mode   = is_editable ? BindingMode.TwoWay : BindingMode.OneWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
                Converter           = new LinearToSystemColorConverter()
            };

            colorpicker.SetBinding(ColorPicker.SelectedColorProperty, tbind);

            color_row.PropertyControl = colorpicker;

            return(new List <WDetailSingleRowViewModel>()
            {
                color_row
            });
        }
        public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel text_row = new WDetailSingleRowViewModel(display_name);

            TextReferenceControl textref = new TextReferenceControl();

            textref.IsEnabled = is_editable;
            textref.DoLookup  = m_TextEditorRef.OnUserRequestOpenReference;

            MessageReference thing = property.GetValue(source) as MessageReference;

            Binding tbind = new Binding("MessageID")
            {
                Source = thing,
                Mode   = is_editable ? BindingMode.TwoWay : BindingMode.OneWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };

            textref.SetBinding(TextReferenceControl.MessageIDProperty, tbind);

            text_row.PropertyControl = textref;

            return(new List <WDetailSingleRowViewModel>()
            {
                text_row
            });
        }
        List <WDetailSingleRowViewModel> IPropertyTypeCustomization.CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WTransformControl pos_ctrl   = new WTransformControl();
            WTransformControl scale_ctrl = new WTransformControl();
            WTransformControl rot_ctrl   = new WTransformControl();

            WTransform transform = property.GetValue(source) as WTransform;

            Binding pos_bind = new Binding("Position")
            {
                Source = transform,
                Mode   = BindingMode.TwoWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };

            pos_ctrl.SetBinding(WTransformControl.Vector3Property, pos_bind);

            WDetailSingleRowViewModel pos_row = new WDetailSingleRowViewModel("Position");

            pos_row.PropertyControl = pos_ctrl;
            WDetailSingleRowViewModel rot_row = new WDetailSingleRowViewModel("Rotation");

            rot_row.PropertyControl = rot_ctrl;
            WDetailSingleRowViewModel scale_row = new WDetailSingleRowViewModel("Scale");

            scale_row.PropertyControl = scale_ctrl;

            return(new List <WDetailSingleRowViewModel>()
            {
                pos_row, rot_row, scale_row
            });
        }
Beispiel #7
0
        public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel textbox_row = new WDetailSingleRowViewModel(display_name);

            TextBox tbox = new TextBox();

            tbox.IsEnabled = is_editable;

            Binding tbind = new Binding(property.Name);

            tbind.Source = source;
            tbind.Mode   = BindingMode.TwoWay;
            tbind.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;

            tbox.SetBinding(TextBox.TextProperty, tbind);

            textbox_row.PropertyControl = tbox;

            return(new List <WDetailSingleRowViewModel>()
            {
                textbox_row
            });
        }
Beispiel #8
0
        public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel short_row = new WDetailSingleRowViewModel(display_name);

            UShortUpDown shortupdown = new UShortUpDown();

            shortupdown.IsEnabled = is_editable;

            Binding tbind = new Binding(property.Name);

            tbind.Source = source;
            tbind.Mode   = is_editable ? BindingMode.TwoWay : BindingMode.OneWay;
            tbind.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;

            shortupdown.SetBinding(UShortUpDown.ValueProperty, tbind);

            short_row.PropertyControl = shortupdown;

            return(new List <WDetailSingleRowViewModel>()
            {
                short_row
            });
        }
Beispiel #9
0
        public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel integer_row = new WDetailSingleRowViewModel(display_name);

            IntegerUpDown integerupdown = new IntegerUpDown();

            integerupdown.IsEnabled = is_editable;

            Binding tbind = new Binding(property.Name);

            tbind.Source = source;
            tbind.Mode   = BindingMode.TwoWay;
            tbind.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;

            integerupdown.SetBinding(IntegerUpDown.ValueProperty, tbind);

            integer_row.PropertyControl = integerupdown;

            return(new List <WDetailSingleRowViewModel>()
            {
                integer_row
            });
        }
        public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel byte_row = new WDetailSingleRowViewModel(display_name);

            ByteUpDown byteupdown = new ByteUpDown();

            byteupdown.IsEnabled = is_editable;

            Binding tbind = new Binding(property.Name)
            {
                Source = source,
                Mode   = BindingMode.TwoWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };

            byteupdown.SetBinding(ByteUpDown.ValueProperty, tbind);

            byte_row.PropertyControl = byteupdown;

            return(new List <WDetailSingleRowViewModel>()
            {
                byte_row
            });
        }
        public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel bool_row = new WDetailSingleRowViewModel(display_name);

            CheckBox c_box = new CheckBox();

            c_box.IsEnabled = is_editable;

            Binding tbind = new Binding(property.Name)
            {
                Source = source,
                Mode   = BindingMode.TwoWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };

            c_box.SetBinding(CheckBox.IsCheckedProperty, tbind);

            bool_row.PropertyControl = c_box;

            return(new List <WDetailSingleRowViewModel>()
            {
                bool_row
            });
        }
        public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel combo_row = new WDetailSingleRowViewModel(display_name);

            WAdvancedBindingListControl list_control = new WAdvancedBindingListControl <T>();

            list_control.IsEnabled = is_editable;

            Binding tbind = new Binding(property.Name)
            {
                Source = source,
                Mode   = is_editable ? BindingMode.TwoWay : BindingMode.OneWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };

            list_control.SetBinding(WAdvancedBindingListControl <T> .BoundListProperty, tbind);

            combo_row.PropertyControl = list_control;

            return(new List <WDetailSingleRowViewModel>()
            {
                combo_row
            });
        }
        public List <WDetailSingleRowViewModel> CustomizeHeader(PropertyInfo property, string display_name, bool is_editable, object source)
        {
            WDetailSingleRowViewModel cut_row = new WDetailSingleRowViewModel(display_name);
            Event ev = source as Event;

            CutReferenceControl cut_ctrl = new CutReferenceControl();

            cut_ctrl.IsEnabled = is_editable;

            Binding cbind = new Binding("Actors")
            {
                Source = source,
                Mode   = is_editable ? BindingMode.TwoWay : BindingMode.OneWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
            };

            cut_ctrl.SetBinding(CutReferenceControl.StaffCollectionReferenceProperty, cbind);

            Binding tbind = new Binding(property.Name)
            {
                Source = source,
                Mode   = is_editable ? BindingMode.TwoWay : BindingMode.OneWay,
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
                Converter           = new CutConverter()
            };

            cut_ctrl.SetBinding(CutReferenceControl.CutReferenceProperty, tbind);

            cut_row.PropertyControl = cut_ctrl;
            cut_ctrl.SetReferences();

            return(new List <WDetailSingleRowViewModel>()
            {
                cut_row
            });
        }