当前位置:编程学习 > wap >>

怎么在generic.xaml文件夹中写控件的样式设置啊

我就是想要设置一下控件的样式,想要把下面这段代码放在generic文件中,但是我找不到这个文件啊  不知道要怎么创建这个文件
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Phone.Controls;assembly=Phone.Controls">

    <Style TargetType="local:ScrollableTextBlock" >
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Width" Value="200" />
        <Setter Property="Height" Value="70" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ScrollableTextBlock">
                    <ScrollViewer x:Name="ScrollViewer" Foreground="{TemplateBinding Foreground}" 
                                  Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" 
                                  BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                        <StackPanel Orientation="Vertical" x:Name="StackPanel" />
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>

--------------------编程问答--------------------

Themes\ --------------------编程问答--------------------
引用 1 楼 NianHui 的回复:


Themes\



其实我就是想问下 这个Microsoft.Phone.Controls.Toolkit项目是什么类型的?是windows Phone应用程序吗?还是说是一个类库,我不知道要建一个什么项目 主要是,还有,这个theme文件夹以及里面的generic.xaml是自动生成的还是自己创建的,,我表示还是找不到这个文件啊。 --------------------编程问答-------------------- Microsoft.Phone.Controls.Toolkit是wp类库

找不到自己创建 --------------------编程问答--------------------
引用 3 楼 NianHui 的回复:
Microsoft.Phone.Controls.Toolkit是wp类库

找不到自己创建

可是在wp类库中不能创建的generic.xaml文件啊   找不到资源字典啊 (话说generic.xaml是资源字典没错吧?) --------------------编程问答--------------------
引用 4 楼 u010612390 的回复:
Quote: 引用 3 楼 NianHui 的回复:

Microsoft.Phone.Controls.Toolkit是wp类库

找不到自己创建

可是在wp类库中不能创建的generic.xaml文件啊   找不到资源字典啊 (话说generic.xaml是资源字典没错吧?)

从别处复制过去一个或者建一个xml文件改下名字和扩展名。
补充:移动开发 ,  Windows Phone
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,