Граф коммитов

233 Коммитов

Автор SHA1 Сообщение Дата
Stephane Delcroix 04d44fbe82
[X] do not compile binding set as property values (#6837)
binding passed as properties don't have a valid datatype, so do not compile those.

- fixes #5240
2019-07-15 12:02:13 +02:00
Samantha Houts c9ebaab4b4 Merge branch '4.1.0' into 4.2.0 2019-07-09 10:50:41 -07:00
Stephane Delcroix d44d705cf1 [X] Allow x:Null for x:DataType (#6822)
- fixes #6648
2019-07-08 16:03:32 -07:00
Samantha Houts 577bc7b06f Merge branch '4.1.0' 2019-06-27 16:50:21 -07:00
Stephane Delcroix 267eca042c
try to generate more unique names (#6669)
- fixes #6668
2019-06-27 11:30:11 +02:00
Stephane Delcroix ea0d55dd0d
[X] resolve event handlers in base generic types (#6194)
* [XamlC] fix Debug harness generation code

* [X] resolve event handlers in base generic types

- fixes #6176
2019-06-26 14:35:54 +02:00
Stephane Delcroix 506d3b92e8 Backport41 (#6651)
* use a BP for QueryAttributes (#6569)

* use a BP for QueryAttributes

* Update Xamarin.Forms.Core/Shell/ShellContent.cs

* Allow tracking of StyleSheets (#6502)

* remove excess code and clean up sandbox (#6503)

* Allow tracking of StyleSheets

*  ¯\_(ツ)_/¯
2019-06-25 15:20:55 -07:00
Akihiko Odaki 54acfa9122 [XamlC] Do not try to set a value to bound source property if unavailable (#6564) 2019-06-20 11:37:42 +02:00
Stephane Delcroix aa0ad621bb
Allow tracking of StyleSheets (#6502)
* remove excess code and clean up sandbox (#6503)

* Allow tracking of StyleSheets

*  ¯\_(ツ)_/¯
2019-06-14 18:51:43 +02:00
Akihiko Odaki 24bf23b2d1 [XamlC] Correctly load addresses of values in more compiled binding paths (#6423)
This is a follow-up of commit 12f5b702ef.
2019-06-08 10:55:53 +02:00
Akihiko Odaki ca409d3d14 [Xaml[C]] Allow to connect to event handler with overloads (#5118)
* [Xaml] Allow to connect to event handler with overloads

* [XamlC] Allow to connect to event handler with overloads
2019-06-04 13:45:18 +02:00
Rui Marinho f8fd2811dc
Merge branch '4.0.0' 2019-05-22 22:32:28 +01:00
Rui Marinho 38711f35d0
Merge branch '3.6.0' into 4.0.0 2019-05-22 16:23:05 +01:00
Rui Marinho 9bc0fc6b0a
[Build] Update builds, remove submodule, update AssemblyInfo with GitInfo (#6068)
* [Build] Remove submodule

* [Build] Use GitInfo to set Assembly metadata

* [Build] Remove extra prop

* [Build] Update version

* [Build] Update versions to be consistent with existing Build.Tasks

* [Build] Update build number

* [Build] make sure build tasks gets info

* [Build] Add assembly info unit test

* [Test] Refactor test for gitinfo on vsts
2019-05-22 01:06:59 +01:00
inforithmics a19e105240 fixes BindableLayout DataTemplate - XamlC #5486 (#6178)
fixes #5651
fixes #5486

* Update TypeReferenceExtensions.cs
2019-05-20 11:00:46 -07:00
Akihiko Odaki 92ee64e2f6 [Xaml[C]] Allow to connect to static event handler (#5119) 2019-05-03 20:25:03 +02:00
Stephane Delcroix 48f48371db
[X] pass the instance along the rlq (#6007)
allow resourceprovider to track lifecycle of xaml-generated object
2019-05-02 17:51:12 +02:00
Samantha Houts 105ded9353 Merge branch '4.0.0' 2019-04-10 22:03:02 -07:00
Samantha Houts 0fcb349e1d Merge branch '3.6.0' into 4.0.0 2019-04-10 21:59:38 -07:00
Stephane Delcroix 4ba7610c04 [X] update Cecil (#5878)
- fixes #5875
2019-04-10 16:10:54 -07:00
Stephane Delcroix c92fb05acd Merge branch '4.0.0' 2019-04-04 08:55:24 +02:00
Stephane Delcroix b181e019c9
[X] check for null on the parent property (#5796)
In case of value types in Compiled Binding Paths, we weren't checking
for null property on the right part of the path

before
```csharp
bindingExtension.TypedBinding = new TypedBinding<Gh5770, Color>(delegate(Gh5770 gh)
	{
		if (gh == null)
		{
			return new ValueTuple<Color, bool>(default(Color), false);
		}
		Gh5770VM expr_24 = gh.MyContentViewModel;
		return new ValueTuple<Color, bool>(expr_24.TextColor, true);
	}, ..., ...);
```

after
```csharp
bindingExtension.TypedBinding = new TypedBinding<Gh5770, Color>(delegate(Gh5770 gh)
	{
		if (gh == null)
		{
			return new ValueTuple<Color, bool>(default(Color), false);
		}
		Gh5770VM expr_24 = gh.MyContentViewModel;
		if (expr_24 == null)
		{
			return new ValueTuple<Color, bool>(default(Color), false);
		}
		return new ValueTuple<Color, bool>(expr_24.TextColor, true);
	}, ..., ...);
```

- fixes #5770
2019-04-03 15:19:48 +02:00
Stephane Delcroix ab164c0ede
[X] resolve generic indexer types (#5794)
- fixes #5510
2019-04-03 15:19:33 +02:00
Stephane Delcroix a125f6d7ba Merge branch '4.0.0' 2019-03-18 09:40:38 +01:00
Akihiko Odaki 7c71feec26 [XamlC] Resolve complex property type (#5086) 2019-03-15 15:12:57 -07:00
Akihiko Odaki 12f5b702ef [XamlC] Correctly load addresses of values in compiled binding paths (#5082) 2019-03-14 13:39:29 +01:00
Akihiko Odaki 7d8b2fc0e5 [XamlC] Identify generic instance types correctly when importing ctor (#5309)
The old implementation fails to identify generic instance types for typed
binding getter, whose type is:
System.Func`2<TSource, ValueTuple<TProperty, bool>>

This fixes the issue by taking generic arguments into account.
2019-03-12 16:48:33 -07:00
Akihiko Odaki b5c8345fa8 [XamlC] Fix message for unresolved event handler reference in DataTemplate (#5502) 2019-03-11 09:52:36 +01:00
Stephane Delcroix 8dccf2f439
[XamlC] throw on invalid DataType (#5335)
Invalid x:DataType was ignored up to now. Change the behavior so it
throws a XPE.

- fixes #5330
2019-03-06 09:39:12 +01:00
Stephane Delcroix 533e130191 Merge branch '3.6.0' 2019-02-25 08:33:25 +01:00
Akihiko Odaki cd43402f02 [XamlC] Identify generic instance types correctly when importing ctor (#5309)
The old implementation fails to identify generic instance types for typed
binding getter, whose type is:
System.Func`2<TSource, ValueTuple<TProperty, bool>>

This fixes the issue by taking generic arguments into account.
2019-02-21 16:56:42 -08:00
Stephane Delcroix f00eb51169
[XamlC] compiled binding to int indexers (#5271)
- fixes #5254
2019-02-19 15:26:30 +01:00
Stephane Delcroix 711bf307d7
[XamlC] avoid cast exception on overriden members (#5269)
avoid InvalidCastException if an event is overriden with the new keyword
to a bindableproperty. Kids, DO NOT EVER DO THIS AT HOME.

- fixes #5256 for XamlC
2019-02-19 15:25:51 +01:00
Stephane Delcroix ac6287c0b1 [Xaml] better error reporting (#5104) #fixes #5095
* [Xaml] better error reporting

Report error on invalid value nodes

- fixes #5095

* Think about the nullable

* fix test
2019-02-13 13:02:01 +00:00
Stephane Delcroix 7cc9a282bd Merge branch '3.5.0' 2019-01-14 09:32:43 +01:00
Stephane Delcroix 6d20db1a3c
hide obsolete API from editor (#4938)
- fixes #4772
2019-01-10 12:53:48 +01:00
Stephane Delcroix 57d507ef0b Merge branch '3.5.0' 2019-01-07 11:32:11 +01:00
Akihiko Odaki 8f3804de4d [XamlC] Test generic parameters to evaluate equality of types (#4062) 2018-12-22 17:58:06 +01:00
Stephane Delcroix a206fa0f1f
[X] Design time properties (#4743)
An alternate xaml resource file provider can request the XamlLoader to
_not_ ignore normally ignored properties in prebuilt XF design xmlns, as
in the following snippet:

```xaml
<ContentPage
    xmlns="http://xamarin.com/schemas/2014/forms""
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml""
    xmlns:d="http://xamarin.com/schemas/2014/forms/design""
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006""
    mc:Ignorable="d"">
  <Label d:Text="Bar" Text="Foo" x:Name="label" />
</ContentPage>
```

The `d:` should be the prefix used by default for this, but any other
prefix will do too.

The `d:Text` property maps to the exact same property as `Text`, as the
XmllnsDefinitionAttributes are identical (that's convenient from a Intelisense
point of view), but, when (and only when) instructed by a provided Xaml resource
loader, the `d:Text` will override the `Text` property.

This works with virtually all properties defined on built-in Xamarin.Forms
controls, but it doesn't mean it's a sane idea to try to assign design value
to all existing properties.

The APi ofr setting the ResourceLoader had to change, and instead of taking
pre-defined arguments, it accepts and returns query and response types. This
is slightly less convenient to invoke through reflection, but way more easy
to extend in the future.
2018-12-20 13:16:40 +01:00
Stephane Delcroix 761a04e27e
[XamlC] instantiate generic parameter on base types (#4776)
* [XamlC] Instantiate generic parameters in base type generic arguments

* Add unit test for #4047

- fixes #4760
- closes #4047
2018-12-19 15:10:08 +01:00
Stephane Delcroix 28a016d547 [X] throw XPE on missing element .ctor (#4786)
* [X] throw XPE on missing element .ctor

In case of runtime parse, wrap the MissingMethodException in a
XamlParseException, to get lineInfo. In case of XamlC, detect missing
constructor and fail early.

- fixes #4751

* fix for ns1.0
2018-12-18 16:54:45 -07:00
Akihiko Odaki 4ad5c88f75 [XamlC] Always enable implicit casting, boxing and unboxing (#4238) 2018-12-18 20:21:53 +01:00
Akihiko Odaki 882945b275 [XamlC] Resolve generic parameters of a method with generic return type (#4244) 2018-12-18 12:07:49 +01:00
Stephane Delcroix 5193cb88b1
[Xaml] throw on unexpected empty elements (#4582)
new exception being thrown:
>Xamarin.Forms.Xaml.XamlParseException : Position 7:4. Unexpected empty element '<Grid.ColumnDefinitions/>'

also reduce the number of places we resolve lineInfo for exceptions
purposes

- fixes #4553
2018-12-12 16:50:30 +01:00
Stephane Delcroix a35c90a7ac revert package downgrade 2018-12-10 08:55:03 +01:00
Rui Marinho 97206c235c
Merge 3.4.0 to 3.5.0 2018-12-09 00:51:34 +00:00
Stephane Delcroix 4da56c6296
[tasks] Build.Tasks targets net46 (#4670)
* [tasks] Build.Tasks targets net46

Build tasks in VS MUST target net46 and no higher

- fixes #4667

* fix nuspec
2018-12-08 10:03:34 +01:00
Stephane Delcroix 1580e25d48
[XamlC] Compile the {DataTemplate} markup (#4641)
* [XamlC] Compile the {DataTemplate} markup

- fixes #4592

* [C] throw XPE on missing mandatory member

TypeName for {Type} and {DataTemplate} markup extensions is mandatory.
Throw a XamlParseException, with context, when that happens.

* fix style

* (ab)use of nameof
2018-12-08 09:53:07 +01:00
Stephane Delcroix 8a758a2474 [XamlC] test for null in Binding paths (#4521) fixes #4102
* [XamlC] test for null in Binding paths

Instead of relying on a NRE behing thrown while trying to evaluate a
compiled binding getter, detect the null value and fail faster, without
throwing. This require changing the type of the getter so they return a
(TProperty, bool) value tuple indicating the success.

- fixes #4102

* depend on ValueTuple for ns1.0
2018-12-04 18:21:36 +00:00
Stephane Delcroix f330652d74 [tasks] avoid passing dupe assemblies to Cecil (#4624) fixes #4620
* [tasks] avoid passing dupe assemblies to Cecil

avoid feeding Mono.Cecil with dupes. Removes a negligeable handful
of milliseconds (100ms on average, hard to measure) from XamlC. Even
less from XamlG.

- fixes #4620

* add extra check
2018-12-04 18:17:54 +00:00