// Constructor public WelcomePage() { InitializeComponent(); viewModel = this.DataContext as WelcomeViewModel; viewModel.PropertyChanged += HandlePropertyChanged; this.Loaded += WelcomePage_Loaded; }
public override void ViewDidLoad() { base.ViewDidLoad(); NavigationController.NavigationBar.BarTintColor = EvolveQuest.Shared.Helpers.Color.Blue.ToUIColor(); NavigationController.NavigationBar.BarStyle = UIBarStyle.Black; NavigationController.NavigationBarHidden = true; //Custom setup for button stylce ButtonLoadGame.Layer.CornerRadius = ButtonAbout.Layer.CornerRadius = 5; viewModel = new WelcomeViewModel(); viewModel.PropertyChanged += HandlePropertyChanged; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); App.CurrentActivity = this; SetContentView(Resource.Layout.welcome); // Create your application here viewModel = new WelcomeViewModel(); viewModel.PropertyChanged += HandlePropertyChanged; progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar); buttonPlay = FindViewById<Button>(Resource.Id.button_play); buttonAbout = FindViewById<ImageButton>(Resource.Id.button_about); background = FindViewById<ImageView>(Resource.Id.background); map = FindViewById<QuestMapView>(Resource.Id.map); scrollView = FindViewById<LockableScrollView>(Resource.Id.map_scroll); //scrollView.IsScrollable = true; scrollView.SmoothScrollingEnabled = true; map.SetPins(new [] { MapPinPosition.Center, MapPinPosition.Right, MapPinPosition.Left, MapPinPosition.Center, MapPinPosition.Left, MapPinPosition.Center, MapPinPosition.Right, MapPinPosition.Left, MapPinPosition.Right, MapPinPosition.Center, MapPinPosition.Left, MapPinPosition.Center }); buttonPlay.Click += (sender, args) => { if (viewModel.GameLoaded && viewModel.Game != null && viewModel.Game.Started) { GoToGame(); return; } viewModel.LoadGameCommand.Execute(null); }; buttonAbout.Click += (sender, args) => { StartActivity(new Intent(this, typeof(AboutActivity))); OverridePendingTransition(Resource.Animation.slide_in_left, Resource.Animation.slide_out_left); }; }
public override void ViewDidLoad() { base.ViewDidLoad(); viewModel = new WelcomeViewModel(); var refresh = new UIBarButtonItem(UIBarButtonSystemItem.Refresh, (sender, args) => { LoadData(); }); NavigationItem.RightBarButtonItem = refresh; TableView.Source = dataSource = new DataSource(this); LoadData(); var location = new CoreLocation.CLLocationManager (); location.RequestWhenInUseAuthorization (); }