Skip to content

Fix ListViewItem cannot find parent in iOS mode - #827

Closed
HaoLife wants to merge 7 commits into
unoplatform:masterfrom
HaoLife:dev/liu/binding
Closed

HaoLife wants to merge 7 commits into
unoplatform:masterfrom
HaoLife:dev/liu/binding

Conversation

@HaoLife

@HaoLife HaoLife commented Apr 27, 2019

Copy link
Copy Markdown

GitHub Issue (If applicable): #

#598

PR Type

Fix ListViewItem cannot find parent in iOS mode

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@carldebilly

Copy link
Copy Markdown
Member

Is there a way you can make a unit test / sample to expose the problem its fix?

@HaoLife

HaoLife commented Apr 28, 2019

Copy link
Copy Markdown
Author

All right, I'll add an sample to illustrate the fix of the problem.

@HaoLife

HaoLife commented Apr 28, 2019 •

Copy link
Copy Markdown
Author

NameScope.FindInNamescopes cannot find parent's ListView object in iOS
This fix is to solve this problem.

	internal static object FindInNamescopes(DependencyObject caller, string name)
	{
		var parent = caller;
		while (parent != null)
		{
			var scope = NameScope.GetNameScope(parent);
			var target = scope?.FindName(name);

			if (target != null)
			{
				return target;
			}

			parent = parent.GetParent() as DependencyObject;
		}

		return null;
	}

@davidjohnoliver

Copy link
Copy Markdown
Contributor

All right, I'll add an sample to illustrate the fix of the problem.

Please make sure the sample follows the guidelines here, so it can be automatically found by the samples app: https://github.com/nventive/Uno/blob/master/doc/articles/working-with-the-samples-apps.md

@davidjohnoliver

Copy link
Copy Markdown
Contributor

@HaoLife This is looking good now, you just need to fix up the merge conflicts and it's ready to go.

@davidjohnoliver

davidjohnoliver commented May 14, 2019 •

Copy link
Copy Markdown
Contributor

/azp run

<PRIResource Include="$(MSBuildThisFileDirectory)UITestsStrings\en-US\Resources.resw" />
</ItemGroup>
<ItemGroup>
<Compile Update="C:\Dev\Uno\src\SamplesApp\UITests.Shared\Windows_UI_Xaml_Controls\BorderTests\Border_CornerOverlap.xaml.cs">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the latest merge didn't work - there shouldn't be so many changes, and there shouldn't be hard-coded paths.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've filed a bug internally for this, looks like this is a regression in Visual Studio.

@ghuntley ghuntley added platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform kind/bug Something isn't working labels May 22, 2019
Comment thread src/Uno.UI.sln
SamplesApp\SamplesApp.UnitTests.Shared\SamplesApp.UnitTests.Shared.projitems*{04b1b5eb-d42e-47de-ada0-eb863e5574fd}*SharedItemsImports = 13
SamplesApp\SamplesApp.Shared\SamplesApp.Shared.projitems*{313fcf91-a6db-4585-a23e-49bbeef4784d}*SharedItemsImports = 4
SamplesApp\SamplesApp.UnitTests.Shared\SamplesApp.UnitTests.Shared.projitems*{313fcf91-a6db-4585-a23e-49bbeef4784d}*SharedItemsImports = 4
SamplesApp\SamplesApp.Shared\SamplesApp.Shared.projitems*{3fdf0f2d-cc11-49be-8634-f81638d595c6}*SharedItemsImports = 4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the solution file shouldn't be changed.

jeromelaban added a commit to jeromelaban/uno that referenced this pull request Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants