예제 #1
0
        public ColumnController(GridViewColumn GVC, ColumnTracker CT, ColumnUnitType GUT, double _Width)
        {
            ColumnTracker = CT;
            Width         = _Width;

            switch (ColumnUnitType = GUT)
            {
            case ColumnUnitType.Pixel: IsFixed = false; break;

            case ColumnUnitType.HeaderWidth: Column.Width = GetWidth(); goto case ColumnUnitType.Star;

            case ColumnUnitType.Star: IsFixed = true; break;
            }
            INotifyPropertyChanged INP = (Column = GVC) as INotifyPropertyChanged;

            INP.PropertyChanged += Columen_SizeChanged;
        }
예제 #2
0
        public void SetWidth()
        {
            if (!BlockSetWidth)
            {
                BlockColumnUpdate = true;
                switch (ColumnUnitType)
                {
                case ColumnUnitType.Pixel:
                    if (IsFixed)
                    {
                        Column.Width = Width;
                    }
                    else
                    {
                        Width = Column.Width;
                        ColumnTracker.Refresh();
                    }

                    break;

                case ColumnUnitType.HeaderWidth: Column.Width = GetHeaderWidth(); break;

                case ColumnUnitType.Star:
                    //if (IsFixed)
                    //{
                    Column.Width = Width * ColumnTracker.StarWidth;
                    //}
                    //else
                    //{
                    //    double HypoWid = ColumnTracker.LSTWidth / GetWidth();
                    //    if (HypoWid == Width)
                    //        Width = ColumnTracker.LSTWidth / GetWidth();
                    //    BlockSetWidth = true;
                    //    ColumnTracker.UpdateColumnWidths();
                    //    BlockSetWidth = false;
                    //}
                    break;
                }
            }
            BlockColumnUpdate = false;
        }