unoplatform/uno

Remove reflection to Uno.Toolkit

Open

#782 ouverte le 17 avr. 2019

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)C# (837 forks)batch import
area/performance 📈difficulty/starter 🚀good first issuekind/enhancementlow-hanging-🍒no-repro

Métriques du dépôt

Stars
 (9 789 stars)
Métriques de merge PR
 (Merge moyen 14j 8h) (130 PRs mergées en 30 j)

Description

I'm submitting a...

  • Feature request

Current behavior

Currently some classes in Uno.UI are using reflection to access classes in the toolkit and interact with them. This is not extensible, and in some cases the dependency can be inverted.

For instance Android's NativeFramePresenter seek for the CommandBarExtensions https://github.com/nventive/Uno/blob/master/src/Uno.UI/NativeFramePresenter.Android.cs#L28 in order to update the visibility of the back button (https://github.com/nventive/Uno/blob/master/src/Uno.UI/NativeFramePresenter.Android.cs#L81).

Expected behavior

No cross-layer dependencies.

For the example above, the CommandBar could instead walk the tree to discover the Frame and register to the history change events to update the visibility by itself.

Minimal reproduction of the problem with instructions

N/A

Environment

Nuget Package: Uno.UI Package Version(s): irrelevant

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • Windows
  • Build tasks

Visual Studio: irrelevant Relevant plugins: none

Guide contributeur