Beispiel #1
0
        private void registerInputBoxes()
        {
            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(this); i++)
            {
                // Retrieve child visual at specified index value.
                Visual childVisual = (Visual)VisualTreeHelper.GetChild(this, i);

                InputBox ibx = new InputBox();

                if (Object.ReferenceEquals(childVisual.GetType(), ibx.GetType()))
                {
                    //childVisual.
                    InputBox ib = (InputBox)childVisual;
                    ib.GotFocus += new System.Windows.RoutedEventHandler(this.InputBoxFocus);
                    // Enumerate children of the child visual object.
                }
            }
        }