Exemplo n.º 1
0
        public void BindColumn(IComponent targetComponent, string sourcePath, IGuiConverter converter)
        {               //****************************************
            WinBoundControl Source;

            //****************************************

            if (targetComponent is ColumnHeader)
            {
                if (!_BoundControls.TryGetValue(((ColumnHeader)targetComponent).ListView, out Source))
                {
                    throw new ArgumentException("Parent ListView is not yet bound");
                }

                ((WinListView)Source).BindColumn(sourcePath, (ColumnHeader)targetComponent, converter);
            }
            else if (targetComponent is ListControl)
            {
                if (!_BoundControls.TryGetValue((ListControl)targetComponent, out Source))
                {
                    throw new ArgumentException("Control Source is not yet bound");
                }

                ((WinListControl)Source).BindColumn(sourcePath, converter);
            }
            else if (targetComponent is TabControl)
            {
                if (!_BoundControls.TryGetValue((TabControl)targetComponent, out Source))
                {
                    throw new ArgumentException("Control Source is not yet bound");
                }

                ((WinTabControl)Source).BindTitle(sourcePath, converter);
            }
        }
        //****************************************

        internal void BindColumn(string sourceProperty, ColumnHeader column, IGuiConverter converter)
        {
            if (column.DisplayIndex != _Columns.Count)
            {
                throw new InvalidOperationException("Columns must be bound in their initial order");
            }

            _Columns.Add(new ColumnBinding(sourceProperty, converter));
        }
        //****************************************

        internal void BindSelection(WinBoundListControl sourceList, string sourcePath, IGuiConverter converter)
        {
            _SelectedConverter = converter;

            _SelectedMonitor = new WinMonitor(sourcePath);
            _SelectedMonitor.ValueChanged += OnValueChanged;

            if (sourceList != null)
            {
                _SelectedMonitor.Target = sourceList;
            }
        }
Exemplo n.º 4
0
        internal void BindVisible(WinBoundListControl sourceList, string sourcePath, IGuiConverter converter)
        {
            _VisibleConverter = converter;

            _VisibleMonitor = new WinMonitor(sourcePath);
            _VisibleMonitor.ValueChanged += OnVisibleChanged;

            if (sourceList != null)
            {
                _VisibleMonitor.Target = sourceList;
            }
        }
Exemplo n.º 5
0
        //****************************************

        internal WpfConverter(IGuiConverter converter)
        {
            _Converter = converter;
        }
Exemplo n.º 6
0
        public void Bind(Control sourceControl, string sourcePath, Control targetControl, IGuiConverter converter)
        {               //****************************************
            WinBoundControl Source = null, Target;

            //****************************************

            if (sourceControl != null && !_BoundControls.TryGetValue(sourceControl, out Source))
            {
                throw new ArgumentException("Source Control is not bound to anything");
            }

            if (!_BoundControls.TryGetValue(targetControl, out Target))
            {
                Target = WinBoundControl.GetControl(this, targetControl);

                _BoundControls.Add(targetControl, Target);
            }

            Target.Bind(Source as WinBoundListControl, sourcePath, converter);
        }
        //****************************************

        internal void BindColumn(string sourcePath, IGuiConverter converter)
        {
            _DisplayPath = sourcePath.Split('.');
            _Converter   = converter;
        }
            //****************************************

            public ColumnBinding(string sourceProperty, IGuiConverter converter)
            {
                this.SourceSegments = sourceProperty.Split('.');
                this.Converter      = converter;
            }