Esempio n. 1
0
        private static void CurColumnChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TrackDevice tack = d as TrackDevice;

            if (tack == null)
            {
                return;
            }

            tack.SetDevicePosByColumn(tack.CurColumn);

            tack.OldColumn = tack.CurColumn;
        }
Esempio n. 2
0
        private static void TotalColumnChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TrackDevice tack = d as TrackDevice;

            if (tack == null)
            {
                return;
            }

            //设置长度
            if (tack.TotalColumn <= 0)
            {
                tack.TotalColumn = 1;
            }

            if (tack.ActualWidth > 10)
            {
                tack.bDevice.Width = tack.ActualWidth / tack.TotalColumn;
            }

            tack.SetDevicePosByColumn(tack.CurColumn);
        }