Skip to content

Project Scope

Sven Erik Vinkemeier edited this page May 29, 2018 · 8 revisions

Goals

  • Provide WPF-style layout primitives including Grid, StackPanel and Border, supporting properties like Width, Height, HorizontalAlignment, VerticalAlignment, Margin and more

  • Provide additional building blocks

  • Render to HTML, mapping the layout properties to CSS (using grid/flexbox) (1).

  • Xamzor should be just a component library, not an entire app framework

  • Allow mixing-and-matching Xamzor components and "normal" HTML.

(1) CSS grid layout turned out to be too inefficient across all major browsers. I have seen layout passes taking >1 second for relatively simple layouts. That's why I'm currently moving to C#-based layout computations (with simple CSS absolute positioning) where I have full control over caching. A separate work-in-progress layout library, Layman, has emerged from this. Progress on Xamzor's migration to Layman is currently being made in branch "cslayout".

Non-Goals

  • Xamzor markup should not (and probably cannot) be 100% syntax-compatible to XAML. In many ways, Razor syntax is superior to XAML and we should embrace its flexibility instead of enforcing XAML idioms.
  • We don't want to replicate WPF/XAML features for scenarios that can be solved more elegantly in Razor (e.g. we don't need {Binding} or ICommand)

Open Questions

  • Where do we stop abstracting from plain HTML/CSS? For example, should Border.Background be of type string accepting any valid CSS value, or do we prefer strong typing with types like SolidColorBrush, LinearGradientBrush etc.?
  • Which "XAML concepts" are actually reasonable in Blazor and which are not? For example, would a dependency property system be useful or would it fight against the framework? Can we style Xamzor components using only CSS or do we need an additional higher-level styling system? What's the point of an ItemsControl if we can just use foreach to render a list of items?
Clone this wiki locally