// This file has been autogenerated from a class added in the UI designer.

using System;
using System.Collections.Generic;
using System.Linq;
using ReactiveUI;
using ReactiveUI.Cocoa;
using VirtualSales.Core.Models;
using MonoTouch.UIKit;

namespace VirtualSales.iOS
{
    public partial class ClientInfoViewController : ReactiveViewController, IViewFor<PersonModel>
    {
        private PersonModel _viewModel;

        public ClientInfoViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            ViewModel = ((WhiteBrandAppDelegate)UIApplication.SharedApplication.Delegate).ViewModelLocator.SharedDataService.Person;
            this.Bind(ViewModel, vm => vm.FirstName, c => c.firstNameTextField.Text);
        }

        object IViewFor.ViewModel
        {
            get { return ViewModel; }
            set { ViewModel = (PersonModel)value; }
        }

        public PersonModel ViewModel
        {
            get { return _viewModel; }
            set { RaiseAndSetIfChanged(ref _viewModel, value); }
        }
    }
}