欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

高仿Windows Phone QQ登錄界面實(shí)例代碼

 更新時(shí)間:2013年12月10日 16:46:30   作者:  
這篇文章主要介紹了高仿Windows Phone QQ登錄界面實(shí)例代碼,有需要的朋友可以參考一下

給 TextBox文本框前添加圖片

擴(kuò)展PhoneTextBox:添加一個(gè)類“ExtentPhoneTextBox”繼承 PhoneTextBox ,在“ExtentPhoneTextBox”類中添加屬性項(xiàng):

復(fù)制代碼 代碼如下:

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));
    }
}


ExtentPhoneText 樣式編輯:

全部樣式如下:

復(fù)制代碼 代碼如下:

<DataTemplate x:Key="ControlHeaderTemplate">
            <TextBlock FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" LineStackingStrategy="BlockLineHeight" LineHeight="23.333" Margin="0,-9,0,0" TextWrapping="Wrap" Text="{Binding}">
                <TextBlock.RenderTransform>
                    <TranslateTransform X="-1" Y="4"/>
                </TextBlock.RenderTransform>
            </TextBlock>
        </DataTemplate>
        <toolkit:SingleDataTemplateSelector x:Key="ControlHeaderTemplateSelector" Template="{StaticResource ControlHeaderTemplate}"/>
        <Style x:Key="ExtentPhoneTextBoxStyle" TargetType="ExtentCtrs:ExtentPhoneTextBox">
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
            <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
            <Setter Property="BorderBrush" Value="{StaticResource PhoneTextBoxBrush}"/>
            <Setter Property="SelectionBackground" Value="{StaticResource PhoneAccentBrush}"/>
            <Setter Property="SelectionForeground" Value="{StaticResource PhoneTextBoxSelectionForegroundBrush}"/>
            <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
            <Setter Property="Padding" Value="6,0,6,4"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ExtentCtrs:ExtentPhoneTextBox">
                        <Grid x:Name="RootGrid" Background="Transparent">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="Header">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextLowContrastBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="MainBorder">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="MainBorder">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="ReadOnly">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MainBorder">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ReadonlyBorder">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ReadonlyBorder">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ReadonlyBorder">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxReadOnlyBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="MainBorder">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxEditBackgroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="MainBorder">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxEditBorderBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="LengthIndicatorStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition From="LengthIndicatorHidden" To="LengthIndicatorVisible">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LengthIndicator">
                                                    <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="RootGrid">
                                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="0, 0, 0, 25"/>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="LengthIndicator">
                                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                                </ObjectAnimationUsingKeyFrames>
                                                <DoubleAnimation Duration="0:0:0.350" To="27" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="LengthIndicator">
                                                    <DoubleAnimation.EasingFunction>
                                                        <ExponentialEase Exponent="6"/>
                                                    </DoubleAnimation.EasingFunction>
                                                </DoubleAnimation>
                                            </Storyboard>
                                        </VisualTransition>
                                        <VisualTransition From="LengthIndicatorVisible" To="LengthIndicatorHidden">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0:0:0.350" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="LengthIndicator">
                                                    <DoubleAnimation.EasingFunction>
                                                        <ExponentialEase Exponent="6"/>
                                                    </DoubleAnimation.EasingFunction>
                                                </DoubleAnimation>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="RootGrid">
                                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="0, 0, 0, 0"/>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="LengthIndicator">
                                                    <DiscreteObjectKeyFrame KeyTime="0:0:0.350" Value="0"/>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LengthIndicator">
                                                    <DiscreteObjectKeyFrame KeyTime="0:0:0.350">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Collapsed</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualTransition>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="LengthIndicatorVisible">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LengthIndicator">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="RootGrid">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="0, 0, 0, 25"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="LengthIndicator">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation Duration="0" To="27" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="LengthIndicator"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="LengthIndicatorHidden"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <toolkit:PhoneContentControl x:Name="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{StaticResource ControlHeaderTemplateSelector}" Content="{TemplateBinding Header}" Foreground="{StaticResource PhoneTextMidContrastBrush}" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{StaticResource PhoneHorizontalMargin}"/>
                            <Border x:Name="LengthIndicatorBorder" Grid.Row="1">
                                <TextBlock x:Name="LengthIndicator" CacheMode="BitmapCache" Foreground="{StaticResource PhoneTextMidContrastBrush}" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" HorizontalAlignment="Right" Margin="{StaticResource PhoneMargin}" Opacity="0" TextAlignment="Right" Visibility="Collapsed" VerticalAlignment="Bottom">
                                    <TextBlock.RenderTransform>
                                        <TranslateTransform/>
                                    </TextBlock.RenderTransform>
                                </TextBlock>
                            </Border>
                            <Border x:Name="MainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Margin="{StaticResource PhoneTouchTargetOverhang}" Grid.Row="1">
                                <TextBlock x:Name="PlaceholderTextElement" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}" HorizontalAlignment="Left" Padding="{TemplateBinding Padding}" Text="{TemplateBinding PlaceholderText}" VerticalAlignment="Center" Margin="40,2,0,2"/>
                            </Border>
                            <Border x:Name="ReadonlyBorder" BorderBrush="{StaticResource PhoneDisabledBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="Transparent" Margin="{StaticResource PhoneTouchTargetOverhang}" Grid.Row="1" Visibility="Collapsed"/>
                            <Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" Background="Transparent" Margin="{StaticResource PhoneTouchTargetOverhang}" Grid.Row="1">
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{TemplateBinding TextHeadImage}" Width="{TemplateBinding TextHeadImageWidth}" Height="{TemplateBinding TextHeadImageWidth}" HorizontalAlignment="Left" Margin="12,2,1,2"/>
                                    <ContentControl x:Name="ContentElement" BorderThickness="0" CacheMode="BitmapCache" HorizontalContentAlignment="Stretch" Padding="{TemplateBinding Padding}" VerticalContentAlignment="Stretch" VerticalAlignment="Center"/>
                                </StackPanel>
                            </Border>
                            <toolkitPrimitives:TiltUserControl HorizontalAlignment="Right" Margin="0,0,-12,0" Grid.Row="1" VerticalAlignment="Bottom">
                                <Border x:Name="ActionIconBorder" Background="Transparent" Height="72" Width="96">
                                    <Image x:Name="ActionIcon" HorizontalAlignment="Right" Height="26" Margin="0,0,36,0" Source="{TemplateBinding ActionIcon}"/>
                                </Border>
                            </toolkitPrimitives:TiltUserControl>
                            <TextBlock x:Name="MeasurementTextBlock" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" IsHitTestVisible="False" Margin="8" Opacity="0" Grid.Row="1" TextAlignment="{TemplateBinding TextAlignment}" TextWrapping="{TemplateBinding TextWrapping}" Text="{TemplateBinding Text}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

