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

13 Коммитов

Автор SHA1 Сообщение Дата
Stephane Delcroix ad1b0d8e15
[XamlC] cache ImportReference and ImportMethodReference as they're slow (#2025)
* [XamlC] cache ImportReference and ImportMethodReference as they're slow
on ns1.4

* more ns14 fixes
2018-04-11 21:36:11 +02:00
Stephane Delcroix 463714be71 [XamlC] no longer use any reflection-base ImportReference (#1899)
* [XamlC] no longer use any reflection-base ImportReference

reflection-base ImportReference -- we were using MethodBase and Type --
are importing the types present in the reflection context, at the time
of compilation. As the compilation happens on netstandard2.0, and our
assembly can now be netstandard1.0 again, those imported types are
failing to be resolved.

this changes always import references based on the assembly, or the
assembly references.

it might, or might not, give us another speed bump.

* [XamlC] accomodate all kinds of netstandard versions

* reuse caching code
2018-02-26 11:07:18 +00:00
Stephane Delcroix af6f333790
[XamlC] Cache Resolve and ImportReference (#1875)
ImportReference with System.Reflection based argument is notoriously
slow on .NET. So we cache the results for those.

We do not cache the results for TypeReference, MethodReference or
FieldReference calls, as those are already fast (passthrough if the
reference was already imported), and they aren't valid as dictionary
keys (no concept of equatability).

While we're at it, we shave another few ms from Resolve(TypeReference)
calls as well.

As, on good days, it shaves up to 40% of XamlC time, we can say that it

 - fixes #1848
2018-02-13 22:27:02 +01:00
E.Z. Hart 28948d7ef7 VisualStateManager phase 1 (#1405)
* Port from old VSM branch

* Add PS and notes

* Checkpoint: entry text UWP mostly working, need to check on background colors

* Remove irrelevant samples from the EntryDisabledStatesGallery
Make Background color work on UWP Entry with VSM

* Add platform specific for disabling legacy colors on Android

* Add OnPlatform example to visual state manager gallery

* Add example OnIdiom in Visual State Manager

* Add platform specific for disabling legacy color mode on iOS Entry

* Add gallery for Button disabled states
Handling legacy colors for Buttons on Android

* Split out disabled states galleries; disabled legacy handling for Picker

* TimePicker disabled states

* DatePicker color management on Android

* Color management for pre-AppCompat button

* Button legacy color handling on iOS

* Consolidate Platform Specifics;
legacy colors working for iOS Picker and DatePicker

* Fix broken search bar color management
SearchBar color management working with VSM
Add test page for SearchBar disabled color management
Consolidate legacy color management check code into extension method on Android

* Legacy color management for Editor on Android

* Fix legacy color stuff for SearchBar Cancel button on iOS

* C# 7 cleanup

* Add colors for Cancel Button

* Make sure VisualStateGroup collections set by styles are distinct objects

* Validation example

* Make common state names consts

* Make the Windows VSM and Forms VSM work together

* Update galleries for Windows

* Make new methods internal

* Split gallery classes and add more explanation to validation example

* Remove debugging statements

* Add a quick code-only example

* Make legacy color management work for fast button renderer

* Remove old TODO

* Update docs

* Move RunTimeNamePropertyAttribute to Xamarin.Forms.Xaml namespace

* Verify XF namespace when looking for VisualState

* Use nameof

* Make common states constants public

* Cast VisualElement directly so it crashes if the property is set on the wrong type

* Collection -> IList for VisualStateManager

* Setting fromStyle to true

* Remove extraneous `private set`

* Seal VSM classes

* Use constraints instead of ==

* Add teardown method; use constraints rather than ==

* Remove null checking with GetVisualStateGroups

* Don't explicitly initialize collections on elements

* Actually, turns out that fromStyle:false *was* correct

* Direct casts

* Use GetIsDefault check in GoToState

* Validate parents in FindTypeForVisualState

* Validate group and state names on Add

* Fixed check for setter collection

* Fix issues with "duplicate" names when VisualStateGroups declared directly on VisualElements

* Add gallery example for VSGs directly on VisualElements

* Update docs

* Fix bug where initial TextColor isn't set for FastRenderer Button

* Move to explicit VisualStateGroupList in Setter

* Fix return types for unit tests

* Using string.CompareOrdinal in GetState

* Update docs

* Add check for null/empty VisualState Name properties
2018-01-05 09:11:51 +00:00
Stephane Delcroix 5ea86a266b
Stylesheets (#1207)
* [*] Support for CSS StyleSheets

 Parsing, loading, and applying of StyleSheets

 see https://github.com/xamarin/Xamarin.Forms/pull/1207#issue-266464280
 for complete description.

* use initial, not none

* fix tests
2017-12-20 10:47:50 +01:00
Stephane Delcroix a7d12e620c [Xaml/XamlC] better RD inflation (#1148)
* [Xaml] Fix and simplifies FillRDVisitor, other minor refactorings

* [XamlC] Fix RD inflating
2017-09-25 08:52:03 +02:00
Stephane Delcroix 62056766a4 [Xaml] no longer require a ServiceProvider for Trigger and PropertyCo… (#771)
* [Xaml] no longer require a ServiceProvider for Trigger and PropertyCondition

* fix
2017-02-27 09:33:23 +01:00
Stephane Delcroix c2a6bb05b1 [XamlC] complete the Setter/Trigger fix (#737) 2017-02-13 12:19:05 +01:00
Stephane Delcroix fa0882114d [XamlC] Produce correct mdb files (#699)
* [XamlC] change MockCompile (internal) API

* [XamlC] fix debugging in unit test project

* f

* [XamlC] update cecil to 0.10.0-beta1-v2

* beta2

* avoid method duplication

* [XamlC] force loading MdbReader and Writer

* [XamlC] force use the writer in the other task too

* [XamlC] fix test and test code generator

* try building this

* [XamlC] Ensure InitializeComponent is correctly routed

* fix
2017-02-02 10:57:50 +01:00
Stephane Delcroix ca7f2caf57 [XamlC] allow xml-elements as Setter/Trigger Values (#684) 2017-01-25 15:09:54 +01:00
Stephane Delcroix c34016dc84 Xamlc compile data triggers (#648)
* [Xaml] DataTrigger and PropertyCondition no longer use a ServiceProvider

* [XamlC] avoid generating ServiceProvider for unused ProvideValue

* fix tests
2016-12-23 10:21:30 +01:00
Stephane Delcroix 859b058874 Xamlc compiled trigger (#629)
* [XamlC] compiled Trigger

* remove file header

* name bool parameters
2016-12-14 13:50:15 +01:00
Stephane Delcroix d4792dc98d [XamlC] Allow compilation of IValueProviders (#622)
* [XamlC] Allow compilation of IValueProviders

`IValueProvider`s tagged with the appropriate attribute will be bypassed
and the compiled version, if found, will be used.

This first version contains a compiled version of Setter's
IValueProvider and it already reduces the amount of generated IL by 39%
in, e.g. StyleTests.

It's a huge gain because XamlC no longer have to generate
ServiceProviders for those, so the methodbody is smaller, takes less
time to jit, less time to execute and nothing is invoked at runtime,
which probably saves a tons of time as well, as most IValueProvider
implementation heavily uses reflection.

* name bool parameters
2016-12-14 13:25:42 +01:00