改变Sketchflow播放器的默认值 [英] Altering Sketchflow Player's Defaults

查看:50
本文介绍了改变Sketchflow播放器的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果问到这个问题,试着在论坛上查找。 我想知道在运行项目时是否有办法改变Sketchflow播放器的默认设置。 例如,我可以设置它以便显示地图,导航崩溃,
和缩放滚动条设置为特定设置。 

Tried looking on the forums if this question was asked.  I was wondering if there is a way to alter Sketchflow player default settings when you run your project.  For example can i set it so that the map is displayed, the navigation is collapse, and the zoom scroll bar is set to specific setting. 

谢谢,

Dennis

推荐答案

你可以去项目 - > Sketchflow项目设置菜单,用于隐藏导航面板。 对于其他人,没有支持的方法来做到这一点。但是,下面是一个完全不受支持和未记录的方法来完成此任务。请注意,此
不是受支持的API,在将来的版本中可能会更改。

You can go to the Project -> Sketchflow Project Settings menu to hide the navigation panel.  For the others, there is no supported way to do this. However, below is a completely unsupported and undocumented way to accomplish this. Please note this is not a supported API, and may change in future releases.

 

您可以修改状态加载播放器窗口后,app.xaml.cs文件中的SketchFlow播放器可以快速设置上面提到的设置。在窗口加载了
之后的事件中设置此项非常重要,否则您可能会获得空引用异常。 此外,此代码没有空检查,可能应该。

You can modify the state of the SketchFlow player in the app.xaml.cs file after the player window has loaded, presented below is a quick take at setting the settings you mentioned above. It is important that you set this in an event AFTER the window has loaded, otherwise you may get null reference exceptions.  Also, this code has no null checks and probably should.

public partial class App : Application
	{
		public App()
		{
			this.Startup += this.Application_Startup;
			this.Exit += this.Application_Exit;
			this.UnhandledException += this.Application_UnhandledException;

			InitializeComponent();
		}

		private void Application_Startup(object sender, StartupEventArgs e)
		{
			var rv = new Microsoft.Expression.Prototyping.Workspace.PlayerWindow();
			rv.Loaded += new RoutedEventHandler(rv_Loaded);
			this.RootVisual = rv;
		}

		void rv_Loaded(object sender, RoutedEventArgs e)
		{
			PlayerContext.Instance.WorkspaceViewModel.Zoom = 150.0;
			PlayerContext.Instance.WorkspaceViewModel.IsMapOpen = true;
			PlayerContext.Instance.WorkspaceViewModel.CollapsedControls = true;
		}


这篇关于改变Sketchflow播放器的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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