Пример #1
0
		public BindingContext(UIView view, string title, Theme currentTheme)
		{
			if (view == null)
				throw new ArgumentNullException("view");
			
			var parser = new ViewParser();
			parser.Parse(view, title, currentTheme);
			Root = parser.Root;

			var viewContext = view as IBindingContext;
			if (viewContext != null)
			{
				viewContext.BindingContext = this;
				var dataContext = view as IDataContext;
				if (dataContext != null)
				{
					var vmContext = dataContext.DataContext as IBindingContext;
					if (vmContext != null)
					{
						vmContext.BindingContext = this;
					}
				}
			}

			if (view is IView)
			{
				((IView)view).TableView = Root.TableView;
			}
		}
Пример #2
0
        public BindingContext(UIView view, string title, Theme currentTheme)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }

            var parser = new ViewParser();

            parser.Parse(view, title, currentTheme);
            Root = parser.Root;

            var viewContext = view as IBindingContext;

            if (viewContext != null)
            {
                viewContext.BindingContext = this;
                var dataContext = view as IDataContext;
                if (dataContext != null)
                {
                    var vmContext = dataContext.DataContext as IBindingContext;
                    if (vmContext != null)
                    {
                        vmContext.BindingContext = this;
                    }
                }
            }

            if (view is IView)
            {
                ((IView)view).TableView = Root.TableView;
            }
        }