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); }
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(); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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; }
public void Add(VisualNode child) { _contents.Add(child ?? throw new ArgumentNullException()); }
public RxContentPage(VisualNode content) { _contents.Add(content ?? throw new ArgumentNullException()); }
public void Add(VisualNode child) { _contents.Add(child); }
protected override void OnRemoveChild(VisualNode widget, BindableObject childControl) { NativeControl.Content = null; base.OnRemoveChild(widget, childControl); }
protected override void OnRemoveChild(VisualNode widget, Element childControl) { NativeControl.Items.Remove(_elementItemMap[childControl]); base.OnRemoveChild(widget, childControl); }
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; }
public RxContentPage(VisualNode content) { _contents.Add(content); }
public void Add(VisualNode child) { _children.Add(child); }
protected override void OnRemoveChild(VisualNode widget, Element childNativeControl) { NativeControl.Content = null; base.OnRemoveChild(widget, childNativeControl); }
protected override void OnRemoveChild(VisualNode widget, BindableObject childControl) { NativeControl.Children.Remove((View)childControl); base.OnRemoveChild(widget, childControl); }
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); }
public void Add(VisualNode node) { _contents.Clear(); _contents.Add(node); }