Sketchflow原型刷新 [英] Sketchflow Prototype Refresh

查看:64
本文介绍了Sketchflow原型刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在一个屏幕上有多个动画,并且在每个结尾处,我都有一个对话框供用户刷新页面以播放其他动画或移动到不同的屏幕,如何刷新页面而不必单击左侧的Silverlight菜单

 

谢谢

- m

推荐答案

您可以创建自己的行为(或在事件处理程序中使用相同的代码)来刷新当前屏幕 请注意,这不是公共API,在将来的版本中可能会在没有警告的情况下更改。要使用行为版本,请将行为附加到要触发刷新的对象,选择它,然后在属性面板中添加触发器,可能是eventtrigger。 将事件设置为单击,或者您想要触发操作的任何内容。

You can create your own behavior (or use the same code in an event handler) to refresh the current screen.  Please note that this is not a public API, and may change without warning in future versions. To use the behavior version, attach the behavior to the object you want to trigger the refresh, select it, and add a trigger in the properties panel, probably an eventtrigger.  Set the event to click, or whatever you want to have trigger the action.

您将在事件处理程序后面的代码中使用的代码来刷新当前屏幕:

The code you would use in a code behind event handler to refresh the current screen:


Microsoft.Expression.Prototyping.Services.PlayerContext.Instance.ActiveNavigationViewModel.RefreshCurrentScreen();


行为版本:


using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Interactivity;
using Microsoft.Expression.Interactivity.Core;

namespace SilverlightPrototype34Screens
{
	public class Behavior1 : Behavior<DependencyObject>
	{
		public Behavior1()
		{
			// Insert code required on object creation below this point.

			//
			// The line of code below sets up the relationship between the command and the function
			// to call. Uncomment the below line and add a reference to Microsoft.Expression.Interactions
			// if you choose to use the commented out version of MyFunction and MyCommand instead of
			// creating your own implementation.
			//
			// The documentation will provide you with an example of a simple command implementation
			// you can use instead of using ActionCommand and referencing the Interactions assembly.
			//
			this.MyCommand = new ActionCommand(this.MyFunction);
		}

		protected override void OnAttached()
		{
			base.OnAttached();

			// Insert code that you would want run when the Behavior is attached to an object.
		}

		protected override void OnDetaching()
		{
			base.OnDetaching();

			// Insert code that you would want run when the Behavior is removed from an object.
		}

		
		public ICommand MyCommand
		{
			get;
			private set;
		}
		 
		private void MyFunction()
		{
			Microsoft.Expression.Prototyping.Services.PlayerContext.Instance.ActiveNavigationViewModel.RefreshCurrentScreen();
		}
		
	}
}



这篇关于Sketchflow原型刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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