Example #1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            try
            {
                Dropdown.ApplyTemplate();
                TextBox tb = Dropdown.Template.FindName("PART_EditableTextBox", Dropdown) as TextBox;
                if (tb != null)
                {
                    tb.Foreground   = Dropdown.Foreground;
                    tb.Background   = Dropdown.Background;
                    tb.TextChanged += Tb_TextChanged;
                }
            }
            catch {}
        }
Example #2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            try
            {
                Dropdown.ApplyTemplate();
                TextBox tb = Dropdown.Template.FindName("PART_EditableTextBox", Dropdown) as TextBox;
                if (tb != null)
                {
                    tb.CaretBrush = (SolidColorBrush)Application.Current.Resources["Primary"];
                    tb.Foreground = Dropdown.Foreground;
                    tb.Background = Dropdown.Background;
                    tb.TextChanged += Tb_TextChanged;
                }
            }
            catch {}
        }