This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Setup Shell to only use the LogicalChildren for reporting its LogicalChildren #13462
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0ed94e5
Visual Tree Fixes
PureWeen 8ddef2d
Fix logical Chidlren
PureWeen 1888fbc
- fix setting of view and test
PureWeen d469e64
Call Add/RemoveLogicalChildren for Flyout Items
PureWeen 767d6ad
- fix logical children
PureWeen a7b5210
- fix iOS
PureWeen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Xamarin.Forms.Internals; | ||
|
||
namespace Xamarin.Forms | ||
{ | ||
public static class ShellTemplatedViewManager | ||
{ | ||
public static void SetView( | ||
ref View localView, | ||
View newView, | ||
Action<Element> OnChildRemoved, | ||
Action<Element> OnChildAdded) | ||
{ | ||
if (localView == newView) | ||
return; | ||
|
||
if (localView != null) | ||
OnChildRemoved(localView); | ||
localView = newView; | ||
if (localView != null) | ||
OnChildAdded(localView); | ||
} | ||
|
||
|
||
public static void OnViewDataChanged( | ||
DataTemplate currentViewTemplate, | ||
ref View localViewRef, | ||
object newViewData, | ||
Action<Element> OnChildRemoved, | ||
Action<Element> OnChildAdded) | ||
{ | ||
if (currentViewTemplate == null) | ||
{ | ||
SetView(ref localViewRef, | ||
newViewData as View, | ||
OnChildRemoved, | ||
OnChildAdded); | ||
} | ||
} | ||
|
||
public static void OnViewTemplateChanged( | ||
DataTemplate newViewTemplate, | ||
ref View localViewRef, | ||
object currentViewData, | ||
Action<Element> OnChildRemoved, | ||
Action<Element> OnChildAdded, | ||
Shell shell) | ||
{ | ||
View newContentView = currentViewData as View; | ||
if (newViewTemplate != null) | ||
{ | ||
newContentView = (View)newViewTemplate.CreateContent(newViewTemplate, shell); | ||
} | ||
|
||
SetView(ref localViewRef, | ||
newContentView, | ||
OnChildRemoved, | ||
OnChildAdded); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that generated flyout items are added to the LogicalChildren the
startingLayout.Count
no longer matches up withLogicalChildren.Count
after LayoutChildren is called