예제 #1
0
        void Test4(object obj)
        {
            var buttons = WPFControlsUtils.FindChilrenOfType <System.Windows.Controls.Button>(obj as Grid);

            if (buttons.Count == 4)
            {
                WPFControls.MessageBox.ShowInformation("成功");
            }
        }
예제 #2
0
        private static void Grid_Loaded(object sender, RoutedEventArgs e)
        {
            var query = WPFControlsUtils.FindChilrenOfType <System.Windows.Controls.DataGrid>(sender as UserControl);

            if (query == null || query.Count == 0)
            {
                return;
            }

            foreach (System.Windows.Controls.DataGrid dataGrid in query)
            {
                if (dataGrid == null)
                {
                    return;
                }

                //dataGrid.Columns.CollectionChanged += (s0, e0) =>
                //{
                UpdateColumnStyles(dataGrid);
                //};
            }
        }