-
-
Notifications
You must be signed in to change notification settings - Fork 153
/
Copy pathMainView.ux
60 lines (51 loc) · 1.87 KB
/
MainView.ux
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
<App>
<ClientPanel>
<!-- Provides a `FileImage` property that takes the name of a file -->
<DockPanel ux:Class="MyButtonFile" Padding="10">
<FileSource ux:Property="FileImage" />
<string ux:Property="Text" />
<Image File="{ReadProperty FileImage}" Dock="Left" Color="#033" />
<Text Alignment="Center" Value="{ReadProperty Text}" />
<Rectangle Layer="Background" Color="#dff" />
</DockPanel>
<!-- Provides an `Image` property that is bound to an ImageSource -->
<DockPanel ux:Class="MyButtonSource" Padding="10">
<ImageSource ux:Property="Image" />
<string ux:Property="Text" />
<Image Source="{ReadProperty Image}" Dock="Left" Color="#033" />
<Text Alignment="Center" Value="{ReadProperty Text}" />
<Rectangle Layer="Background" Color="#dff" />
</DockPanel>
<!-- The extra wrapping panels are just to add clarity in the example -->
<StackPanel Alignment="Center" ItemSpacing="10">
<Panel>
<MyButtonFile FileImage="cancel.png" Text="Cancel" />
</Panel>
<Panel>
<FileImageSource ux:Name="iconCancel" File="cancel.png" ux:AutoBind="false" />
<MyButtonSource Image="iconCancel" Text="Cancel" />
</Panel>
<Panel>
<FileImageSource ux:Key="IconCancel" File="cancel.png" />
<MyButtonSource Image="{Resource IconCancel}" Text="Cancel" />
</Panel>
<Panel>
<FileImageSource ux:Key="IconCancel" File="cancel.png" />
<JavaScript>
var Observable = require("FuseJS/Observable");
var useIcon = Observable("IconCancel");
var useText = "Cancel";
module.exports = {
useIcon: useIcon,
useText: useText
};
</JavaScript>
<MyButtonSource Image="{DataToResource useIcon}" Text="{useText}" />
</Panel>
<Panel>
<FileImageSource ux:Global="GlobalCancel" File="cancel.png" />
<MyButtonSource Image="GlobalCancel" Text="Cancel" />
</Panel>
</StackPanel>
</ClientPanel>
</App>