forked from aritchie/acrmvvmcross
-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.html
101 lines (75 loc) · 2.35 KB
/
readme.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<h1>ACR MvvmCross Plugins</h1>
<p>I loved Stuart Lodge's MvvmCross, so I built several services on it that I've used<br/>
on a few projects with great success.</p>
<ul>
<li>All plugins will be available through nuget</li>
<li>WinStore & WinPhone platform plugins are in the works</li>
</ul>
<h2>Bar Code Scanner</h2>
<p>This is based on Redth's ZXing.Net.Mobile.</p>
<pre><code>new MvxCommand(async () => {
var scan = Mvx.Resolve<IBarCodeScanner>();
var r = await scan.Read(flashlightText: "Turn on flashlight", cancelText: "Cancel");
Result = (r.Success
? String.Format("Barcode Result - Format: {0} - Code: {1}", r.Format, r.Code)
: "Cancelled barcode scan"
);
});
</code></pre>
<h2>Cache</h2>
<p>TODO</p>
<h2>Device Info</h2>
<p>Allows you to get the information of the device for auditing purposes</p>
<h2>External App</h2>
<p>This allows you to open documents in other applications. Useful if you have a document<br/>
repository style app</p>
<pre><code>if (ExternalAppService.Open("document.pdf")) {
// app selection is already open
}
else {
throw new Exception("BOOM");
}
</code></pre>
<h2>Network</h2>
<p>I needed something beyond what MvvmCross had out of the box. I had<br/>
a requirement for detecting network state changes so that we could inform<br/>
the user when they were working in an offline state.</p>
<pre><code>public MyViewModel(INetworkService networkService) {
MvxSubscriptionToken networkSubscriptionToken = networkService.Subscribe(e => OnNetworkChange(e.Status));
OnNetworkChange(networkService.CurrentStatus);
}
private void OnNetworkChange(MvxNetworkStatus e) {
if (!e.IsConnected) {
NetworkInfo = "Not Connected";
}
else if (e.IsMobile) {
NetworkInfo = "Mobile Connection";
}
else {
NetworkInfo = "WiFi Connection";
}
}
</code></pre>
<h2>Settings</h2>
<p>Just a simple setting access platform service</p>
<h2>Storage</h2>
<p>Allows for PCL use of </p>
<ul>
<li>DirectoryInfo</li>
<li>FileInfo</li>
<li>and File Streams</li>
</ul>
<h2>User Dialogs</h2>
<p>Allows for messagebox style dialogs</p>
<ul>
<li>Alert</li>
<li>Prompt</li>
<li>Confirm</li>
<li>Loading</li>
<li>Progress</li>
<li><p>Toast</p>
<ol>
<li>Droid progress & loading uses AndHUD</li>
<li>iOS progress & loading uses BTProgressHUD</li>
</ol></li>
</ul>