新人请教一个关于Frame跳转产生的控件消失问题
wpf吧
全部回复
仅看楼主
level 1
我在一个自定义的主窗体中使用了Frame容器,并且在导航事件添加了动画,但在加载别的Page时,窗体上的其它控件都会消失,在Page加载完成后又会恢复原样。我测试后貌似是因为我的Page里的Load事件做的事情太多了,会一瞬间(大约1s)卡住,但这会影响到窗体的其它控件吗?如果真是这样的话我想请教下还有什么好的解决方案?
截图:
1)正常情况。
2)切换时触发动画,一切正常。
3)出现问题,切换被卡住的一瞬间就会所有控件一起不见,加载完成后会还原。
2014年12月09日 11点12分 1
level 7
可以用异步多线程或者先加载控件后加载数据
2014年12月13日 00点12分 2
level 2
这么高大上的作品
2014年12月22日 16点12分 3
level 10
界面风格不错!赞一个
2015年01月28日 04点01分 4
level 1
问题解决,结贴。
2015年01月28日 12点01分 5
level 1
使用Blend的数据绑定状态,设置不同页面的状态切换动画 ,当数据发送改变时,页面自动动画效果切换到某个其他状态
2015年02月05日 09点02分 6
数据加载的时候播放等待动画,数据加载完毕,视图初始化完成,切换到显示动画
2015年02月05日 09点02分
一个是等待状态、一个是操作状态 ,用VM控制两个状态的切换。动画就流畅了
2015年02月05日 09点02分
level 1
2015年02月05日 09点02分 7
level 1
<i:Interaction.Behaviors>
<ei:DataStateBehavior Binding="{Binding MainPageBoxVisibility}"
Value="True"
TrueState="MainPageShow" FalseState="MainPageHide"/>
</i:Interaction.Behaviors>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="MainPageHide"/>
<VisualState x:Name="MainPageShow">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainPageBox" Storyboard.TargetProperty="(Control.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0:0:0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="MainPageBox" Storyboard.TargetProperty="(Control.Opacity)">
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.2">
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
2015年02月05日 09点02分 8
1