Пример #1
0
        public MainPage()
        {
            this.InitializeComponent();

            this._contactsMb       = App.Ioc.Resolve <ContactsModelBinders>();
            this._contactSummaryMb = App.Ioc.Resolve <ContactsSummaryModelBinders>();

            this.InitModelBinders();
        }
Пример #2
0
        public MainWindow()
        {
            this.InitializeComponent();

            this._contactsMb       = App.Ioc.Resolve <ContactsModelBinders>();
            this._contactSummaryMb = App.Ioc.Resolve <ContactsSummaryModelBinders>();

            //INit Notification
            this.NotificationTray.NotificationsSource = new NotificationsSource();

            this.InitModelBinders();
        }
Пример #3
0
        public MainForm()
        {
            this.InitializeComponent();

            this._contactsMb       = Program.Ioc.Resolve <ContactsModelBinders>();
            this._contactSummaryMb = Program.Ioc.Resolve <ContactsSummaryModelBinders>();

            this._imagesListSmall = new ImageList();
            this.ContactsListView.LargeImageList = new ImageList();
            this.ContactsListView.View           = View.LargeIcon;

            this.InitModelBinders();
        }
Пример #4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            this.SetContentView(Resource.Layout.Main);

            //Get used binders for this view
            this._contactSummaryMb = MainApplication.Ioc.Resolve <ContactsSummaryModelBinders>();
            this._contactsMb       = MainApplication.Ioc.Resolve <ContactsModelBinders>();
            //------------------------------

            //Get views
            this._summaryText   = this.FindViewById <TextView>(Resource.Id.SummaryTw);
            this._signatureText = this.FindViewById <TextView>(Resource.Id.SignatureTw);
            this._reloadButton  = this.FindViewById <Button>(Resource.Id.ReloadBtn);
            this._changeBtn     = this.FindViewById <Button>(Resource.Id.ChangeNameBtn);

            this._contactsAdapter = new ContactRowAdapter(this, Android.Resource.Layout.SimpleListItem1,
                                                          this._contactsMb.Contacts);
            this._contactsListView         = this.FindViewById <ListView>(Resource.Id.ContactsListView);
            this._contactsListView.Adapter = this._contactsAdapter;
            //------------------------------

            //To Binders inputs
            this._reloadButton.Click += (sender, args) =>
            {
                this._contactsMb.LoadContacts();
            };

            this._changeBtn.Click += (sender, args) =>
            {
                this._contactsMb.ShakeNames();
            };
            //------------------------------

            //SOMETHING COULD BE TOTALLY NOT ON MVB
            this._signatureText.Click += (sender, args) =>
            {
                var uri    = Android.Net.Uri.Parse("http://www.markjackmilian.net");
                var intent = new Intent(Intent.ActionView, uri);
                this.StartActivity(intent);
            };
            //-----------------------------

            //Init the binders
            InitModelBinders();
            //------------------------------
        }
Пример #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Do any additional setup after loading the view.

            //Get used binders for this view
            this._contactSummaryMb = AppDelegate.Ioc.Resolve <ContactsSummaryModelBinders>();
            this._contactsMb       = AppDelegate.Ioc.Resolve <ContactsModelBinders>();
            //------------------------------

            this.InitModelBinders();

            var dataSource = new ContactTableDataSource(this._contactsMb.Contacts);

            this.ContactsList.DataSource = dataSource;
            this.ContactsList.Delegate   = new ContactTableDelegate(dataSource);
        }
Пример #6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            this.ContactList.RowHeight          = UITableView.AutomaticDimension;
            this.ContactList.EstimatedRowHeight = 80;


            //Get used binders for this view
            this._contactSummaryMb = AppDelegate.Ioc.Resolve <ContactsSummaryModelBinders>();
            this._contactsMb       = AppDelegate.Ioc.Resolve <ContactsModelBinders>();
            //------------------------------

            //TableDataSource
            var dataSource = new ContactsTableDataSource(this._contactsMb.Contacts, this.ContactList);

            this.ContactList.Source = dataSource;

            //INit Binders
            this.InitModelBinders();
        }
Пример #7
0
        static void Main(string[] args)
        {
            //Mvb Init
            Core.Mvb.NullInit();

            //Init IOC
            var ioc = new Container();

            //Services
            ioc.Register <IContactServices, WinContactsServices>();
            ioc.Register <IAvatarServices, CommonAvatarServices>();

            //ModelBinders
            ioc.Register <ContactsSummaryModelBinders>(Reuse.Singleton);
            ioc.Register <ContactsModelBinders>(Reuse.Singleton);
            //-------------------------------------------

            _contactMb        = ioc.Resolve <ContactsModelBinders>();
            _contactSummaryMb = ioc.Resolve <ContactsSummaryModelBinders>();

            Console.WriteLine("Mvb & Ioc Init..");
            InitModelBinders();
            Console.WriteLine("Press a button to load contacts..");
            Console.ReadLine();

            _contactMb.LoadContacts(false);

            Console.WriteLine("Press a button to shake names..");
            Console.ReadLine();

            _contactMb.ShakeNames();

            Console.WriteLine("Press a button to open my awesome website..");
            Console.ReadLine();

            Process.Start("http://www.markjackmilian.net");
        }