Windows Phone QQ 로그 인 인터페이스 인 스 턴 스 코드 모방

TextBox 텍스트 상자 앞 에 그림 추가 하기
Phone TextBox 확장:Phone TextBox 계승"ExtentPhone TextBox"클래스 에 속성 항목 을 추가 합 니 다

public class ExtentPhoneTextBox : PhoneTextBox
    {
        /// <summary>
        ///
        /// </summary>
        public static readonly DependencyProperty TextHeadImageProperty =
            DependencyProperty.Register("TextHeadImage", typeof(ImageSource), typeof(ExtentPhoneTextBox), new PropertyMetadata(null)
            );

        /// <summary>
        ///
        /// </summary>
        public ImageSource TextHeadImage
        {
            get { return base.GetValue(TextHeadImageProperty) as ImageSource; }
            set { base.SetValue(TextHeadImageProperty, value); }
        }

        /// <summary>
        ///
        /// </summary>
        public double TextHeadImageWidth
        {
            get { return (double)GetValue(TextHeadImageWidthProperty); }
            set { SetValue(TextHeadImageWidthProperty, value); }
        }

        // Using a DependencyProperty as the backing store for TextHeadImageWidth.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TextHeadImageWidthProperty =
            DependencyProperty.Register("TextHeadImageWidth", typeof(double), typeof(ExtentPhoneTextBox), new PropertyMetadata(null));

        /// <summary>
        ///
        /// </summary>
        public double TextHeadImageHeight
        {
            get { return (double)GetValue(TextHeadImageHeightProperty); }
            set { SetValue(TextHeadImageHeightProperty, value); }
        }

        // Using a DependencyProperty as the backing store for TextHeadImageHeight.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TextHeadImageHeightProperty =
            DependencyProperty.Register("TextHeadImageHeight", typeof(double), typeof(ExtentPhoneTextBox), new PropertyMetadata(null));
    }
}

ExtentPhone TextBox 스타일 편집:


모든 스타일 은 다음 과 같 습 니 다.
UI 부 국 xaml 코드 는 다음 과 같 습 니 다.

                       
                                                                   
실행 효 과 는 다음 과 같 습 니 다.

좋은 웹페이지 즐겨찾기