protected override void OnAddChild(VisualNode widget, BindableObject childControl)
        {
            if (childControl is View view)
            {
                //System.Diagnostics.Debug.WriteLine($"FlexLayout ({Key ?? GetType()}) inserting {widget.Key ?? widget.GetType()} at index {widget.ChildIndex}");
                NativeControl.Children.Insert(widget.ChildIndex, view);
            }
            else
            {
                throw new InvalidOperationException($"Type '{childControl.GetType()}' not supported under '{GetType()}'");
            }

            base.OnAddChild(widget, childControl);
        }
        protected override void OnMigrated(VisualNode newNode)
        {
            if (NativeControl != null)
            {
                NativeControl.TextChanged -= NativeControl_TextChanged;
            }
            if (NativeControl != null)
            {
                NativeControl.Unfocused -= NativeControl_Unfocused;
            }


            base.OnMigrated(newNode);
        }
示例#3
0
        protected virtual void OnMigrated(VisualNode newNode)
        {
            foreach (var newAnimatableProperty in newNode._animatables)
            {
                if (_animatables.TryGetValue(newAnimatableProperty.Key, out var oldAnimatableProperty))
                {
                    if (oldAnimatableProperty.Animation.GetType() == newAnimatableProperty.Value.Animation.GetType())
                    {
                        newAnimatableProperty.Value.Animation.MigrateFrom(oldAnimatableProperty.Animation);
                    }
                }
            }

            _animatables.Clear();
        }
示例#4
0
        protected override void OnAddChild(VisualNode widget, BindableObject childNativeControl)
        {
            if (childNativeControl is Page page)
            {
                _nativeControl = (T)Activator.CreateInstance(typeof(T), page);
                base.OnMount();
                OnUpdate();
            }
            //else
            //{
            //    throw new InvalidOperationException($"Root must be a Page: received {childNativeControl.GetType()}");
            //}

            base.OnAddChild(widget, childNativeControl);
        }
        protected override void OnAddChild(VisualNode widget, Element childNativeControl)
        {
            if (childNativeControl is Page page)
            {
                _nativeControl = new NavigationPage(page);
                base.OnMount();
                OnUpdate();
            }
            else
            {
                throw new InvalidOperationException($"Root must be a Page: received {childNativeControl.GetType()}");
            }


            base.OnAddChild(widget, childNativeControl);
        }
示例#6
0
        protected override void OnAddChild(VisualNode widget, BindableObject childControl)
        {
            if (childControl is TPAGE page)
            {
                NativeControl.Children.Insert(widget.ChildIndex, page);
            }
            else if (childControl is ToolbarItem toolbarItem)
            {
                NativeControl.ToolbarItems.Add(toolbarItem);
            }
            //else
            //{
            //    throw new InvalidOperationException($"Type '{childControl.GetType()}' not supported under '{GetType()}'");
            //}

            base.OnAddChild(widget, childControl);
        }
示例#7
0
        protected override void OnMigrated(VisualNode newNode)
        {
            if (NativeControl != null)
            {
                NativeControl.Completed -= NativeControl_Completed;
            }

            var newEntry = (RxEntry)newNode;

            if (newEntry != null && NativeControl != null)
            {
                newEntry.CursorPosition  = NativeControl.CursorPosition;
                newEntry.SelectionLength = NativeControl.SelectionLength;
            }

            base.OnMigrated(newNode);
        }
示例#8
0
        protected override void OnRemoveChild(VisualNode widget, BindableObject childControl)
        {
            if (childControl is ShellItem || childControl is Page page)
            {
                NativeControl.Items.Remove(_elementItemMap[childControl]);
            }
            else if (childControl is ToolbarItem toolbarItem)
            {
                NativeControl.ToolbarItems.Remove(toolbarItem);
            }
            //else if (childControl is SearchHandler _)
            //{
            //    Shell.SetSearchHandler(NativeControl, null);
            //}

            base.OnRemoveChild(widget, childControl);
        }
示例#9
0
        protected override void OnMigrated(VisualNode newNode)
        {
            if (NativeControl != null)
            {
                NativeControl.DragStarted -= NativeControl_DragStarted;
            }
            if (NativeControl != null)
            {
                NativeControl.DragCompleted -= NativeControl_DragCompleted;
            }
            if (NativeControl != null)
            {
                NativeControl.ValueChanged -= NativeControl_ValueChanged;
            }

            base.OnMigrated(newNode);
        }
示例#10
0
        protected override void OnAddChild(VisualNode widget, Element childControl)
        {
            if (childControl is View view)
            {
                NativeControl.Content = view;
            }
            else if (childControl is ToolbarItem toolbarItem)
            {
                NativeControl.ToolbarItems.Add(toolbarItem);
            }
            else
            {
                throw new InvalidOperationException($"Type '{childControl.GetType()}' not supported under '{GetType()}'");
            }

            base.OnAddChild(widget, childControl);
        }
