向表单“fieldset”添加效果。 Blend中的面板 [英] Adding effects to a form "fieldset" panel in Blend

查看:69
本文介绍了向表单“fieldset”添加效果。 Blend中的面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Blend中构建Silverlight数据输入屏幕。我们已经在作为视觉 字段集的表单数据输入控件组后面创建了面板。

I am building Silverlight data input screens in Blend. We have created panels behind groups of form data entry controls serving as visual fieldsets.

我在字段后面的面板(用户控件)中添加了阴影效果以显示焦点用户在该部分。我们使用GoToStateAction行为来激活它,该行为改变了可视状态以在MouseEnter上显示投影。

I have added a drop shadow effect to the panel (user control) behind the fields to show focus when a user is in that section. We activated this with a GoToStateAction Behavior that changes visual state to show the drop shadow on MouseEnter.

当您将鼠标悬停在面板上时,会出现投影。问题是,当您将鼠标悬停在表单字段上时,Silverlight会将其视为MouseLeave并即使您位于面板中间也会删除效果。将
GoToStateAction行为添加到表单中的每个元素(控件和文本)似乎有点过分。 [这种方法有效,但需要付出很多努力,我担心会降低处理器速度。]如果我在字段上方添加可点击区域,则无法访问字段。

When you mouse over the panel the drop shadow appears. The problem is that when you then mouse over a form field, Silverlight sees this as a MouseLeave and removes the effect even though you are in the middle of the panel. It seems overkill to have to add a GoToStateAction Behavior to every element in the form (controls and text). [This approach works, but it is a lot of effort and I fear will slow down the processor.] If I add a clickable area above the fields, you can't access the fields.

似乎必须有一种更简单的方法来实现这种效果。

It seems there must be an easier way to achieve this effect.

感谢您的输入。

推荐答案

不确定您使用的是哪种面板,但是如果您将内容放在网格中(例如作为容器),则当您在网格中的内容过多时,您将无法获得鼠标左键。 下面是一个做你想要的例子,即使
鼠标在文本框上方,它仍然处于显示阴影的状态。

Not sure what kind of panel you are using, but if you place your content inside a grid for example as the container, you won't get the mouseleave when you are over content inside the grid.  Below is an example that does what you want, even when the mouse is over the textbox it remains in the state where the dropshadow is shown.

 

<Grid x:Name="grid" Background="#FFFFBCBC" Height="192" Margin="45,47,302,0" VerticalAlignment="Top">
			<Grid.Effect>
				<DropShadowEffect Opacity="0"/>
			</Grid.Effect>
			<i:Interaction.Triggers>
				<i:EventTrigger EventName="MouseEnter">
					<ic:GoToStateAction StateName="_1"/>
				</i:EventTrigger>
				<i:EventTrigger EventName="MouseLeave">
					<ic:GoToStateAction StateName="Base"/>
				</i:EventTrigger>
			</i:Interaction.Triggers>
			<TextBox Margin="63,51,80,93" Text="TextBox" TextWrapping="Wrap"/>
		</Grid>


这篇关于向表单“fieldset”添加效果。 Blend中的面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