UI部局xaml代碼如下:

<Grid x:Name="ContentPanel"
            Margin="0,162,24,19"
            Grid.RowSpan="2">

            <ExtentCtrs:ExtentPhoneTextBox  Margin="12,10,12,0"
                TextWrapping="Wrap"
                VerticalAlignment="Top"
                PlaceholderText="QQ號碼/手機(jī)/郵箱"
                Height="80"
                Background="White" TextHeadImage="/Assets/QqAccount.WVGA.png" Style="{StaticResource ExtentPhoneTextBoxStyle}" TextHeadImageHeight="22" TextHeadImageWidth="24" />
            <ExtentCtrs:ExtentPhoneTextBox  Margin="12,107,12,0"
                TextWrapping="Wrap"
                VerticalAlignment="Top"
                PlaceholderText="點(diǎn)擊輸入QQ密碼"
                Height="80"
                Background="White" Style="{StaticResource ExtentPhoneTextBoxStyle}" TextHeadImage="/Assets/Password.WVGA.png" TextHeadImageHeight="22" TextHeadImageWidth="24" />

            <toolkitPrimitives:PhonePasswordBoxCheckBox Content="記住密碼"
                HorizontalAlignment="Left"
                Margin="12,195,0,0"
                VerticalAlignment="Top"
                HorizontalContentAlignment="Left" />
            <toolkitPrimitives:PhonePasswordBoxCheckBox Content="隱身登錄"
                HorizontalAlignment="Left"
                Margin="224,195,0,0"
                VerticalAlignment="Top" />
            <toolkitPrimitives:PhonePasswordBoxCheckBox Content="靜音登錄"
                HorizontalAlignment="Left"
                Margin="12,272,0,0"
                VerticalAlignment="Top" />
            <HyperlinkButton Content="注冊帳號"
                HorizontalAlignment="Left"
                Margin="12,349,0,0"
                VerticalAlignment="Top"
                HorizontalContentAlignment="Left" />
            <HyperlinkButton Content="找回密碼"
                HorizontalAlignment="Left"
                Margin="12,385,0,0"
                VerticalAlignment="Top"
                HorizontalContentAlignment="Left" />

        </Grid>