示例#11
0
        protected override void OnAddChild(VisualNode widget, Xamarin.Forms.Element childControl)
        {
            if (childControl is View view)
            {
                Grid.SetRow(childControl, widget.GetMetadata <int>("Grid.Row"));
                Grid.SetRowSpan(childControl, widget.GetMetadata <int>("Grid.RowSpan", 1));
                Grid.SetColumn(childControl, widget.GetMetadata <int>("Grid.Column"));
                Grid.SetColumnSpan(childControl, widget.GetMetadata <int>("Grid.ColumnSpan", 1));

                NativeControl.Children.Insert(widget.ChildIndex, view);
            }
            else
            {
                throw new InvalidOperationException($"Type '{childControl.GetType()}' not supported under '{GetType()}'");
            }

            base.OnAddChild(widget, childControl);
        }
示例#12
0
        protected override void OnAddChild(VisualNode widget, BindableObject childControl)
        {
            if (childControl is Page page)
            {
                if (widget == Master)
                {
                    NativeControl.Master = page;
                }
                else
                {
                    NativeControl.Detail = page;
                }
            }
            //else
            //{
            //    throw new InvalidOperationException($"Type '{childControl.GetType()}' not supported under '{GetType()}'");
            //}

            base.OnAddChild(widget, childControl);
        }
示例#13
0
        protected override void OnAddChild(VisualNode widget, Element childControl)
        {
            if (childControl is ShellSection item)
            {
                NativeControl.Items.Insert(widget.ChildIndex, item);
            }
            else if (childControl is Page page)
            {
                NativeControl.Items.Insert(widget.ChildIndex, new ShellContent()
                {
                    Content = page
                });
            }
            else
            {
                throw new InvalidOperationException($"Type '{childControl.GetType()}' not supported under '{GetType()}'");
            }

            _elementItemMap[childControl] = NativeControl.Items[NativeControl.Items.Count - 1];

            base.OnAddChild(widget, childControl);
        }
        internal virtual void MergeWith(VisualNode newNode)
        {
            if (newNode == this)
            {
                return;
            }

            for (int i = 0; i < Children.Count; i++)
            {
                if (newNode.Children.Count > i)
                {
                    Children[i].MergeWith(newNode.Children[i]);
                }
            }

            for (int i = newNode.Children.Count; i < Children.Count; i++)
            {
                Children[i].Unmount();
                Children[i].Parent = null;
            }

            Parent = null;
        }
示例#15
0
 public void Add(VisualNode child)
 {
     _contents.Add(child ?? throw new ArgumentNullException());
 }
示例#16
0
 public RxContentPage(VisualNode content)
 {
     _contents.Add(content ?? throw new ArgumentNullException());
 }
示例#17
0
 public void Add(VisualNode child)
 {
     _contents.Add(child);
 }
示例#18
0
        protected override void OnRemoveChild(VisualNode widget, BindableObject childControl)
        {
            NativeControl.Content = null;

            base.OnRemoveChild(widget, childControl);
        }
示例#19
0
        protected override void OnRemoveChild(VisualNode widget, Element childControl)
        {
            NativeControl.Items.Remove(_elementItemMap[childControl]);

            base.OnRemoveChild(widget, childControl);
        }
示例#20
0
        protected override void OnMigrated(VisualNode newNode)
        {
            DetachEvents();

            base.OnMigrated(newNode);
        }
        protected override void OnMigrated(VisualNode newNode)
        {
            NativeControl.CheckedChanged -= NativeControl_CheckedChanged;

            base.OnMigrated(newNode);
        }
 public RxNavigationPage(Action <NavigationPage> componentRefAction, VisualNode rootPage = null)
     : base(componentRefAction)
 {
     _rootPage = rootPage;
 }
 public RxNavigationPage(VisualNode rootPage = null)
 {
     _rootPage = rootPage;
 }
示例#24
0
 public RxContentPage(VisualNode content)
 {
     _contents.Add(content);
 }
示例#25
0
 public void Add(VisualNode child)
 {
     _children.Add(child);
 }
示例#26
0
        protected override void OnRemoveChild(VisualNode widget, Element childNativeControl)
        {
            NativeControl.Content = null;

            base.OnRemoveChild(widget, childNativeControl);
        }
示例#27
0
        protected override void OnRemoveChild(VisualNode widget, BindableObject childControl)
        {
            NativeControl.Children.Remove((View)childControl);

            base.OnRemoveChild(widget, childControl);
        }
示例#28
0
 public RxShellContent(VisualNode content)
 {
     _contents.Add(content);
 }
        protected override void OnRemoveChild(VisualNode widget, Xamarin.Forms.Element childControl)
        {
            NativeControl.Children.Remove((View)childControl);

            base.OnRemoveChild(widget, childControl);
        }
示例#30
0
 public void Add(VisualNode node)
 {
     _contents.Clear();
     _contents.Add(node);
 }