Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement styles for all Avalonia's controls #234

Open
9 of 13 tasks
SKProCH opened this issue May 21, 2023 · 5 comments
Open
9 of 13 tasks

Implement styles for all Avalonia's controls #234

SKProCH opened this issue May 21, 2023 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed up for grabs You can submit PR with implementation

Comments

@SKProCH
Copy link
Collaborator

SKProCH commented May 21, 2023

Since we positioning Material.Avalonia as standalone styles library we should add styles to all existing Avalonia controls.
Of course anyone can just reference FluentTheme before our theme and with ControlThemes it will work fine, but we should provide a basic support for all controls.

List of currently missing controls:

New files should be created in Resources/Themes folder and imported in MaterialToolKit.xaml.
All PRs and support are highly appreciated.

@SKProCH SKProCH added enhancement New feature or request help wanted Extra attention is needed up for grabs You can submit PR with implementation labels May 21, 2023
@SKProCH SKProCH pinned this issue May 21, 2023
@NoizeDaemon
Copy link

Could you elaborate on how to use FluentTheme as a fallback for missing or broken controls?

Right now I'm trying to get a CalenderDatePicker to work:

When I place fluent first, like so:

<Application ...
			 xmlns:themes="clr-namespace:Material.Styles.Themes;assembly=Material.Styles"
			 xmlns:icons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia" 
			 xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
                         ...

    <Application.Styles>
		<FluentTheme />
		<themes:MaterialThemeBase />
		<icons:MaterialIconStyles />
		<styles:MaterialToolKit />
    </Application.Styles>
</Application>

I get:

System.InvalidOperationException: "ControlTemplate styles cannot contain multiple template selectors."

When I place it last or in its own Selector (just for the CalenderDatePicker), everything becomes fluent...

How can I set it only for that specific control (or as a fall back if there's no material style for a control?)

(Btw, looking at fluent again after only working with this material for a while now, makes me really appreciate your work all over again! Beautiful design!)

@SKProCH
Copy link
Collaborator Author

SKProCH commented Jun 16, 2023

Hello, @NoizeDaemon. Thanks for the kind words)

As about your problem, i can just do this at my example project:

<Application.Styles>
  <FluentTheme />
  <themes:MaterialTheme />
  ...

And everything works fine. Can you provide a minimum representable example with your error, please?

@NoizeDaemon
Copy link

NoizeDaemon commented Jun 16, 2023

Here is the sample: https://github.com/NoizeDaemon/MS

It runs without <FluentTheme />, but does not show the CalenderDatePicker.

When putting <FluentTheme /> first, we get ControlTemplate styles cannot contain multiple template selectors.

When putting <FluentTheme /> last, it displays the CalenderDatePicker (& everything else in Fluent) - which is expected.

Edit:
I also tried variations of MaterialTheme and MaterialThemeBase, setting the theme in code/not setting, etc.

@SKProCH
Copy link
Collaborator Author

SKProCH commented Jun 16, 2023

@NoizeDaemon, I've commented a Calendar styles (they need a bit more polishing) and it works fine with latest nightly. Give it a try.

@NoizeDaemon
Copy link

Works now! :) Thank you!

SKProCH added a commit that referenced this issue Jul 11, 2023
SKProCH added a commit that referenced this issue Mar 31, 2024
SKProCH added a commit that referenced this issue Mar 31, 2024
SKProCH added a commit that referenced this issue Mar 31, 2024
SKProCH added a commit that referenced this issue Apr 1, 2024
Add styles for RefreshContainer, RefreshVisualizer, PathIcon, CaptionButtons, TitleBar #234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed up for grabs You can submit PR with implementation
Projects
None yet
Development

No branches or pull requests

2 participants