forked from reactiveui/ReactiveUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainActivity.cs
55 lines (47 loc) · 1.28 KB
/
MainActivity.cs
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
using System;
using System.Reactive.Linq;
using System.ComponentModel;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using ReactiveUI;
using Splat;
namespace MobileSample_Android
{
[Activity (Label = "AndroidPlayground", MainLauncher = true)]
public class MainView : ReactiveActivity<MainViewModel>
{
int count = 1;
public TextView SavedGuid { get; set; }
public MainView()
{
}
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
this.WireUpControls();
RxApp.SuspensionHost.ObserveAppState<AppBootstrapper>()
.Select(x => x.SavedGuid)
.Do(x => {
Console.WriteLine(x);
})
.BindTo(this, x => x.SavedGuid.Text);
}
protected override void OnDestroy()
{
base.OnDestroy();
Console.WriteLine("DEADED");
}
}
public class MainViewModel : ReactiveObject
{
public MainViewModel()
{
}
}
}