Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ListViewItem cannot find parent in iOS mode #827

Closed
wants to merge 7 commits into from
Closed

Fix ListViewItem cannot find parent in iOS mode #827

wants to merge 7 commits into from

Conversation

HaoLife
Copy link

@HaoLife HaoLife commented Apr 27, 2019

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
Member

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

@HaoLife
Copy link
Author

HaoLife commented Apr 28, 2019

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

@HaoLife
Copy link
Author

HaoLife commented Apr 28, 2019

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
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
Contributor

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

@davidjohnoliver
Copy link
Contributor

davidjohnoliver commented May 14, 2019

/azp run

@@ -2642,6 +2647,383 @@
<PRIResource Include="$(MSBuildThisFileDirectory)UITestsStrings\en-US\NamedResources.resw" />
<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
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

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
@@ -137,18 +137,7 @@ Global
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
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.

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