<button VerticalAlignment="top" HorizontalAlignment="left" borderBrush="transparent" Click="FirstCubeSelected" x:name="cube1button" padding="0" margin="1,-1,0"> <Image x:name="buttonImage" Source="/images/cub2onbtn.png" WIDth="176" Height="176" /> </button>
我通常在表达式混合中执行此 *** 作,但我现在无法访问它
解决方法 您需要从按钮中删除按下的视觉样式:<Style x:Key="buttonStyle1" targettype="button"> <Setter Property="Background" Value="transparent"/> <Setter Property="borderBrush" Value="{StaticResource PhoneForegroundBrush}"/> <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/> <Setter Property="borderThickness" Value="{StaticResource PhoneborderThickness}"/> <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/> <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/> <Setter Property="padding" Value="10,3,10,5"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate targettype="button"> <GrID Background="transparent"> <visualstatemanager.VisualStateGroups> <VisualStateGroup x:name="CommonStates"> <VisualState x:name="normal"/> <VisualState x:name="MouSEOver"/> <VisualState x:name="pressed"/> <VisualState x:name="Disabled"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.Targetname="ContentContainer"> <discreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="borderBrush" Storyboard.Targetname="buttonBackground"> <discreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.Targetname="buttonBackground"> <discreteObjectKeyFrame KeyTime="0" Value="transparent"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </visualstatemanager.VisualStateGroups> <border x:name="buttonBackground" borderBrush="{TemplateBinding borderBrush}" borderThickness="{TemplateBinding borderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" margin="{StaticResource PhonetouchTargetoverhang}"> <ContentControl x:name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" padding="{TemplateBinding padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> </border> </GrID> </ControlTemplate> </Setter.Value> </Setter> </Style>总结
以上是内存溢出为你收集整理的在silverlight中按下按钮突出显示全部内容,希望文章能够帮你解决在silverlight中按下按钮突出显示所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)