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

Invalid code gen when assigning items to a collection property in XAML #211

Closed
Daoting opened this issue Sep 21, 2018 · 2 comments
Closed
Labels
kind/bug Something isn't working platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Comments

@Daoting
Copy link
Contributor

Daoting commented Sep 21, 2018

I'm submitting a...

  • Bug report #189 The difference is that it is the root element.

Current behavior

xaml like this:

<local:SingleWin>
	<local:SingleWin.Bar>
		<local:Btn />
		<local:Btn />
		<local:Btn />
	</local:SingleWin.Bar>
</local:SingleWin>

local:SingleWin is root element. local:SingleWin.Bar is collection instance.

The Bar's define:
public IList<IBarElement> Bar { get { return _bar.Commands; } }

XamlFileGenerator code:

this
.Apply((c9 =>
{
// Source Frame\PageWinDemo.xaml (Line 1:2)
// WARNING Property c9.base does not exist on {using:Dt.Base}PageWin, the namespace is http://www.w3.org/XML/1998/namespace. This error was considered irrelevant by the XamlFileGenerator
c9.Bar = 
{
	new global::Dt.Base.Btn
	{
		// Source ..\..\..\..\..\..\Frame\PageWinDemo.xaml (Line 8:10)
	}
	,
	new global::Dt.Base.Btn
	{
		// Source ..\..\..\..\..\..\Frame\PageWinDemo.xaml (Line 9:10)
	}
	,
	new global::Dt.Base.ToggleBtn
	{
		// Source ..\..\..\..\..\..\Frame\PageWinDemo.xaml (Line 20:10)
	}
	,
}
;

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Nuget Package: 

Package Version(s): 

Affected platform(s):
- [x] iOS
- [x] Android
- [x] WebAssembly
- [ ] Windows
- [ ] Build tasks

Visual Studio
- [x] 2017 (version: )
- [ ] 2017 Preview (version: )
- [ ] for Mac (version: )

Relevant plugins
- [ ] Resharper (version: )
@jeromelaban jeromelaban added the kind/bug Something isn't working label Sep 26, 2018
@jeromelaban
Copy link
Member

Agreed, the management of top level items is a bit different from the others, this will have to be adressed.

@ghuntley ghuntley added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform labels May 22, 2019
@carldebilly
Copy link
Member

Fixed by PR #1356

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/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform
Projects
None yet
Development

No branches or pull requests

4 participants