運(yùn)行效果如下:

相關(guān)文章

  • asp.net C# 時(shí)間間隔的計(jì)算方法

    asp.net C# 時(shí)間間隔的計(jì)算方法

    C#時(shí)間間隔計(jì)算可以通過時(shí)間刻度類TimSpan類實(shí)現(xiàn),這是一個(gè)系統(tǒng)類。
    2010-03-03
  • URL中去除指定參數(shù)實(shí)現(xiàn)C#代碼

    URL中去除指定參數(shù)實(shí)現(xiàn)C#代碼

    URL中去除指定參數(shù)在項(xiàng)目開發(fā)中還是很常見的,本文將介紹下它在c#代碼中的實(shí)現(xiàn),感興趣的朋友可以參考下哈
    2013-04-04
  • ASP.NET 謹(jǐn)用 async/await

    ASP.NET 謹(jǐn)用 async/await

    這篇文章主要介紹了ASP.NET 應(yīng)用程序?qū)嶋H使用過程中的一些總結(jié), 包括 異常捕獲 、 死鎖 、 應(yīng)用程序崩潰 ,實(shí)際使用過程中一不注意就可能掉坑里了
    2018-01-01
  • .NET Core中如何實(shí)現(xiàn)或使用對象池?

    .NET Core中如何實(shí)現(xiàn)或使用對象池?

    什么是對象池?簡單來說它就是一種為對象提供可復(fù)用性能力的軟件設(shè)計(jì)思路,對象池就是通過“借”和“還”這樣兩個(gè)動作來保證對象可以被重復(fù)使用,這篇文章主要給大家介紹了關(guān)于.NET Core中如何實(shí)現(xiàn)或使用對象池的相關(guān)資料,需要的朋友可以參考下
    2021-07-07
  • 使用最小?WEB?API?實(shí)現(xiàn)文件上傳會遇到的坑

    使用最小?WEB?API?實(shí)現(xiàn)文件上傳會遇到的坑

    這篇文章主要介紹分享使用最小?WEB?API?實(shí)現(xiàn)文件上傳時(shí)會遇到的坑,在使用?.NET?6?的最小?WEB?API?來實(shí)現(xiàn)相同功能時(shí),總是會意外地遇到了不少坑,下面我們就來看看這些坑都是怎么處理的吧,需要的朋友可以參考下
    2022-02-02
  • ASP.NET Core中的Razor頁面實(shí)現(xiàn)路由功能

    ASP.NET Core中的Razor頁面實(shí)現(xiàn)路由功能

    本文詳細(xì)講解了ASP.NET Core中的Razor頁面實(shí)現(xiàn)路由功能的方法,文中通過示例代碼介紹的非常詳細(xì)。對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-02-02
  • asp.net AJAX實(shí)現(xiàn)無刷新獲得數(shù)據(jù)

    asp.net AJAX實(shí)現(xiàn)無刷新獲得數(shù)據(jù)

    提供一個(gè)使用AJAX實(shí)現(xiàn)無刷新判斷注冊用戶名是否被注冊的代碼:
    2008-11-11
  • jenkins部署.net平臺自動化構(gòu)建的方法步驟

    jenkins部署.net平臺自動化構(gòu)建的方法步驟

    這篇文章主要介紹了jenkins部署.net平臺自動化構(gòu)建的方法步驟,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-07-07
  • 在.net中用CheckBoxList實(shí)現(xiàn)單選

    在.net中用CheckBoxList實(shí)現(xiàn)單選

    用CheckBoxList實(shí)現(xiàn)單選的原因是我覺得CheckBoxList控件頁面展示效果要好看一些,需要的朋友可以參考下
    2014-02-02
  • ASP.NET Core啟動地址配置方法及優(yōu)先級順序

    ASP.NET Core啟動地址配置方法及優(yōu)先級順序

    這篇文章主要介紹了ASP.NET Core啟動地址配置方法及優(yōu)先級順序,如果在同一臺機(jī)器上運(yùn)行多個(gè)ASP.NET Core實(shí)例,使用默認(rèn)值肯定不合適,下面我們一起進(jìn)入文章了解具體內(nèi)容吧
    2022-03-03

最新評論