【发布时间】:2014-05-29 22:17:44
【问题描述】:
根据自定义需求,我有一个样式化的 HyperlinkButton,如下所示:
<HyperlinkButton Tag="Transactions/HomeWorkPage"
Background="#E9E9EB" Foreground="Black">
<HyperlinkButton.Effect>
<DropShadowEffect Direction="270" Opacity="0.35" ShadowDepth="3"/>
</HyperlinkButton.Effect>
<StackPanel Orientation="Horizontal">
<Image Source="/SchoolMgmt;component/Assets/Images/R_Homework.png"
Margin="10,0,1,0"/>
<telerik:Label Content="Home Work" CharacterSpacing="25"
telerik:StyleManager.Theme="{Binding SelectedTheme,Mode=TwoWay}"
FontSize="12" FontFamily="Arial Rounded MT" Margin="3"/>
</StackPanel>
</HyperlinkButton>
现在对结果感到满意,我开始为此编写样式资源,以便我可以在任何我想要的地方使用。
这是我能写的:
<Style x:Name="QuickLinkStyle" TargetType="HyperlinkButton">
<Setter Property="Background" Value="#E9E9EB"/>
<Setter Property="Foreground" Value="Black"/>
</Style>
我无法将关注转换为样式
<HyperlinkButton.Effect>
<DropShadowEffect Direction="270" Opacity="0.35" ShadowDepth="3"/>
</HyperlinkButton.Effect>
我不是设计师,也不使用表情混合来编写样式。我试着用谷歌搜索它。但我能找到的只是 DataTemplate 、 VisualStates 等。它非常令人困惑。
【问题讨论】:
标签: silverlight xaml user-interface styles