<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>http://wiki.mountbladecn.com/index.php?action=history&amp;feed=atom&amp;title=ScreenBase</id>
	<title>ScreenBase - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mountbladecn.com/index.php?action=history&amp;feed=atom&amp;title=ScreenBase"/>
	<link rel="alternate" type="text/html" href="http://wiki.mountbladecn.com/index.php?title=ScreenBase&amp;action=history"/>
	<updated>2026-05-17T17:39:49Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>http://wiki.mountbladecn.com/index.php?title=ScreenBase&amp;diff=3822&amp;oldid=prev</id>
		<title>Notealot：已保护“ScreenBase”（[编辑=仅允许管理员]（无限期）[移动=仅允许管理员]（无限期））</title>
		<link rel="alternate" type="text/html" href="http://wiki.mountbladecn.com/index.php?title=ScreenBase&amp;diff=3822&amp;oldid=prev"/>
		<updated>2020-04-24T15:02:30Z</updated>

		<summary type="html">&lt;p&gt;已保护“&lt;a href=&quot;/index.php?title=ScreenBase&quot; title=&quot;ScreenBase&quot;&gt;ScreenBase&lt;/a&gt;”（[编辑=仅允许管理员]（无限期）[移动=仅允许管理员]（无限期））&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2020年4月24日 (五) 15:02的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;zh&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Notealot</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.mountbladecn.com/index.php?title=ScreenBase&amp;diff=3821&amp;oldid=prev</id>
		<title>Notealot：创建页面，内容为“[https://docs.bannerlordmodding.com/_gauntlet/screenbase.html &lt;big&gt;访问源文档&lt;/big&gt;]&lt;br&gt; &lt;big&gt;返回目录&lt;/big&gt;&lt;br&gt; &lt;br&gt;…”</title>
		<link rel="alternate" type="text/html" href="http://wiki.mountbladecn.com/index.php?title=ScreenBase&amp;diff=3821&amp;oldid=prev"/>
		<updated>2020-04-24T15:02:17Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“[https://docs.bannerlordmodding.com/_gauntlet/screenbase.html &amp;lt;big&amp;gt;访问源文档&amp;lt;/big&amp;gt;]&amp;lt;br&amp;gt; &lt;a href=&quot;/index.php?title=%E9%AA%91%E9%A9%AC%E4%B8%8E%E7%A0%8D%E6%9D%802%EF%BC%9A%E9%9C%B8%E4%B8%BB_MOD_API&quot; title=&quot;骑马与砍杀2：霸主 MOD API&quot;&gt;&amp;lt;big&amp;gt;返回目录&amp;lt;/big&amp;gt;&lt;/a&gt;&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[https://docs.bannerlordmodding.com/_gauntlet/screenbase.html &amp;lt;big&amp;gt;访问源文档&amp;lt;/big&amp;gt;]&amp;lt;br&amp;gt;&lt;br /&gt;
[[骑马与砍杀2：霸主 MOD API|&amp;lt;big&amp;gt;返回目录&amp;lt;/big&amp;gt;]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;你可以通过'''Screen'''组织和实例化你的 [https://docs.bannerlordmodding.com/_gauntlet/viewmodel.html ViewModels] 和 [[Movie|Movies]]。&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;为了避免一些问题，请在创建'''Screen'''时使用以下模板：&amp;lt;/big&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
public class MyExampleScreen : ScreenBase&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
    private MyExampleVM _dataSource;&lt;br /&gt;
    private GauntletLayer _gauntletLayer;&lt;br /&gt;
    private GauntletMovie _movie;&lt;br /&gt;
&lt;br /&gt;
    protected override void OnInitialize()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnInitialize();&lt;br /&gt;
        _dataSource = new MyExampleVM();&lt;br /&gt;
        _gauntletLayer = new GauntletLayer(100)&lt;br /&gt;
        {&lt;br /&gt;
            IsFocusLayer = true&lt;br /&gt;
        };&lt;br /&gt;
        AddLayer(_gauntletLayer);&lt;br /&gt;
        _gauntletLayer.InputRestrictions.SetInputRestrictions();&lt;br /&gt;
        _movie = _gauntletLayer.LoadMovie(&amp;quot;MyExampleMovie&amp;quot;, _dataSource);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    protected override void OnActivate()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnActivate();&lt;br /&gt;
        ScreenManager.TrySetFocus(_gauntletLayer);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    protected override void OnDeactivate()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnDeactivate();&lt;br /&gt;
        _gauntletLayer.IsFocusLayer = false;&lt;br /&gt;
        ScreenManager.TryLoseFocus(_gauntletLayer);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    protected override void OnFinalize()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnFinalize();&lt;br /&gt;
        RemoveLayer(_gauntletLayer);&lt;br /&gt;
        _dataSource = null;&lt;br /&gt;
        _gauntletLayer = null;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
== 压入你的 Screen ==&lt;br /&gt;
&amp;lt;big&amp;gt;如果要将你的 Screen 压入 Screen 栈，你可以使用如下代码：&amp;lt;/big&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ScreenManager.PushScreen(ViewCreatorManager.CreateScreenView&amp;lt;MyExampleScreen&amp;gt;());&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Notealot</name></author>
		
	</entry>
</feed>