Parse() public method

public Parse ( DialogViewController controller, object view, MemberInfo member ) : UITableViewSource
controller DialogViewController
view object
member System.Reflection.MemberInfo
return UITableViewSource
示例#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;
					}
				}
			}
		}
        private void CreateTableView(object view, MemberInfo member, Theme theme)
        {
            Theme = Theme.CreateTheme(theme);
            var themeable = view as IThemeable;

            if (themeable != null)
            {
                var themeAttribute = view.GetType().GetCustomAttribute <ThemeAttribute>();
                if (themeAttribute != null)
                {
                    var viewTheme = Theme.CreateTheme(themeAttribute.ThemeType);
                    themeable.Theme = viewTheme;
                    var newTheme = Theme.CreateTheme(viewTheme);

                    Theme           = newTheme;
                    themeable.Theme = Theme;
                }
            }

            using (var parser = new ViewParser())
            {
                var source = parser.Parse(this, view, member);

                var tableViewStyle = Theme.TableViewStyle;
                var tableStyle     = source as ITableViewStyle;
                if (tableStyle != null)
                {
                    tableViewStyle = tableStyle.TableViewStyle;
                }

                if (source != null)
                {
                    _TableView        = MakeTableView(UIScreen.MainScreen.Bounds, tableViewStyle);
                    _TableView.Source = source;

                    TableView        = _TableView;
                    DisableScrolling = view.GetType().GetCustomAttribute <DisableScrollingAttribute>() != null;
                }
            }
        }
		private void CreateTableView(object view, MemberInfo member, Theme theme)
		{
			Theme = Theme.CreateTheme(theme);
			var themeable = view as IThemeable;
			if (themeable != null)
			{
				var themeAttribute = view.GetType().GetCustomAttribute<ThemeAttribute>();
				if (themeAttribute != null)
				{
					var viewTheme = Theme.CreateTheme(themeAttribute.ThemeType);
					themeable.Theme = viewTheme;
					var newTheme = Theme.CreateTheme(viewTheme);

					Theme = newTheme;
					themeable.Theme = Theme;
				}
			}

			using(var parser = new ViewParser())
			{
				var source = parser.Parse(this, view, member);
				
				var tableViewStyle = Theme.TableViewStyle;
				var tableStyle = source as ITableViewStyle;
				if (tableStyle != null)
				{
					tableViewStyle = tableStyle.TableViewStyle;
				}
				
				if (source != null)
				{
					_TableView = MakeTableView(UIScreen.MainScreen.Bounds, tableViewStyle);
					_TableView.Source = source;
					
					TableView = _TableView;
					DisableScrolling = view.GetType().GetCustomAttribute<DisableScrollingAttribute>() != null;
				}
			}
		}