コード例 #1
0
 /// <summary>
 ///     Called to have the fragment instantiate its user interface view.
 /// </summary>
 public virtual View OnCreateView(int?viewId, LayoutInflater inflater, ViewGroup container,
                                  Bundle savedInstanceState, Func <LayoutInflater, ViewGroup, Bundle, View> baseOnCreateView)
 {
     ClearBindings();
     if (viewId.HasValue)
     {
         if (_bindings == null)
         {
             _bindings = new List <IDataBinding>();
         }
         Tuple <View, IList <IDataBinding> > tuple = inflater.CreateBindableView(viewId.Value, container, false);
         FragmentViewMember.SetValue(tuple.Item1, Target);
         BindingServiceProvider.ContextManager.GetBindingContext(tuple.Item1).Value = DataContext;
         _bindings.AddRange(tuple.Item2);
         return(tuple.Item1);
     }
     return(baseOnCreateView(inflater, container, savedInstanceState));
 }
コード例 #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ListItem" /> class.
 /// </summary>
 public ListItem(int templateId, LayoutInflater inflater)
     : base(inflater.Context)
 {
     _templateId = templateId;
     _bindings   = inflater.CreateBindableView(templateId, this, true).Item2;
 }