예제 #1
0
        /// <summary>
        /// OnMinMaxChanged callback responds to any of the Min/Max dependancy properties changing
        /// </summary>
        /// <param name="d"></param>
        /// <param name="e"></param>
        private static void OnMinMaxChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TabControl tc = (TabControl)d;

            if (tc.Template == null)
            {
                return;
            }

            foreach (TabItem child in tc.InternalChildren())
            {
                if (child != null)
                {
                    child.Dimension = null;
                }
            }


            //            var tabsCount = tc.GetTabsCount();
            //            for (int i = 0; i < tabsCount; i++)
            //            {
            //                Header ti = tc.GetTabItem(i);
            //                if (ti != null)
            //                    ti.Dimension = null;
            //            }

            TabPanel tp = Helper.FindVirtualizingTabPanel(tc);

            if (tp != null)
            {
                tp.InvalidateMeasure();
            }
        }
예제 #2
0
        /// <summary>
        /// OnMinMaxChanged callback responds to any of the Min/Max dependency properties changing
        /// </summary>
        /// <param name="d"></param>
        /// <param name="e"></param>
        private static void OnMinMaxChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TabControl tc = (TabControl)d;

            if (tc.Template == null)
            {
                return;
            }

            foreach (TabItem child in tc.InternalChildren())
            {
                if (child != null)
                {
                    child.Dimension = null;
                }
            }

            TabPanel tp = Helper.FindVirtualizingTabPanel(tc);

            tp?.InvalidateMeasure();
        }