forked from fuse-open/fuse-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainView.ux
More file actions
77 lines (66 loc) · 2.17 KB
/
MainView.ux
File metadata and controls
77 lines (66 loc) · 2.17 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<App>
<Router ux:Name="router" />
<Text ux:Class="Label" FontSize="24"/>
<Panel ux:Class="TitleBar" Color="#AAA" Padding="4"/>
<Rectangle ux:Class="ListIcon" BoxSizing="FillAspect" Aspect="1" Color="Blue"
CornerRadius="2" Margin="3"/>
<JavaScript>
var state = require("App/state.js")
exports.loading = state.loading
exports.login = state.login
exports.goBack = function() {
router.goBack()
}
exports.goChannels = function() {
router.goto( "home", {}, "channels", {}, "list", {} )
TheEdge.dismiss()
}
exports.goContacts = function() {
router.goto( "home", {}, "contacts", {}, "list", {} )
TheEdge.dismiss()
}
exports.goSettings = function() {
router.goto( "home", {}, "settings", {} )
TheEdge.dismiss()
}
exports.openMenu = function() {
console.log( "Goto Menu" )
TheEdge.open( "Left" )
}
//never true in this demo, but shows how to navigate to login if the user hasn't done so yet.
if (exports.login.value == false) {
router.goto( "login", {} )
}
</JavaScript>
<ClientPanel>
<WhileTrue Value="{loading}">
<Panel Layer="Overlay" HitTestMode="LocalBounds" ux:Name="BlockPanel">
<Circle Width="100" Height="100" Alignment="Center"
LengthAngleDegrees="90" StartAngleDegrees="0">
<Stroke Width="10" Color="0.5,0.55,0.65,1"/>
<WhileVisible>
<Spin Frequency="0.5"/>
</WhileVisible>
</Circle>
</Panel>
</WhileTrue>
<EdgeNavigator ux:Name="TheEdge">
<WhileTrue Value="{login}">
<StackPanel Edge="Left" Color="#BAC" ItemSpacing="10" Padding="20">
<Image File="Assets/zen.png" StretchSizing="Zero"/>
<Button Text="Channels" Clicked="{goChannels}"/>
<Button Text="Contacts" Clicked="{goContacts}"/>
<Button Text="Settings" Clicked="{goSettings}"/>
</StackPanel>
</WhileTrue>
<Panel ux:Name="MainNavPanel">
<DeactivatingAnimation>
<Change MainNavPanel.Opacity="0.5"/>
<Scale Factor="0.8"/>
<Move X="0.1" RelativeTo="ParentSize"/>
</DeactivatingAnimation>
<ux:Include File="MainNavigator.ux"/>
</Panel>
</EdgeNavigator>
</ClientPanel>
</App>