Reputation: 88
I'm new to xaml and I saw the Avalonia framework and I really like it. but when I start some coding I want to make styles available in multiple files and since the official docs doesn't help, is there someone who can tell me how can I separate the styles and put them in a file?
Upvotes: 1
Views: 2382
Reputation: 3623
Just place your styles in a separate file and use <StyleInclude Source="/YourStyles.xaml">
See https://github.com/AvaloniaUI/ControlCatalogStandalone/blob/b6fe246293cde40a82ab57b56f1db2ce52ebe98d/ControlCatalog/App.xaml#L18 and https://github.com/AvaloniaUI/ControlCatalogStandalone/blob/b6fe246293cde40a82ab57b56f1db2ce52ebe98d/ControlCatalog/SideBar.xaml for example.
Upvotes: 2