public override void ViewDidLoad() { base.ViewDidLoad(); View.BackgroundColor = UIColor.White; _viewModel = Resolver.Resolve <IGameDetailViewModel>(); var yo = 80; var w = View.Bounds.Width - (IosConstants.Margin * 2); _boxShotImageView = new UIImageView(new CGRect(IosConstants.Margin, yo, 128, 128)); var xo = IosConstants.Margin + 128 + IosConstants.Margin; _publisherLabel = new UILabel(new CGRect(xo, yo, 140, 24)); _yearLabel = new UILabel(new CGRect(xo, _publisherLabel.Frame.Y + _publisherLabel.Frame.Height + 8, 140, 24)); _platformLabel = new UILabel(new CGRect(xo, _yearLabel.Frame.Y + _yearLabel.Frame.Height + 8, 140, 24)); yo += 128 + IosConstants.Margin; _descriptionLabel = new UILabel(new CGRect(IosConstants.Margin, yo, w, 200)); _descriptionLabel.LineBreakMode = UILineBreakMode.WordWrap; _descriptionLabel.Lines = 0; View.AddSubviews(_boxShotImageView, _publisherLabel, _yearLabel, _platformLabel, _descriptionLabel); }
// Note - The Xamarin.Forms Previewer requires a default, parameterless constructor to render a page. public ItemDetailPage() { InitializeComponent(); _viewModel = Resolver.Resolve <IGameDetailViewModel>(); _viewModel.PropertyChanged += ViewModelOnPropertyChanged; BindingContext = _viewModel; }
public void Setup() { var container = new TinyIoCContainer(); Resolver.ResetResolver(new TinyResolver(container)); container.Register <IGamePayload, GamePayload>(); _payload = container.Resolve <IGamePayload>(); container.Register <IDataService, DataService>(); container.Register <IGameDetailViewModel, GameDetailViewModel>(); _subject = container.Resolve <IGameDetailViewModel>(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.GameDetailLayout); _titleTextView = FindViewById <TextView>(Resource.Id.textViewDetailTitle); _publisherTextView = FindViewById <TextView>(Resource.Id.textViewPublisher); _releaseYearTextView = FindViewById <TextView>(Resource.Id.textViewReleaseYear); _platformTextView = FindViewById <TextView>(Resource.Id.textViewPlatform); _descriptionTextView = FindViewById <TextView>(Resource.Id.textViewDescription); _boxShotImageView = FindViewById <ImageView>(Resource.Id.imageViewLarge); _viewModel = Resolver.Resolve <IGameDetailViewModel>(); _titleTextView.Text = _viewModel.SelectedGame.Name; }
public GameDetailPage() { InitializeComponent(); _viewModel = Resolver.Resolve <IGameDetailViewModel>(); DataContext = _viewModel; }