unoplatform/uno

Remove reflection to Uno.Toolkit

Open

#782 opened on 2019幎4月17日

GitHub で芋る
 (1 comment) (0 reactions) (0 assignees)C# (837 forks)batch import
area/performance 📈difficulty/starter 🚀good first issuekind/enhancementlow-hanging-🍒no-repro

Repository metrics

Stars
 (9,789 stars)
PR merge metrics
 (平均マヌゞ 14d 8h) (30d で 130 merged PRs)

説明

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

コントリビュヌタヌガむド