コード例 #1
0
        private void MainPivot_Loaded(object sender, RoutedEventArgs e)
        {
            var width      = Math.Max(MainPivot.ActualWidth / 3 - 24, 0);
            var headerTxts = VisualHelper.FindVisualChilds <TextBlock>(MainPivot, "HeaderTxt");

            if (headerTxts != null)
            {
                headerTxts.ForEach(headerTxt => headerTxt.Width = width);
            }
        }
コード例 #2
0
ファイル: Searcher.xaml.cs プロジェクト: brookshi/DuDuRiBao
        private void SearchPivot_Loaded(object sender, RoutedEventArgs e)
        {
            var lastVisibility = Visibility;

            Visibility = Visibility.Visible;
            UpdateLayout();
            var width      = Math.Max(SearchPivot.ActualWidth / 2 - 24, 0);
            var headerTxts = VisualHelper.FindVisualChilds <TextBlock>(SearchPivot, "HeaderTxt");

            if (headerTxts != null)
            {
                headerTxts.ForEach(headerTxt => headerTxt.Width = width);
            }
            Visibility = lastVisibility;
        }