public QuestPage() { InitializeComponent(); ViewModel = this.DataContext as QuestViewModel; ViewModel.PropertyChanged += HandlePropertyChanged; this.Loaded += PhasePage_Loaded; scanner = new ZXing.Mobile.MobileBarcodeScanner(Deployment.Current.Dispatcher); options.PossibleFormats = new List<ZXing.BarcodeFormat>() { ZXing.BarcodeFormat.QR_CODE }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetHomeButtonEnabled(true); App.CurrentActivity = this; ViewModel = new QuestViewModel(); SetContentView(Resource.Layout.quest); ViewModel.PropertyChanged += HandlePropertyChanged; imageLoader = new ImageLoader(this, 256, 5); beacon1 = FindViewById<ImageView>(Resource.Id.beacon1); beacon2 = FindViewById<ImageView>(Resource.Id.beacon2); beacon3 = FindViewById<ImageView>(Resource.Id.beacon3); beacons = new List<ImageView> { beacon1, beacon2, beacon3 }; mainImage = FindViewById<ImageView>(Resource.Id.main_image); mainText = FindViewById<TextView>(Resource.Id.main_text); beaconNearby = FindViewById<TextView>(Resource.Id.text_beacons); progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar); buttonContinue = FindViewById<Button>(Resource.Id.button_continue); buttonContinue.Click += ButtonContinueClick; buttonContinue.Visibility = ViewStates.Gone; beaconManager = new BeaconManager(this); scanner = new ZXing.Mobile.MobileBarcodeScanner(); beaconManager.Ranging += BeaconManagerRanging; beaconManager.EnteredRegion += (sender, args) => SetBeaconText(true); beaconManager.ExitedRegion += (sender, args) => SetBeaconText(false); beacon1.Visibility = beacon2.Visibility = beacon3.Visibility = ViewStates.Invisible; options.PossibleFormats = new List<ZXing.BarcodeFormat>() { ZXing.BarcodeFormat.QR_CODE }; ViewModel.LoadQuestCommand.Execute(null); }