blob: 7e56618196c1fbac8d9a6c6b0661470103215d0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
<com:TContent ID="body" >
<h1>TMultiView</h1>
<com:DocLink ClassPath="System.Web.UI.WebControls.TMultiView" />
<p>
<tt>TMultiView</tt> serves as a container for a group of <tt>TView</tt> controls, which can be retrieved by the <tt>Views</tt> property. Each view contains child controls. <tt>TMultiView</tt> determines which view and its child controls are visible. At any time, at most one view is visible (called <i>active</i>). To make a view active, set <tt>ActiveView</tt> or <tt>ActiveViewIndex</tt>. Note, by default there is no active view.
</p>
<p>
To add a view to <tt>TMultiView</tt>, manipulate the <tt>Views</tt> collection or add it in template as follows,
</p>
<com:TTextHighlighter Language="prado" CssClass="source">
<com:TMultiView>
<com:TView>
view 1 content
</com:TView>
<com:TView>
view 2 content
</com:TView>
</com:TMultiView>
</com:TTextHighlighter>
<p>
<tt>TMultiView</tt> responds to the following command events to manage the visibility of its views.
</p>
<ul>
<li><tt>NextView</tt> : switch to the next view (with respect to the currently active view).
<li><tt>PreviousView</tt> : switch to the previous view (with respect to the currently active view).
<li><tt>SwitchViewID</tt> : switch to a view by its ID path. The ID path is fetched from the command parameter.
<li><tt>SwitchViewIndex</tt> : switch to a view by its zero-based index in the <tt>Views</tt> collection. The index is fetched from the command parameter.
</ul>
<p>
Upon postback, if the active view index is changed, <tt>TMultiView</tt> will raise an <tt>OnActiveViewChanged</tt> event.
</p>
<p>
The <a href="?page=Fundamentals.Samples.Hangman.Home">Hangman game</a> is a typical use of <tt>TMultiView</tt>. The following example demonstrates another usage of <tt>TMultiView</tt>.
</p>
<com:RunBar PagePath="Controls.Samples.TMultiView.Home" />
</com:TContent>
|