Skip to content

Adaptive design in Avalonia #6130

Answered by maxkatz6
ParadiseFallen asked this question in Q&A
Discussion options

You must be logged in to vote

There is no any specific implementation like bootstrap window size breakpoint in Avalonia, but you are free to implement your own.

Previously I did simple approach with subscribing on Window.Bounds property changed and setting style class on the window depending on the width. And later this class was easily accessible from style selectors. You can move this subscription to some kind of attached property as well to reuse later.

@wieslawsoltes created behavior based on Behavior SDK (ported from UWP) which does the same, but in a bit convenient way. Example.

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
10 replies
@wieslawsoltes
Comment options

@amasidlovermedoc
Comment options

@stevemonaco
Comment options

@amasidlovermedoc
Comment options

@stevemonaco
Comment options

Answer selected by ParadiseFallen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants