Dirkster99 / AvalonEditHighlightingThemes

Implements a sample implementation for using Highlightings with different (Light/Dark) WPF themes
MIT License
54 stars 9 forks source link

Demo unclear. #7

Closed Offline-R503B closed 3 years ago

Offline-R503B commented 3 years ago

Let me start of with saying I really appreciate your work for the community and the quality of your work.

That said I am having a really really hard time implementing this in a MVVM app that uses Catel MVVM. After several days of trying and today another complete day with no positive results , I am running into the following :

It seems we have to include textlib? but there is no Nuget for that.

The whole demo is polluted by the several side projects it uses in my honest opinion.

What I would love to know to use this lib :

1 : What is the MINIMAL implementation to only have one theme selected from this lib at all times? (To clarify I want avalon edit to use the darkmode VS theme and none other than that, no fancy theme along with the app theme just to apply the theme)

2 : What is actually required to use this lib.

My most important question is 1.

I would greatly appreciate if you can take the time to answer this.

Dirkster99 commented 3 years ago

Hi, I am sorry to hear its not a clear demo but you have to understand that this is not a simple matter - because, its not possible to answer all questions from everyone with one simple demo. Just imagine I did this with MahApps.Metro and then the next person comes along and asks me to do this with MUI ...

...and I could get the same quizzes about using an MVVM library like Catal, Caliburn.Micro, Castle.Windsor ...etc so, I chose to use no specific MVVM library here because I can very well implement MVVM without one and I used my own theming library MLib to implement the WPF theming.

My point on 1) is that we have to separate the UI theming (eg MUI) from Highlighting Themes, because any Highlighting Theme (light or dark) applied inside of AvalonEdit should be applicable for any WPF theme (via MUI or MahApps.Metro etc...)

Thats why there is a TextEditLib which themes the UI of the editor (eg ContextMenu) to come up with a matching light and dark theme in WPF AND Highlighting. The Highlighting being controlled by the NuGet package of course.

So, understanding this now you'll have to admit that TextEditLib takes care of the UI's WPF Theme but you will have to adjust this to your own WPF Theming depending on what WPF theme you are using. The Nuget package takes care of the highlighting but you still have to make sure its correctly configured and used in AvalonEdit.

2) The themed sample in this repository is a minimal sample for what you want to do. You just have to:

  1. Remove the possibility of choosing a light WPF theme,
  2. Replace the WPF Theme with a different theming (MUI, MahApps.Metro or whatever)
  3. and adjust the MVVM Viewmodel to View Association such that it will work with Catal...

and then you should have what you need :-)

Just ask me a specific question if you are not sure about s specific point, such as: How is the ViewModel associated with a View?

...and I could then try to explain any detail you may not see right way ....

Offline-R503B commented 3 years ago

Thank you for taking the time for the answer! ( And for the in depth answer. It really helps <3 ) This clears a lot of my confusion up too!

Thats why there is a TextEditLib which themes the UI of the editor (eg ContextMenu) to come up with a matching light and dark theme in WPF AND Highlighting. The Highlighting being controlled by the NuGet package of course.

You don't even want to know how wrong I was in what I thought TextEditLib was for. Lets just say I was far far off haha.

Maybe a simplified version of this text could be added to the readme?

Just ask me a specific question if you are not sure about s specific point, such as: How is the ViewModel associated with a View? ...and I could then try to explain any detail you may not see right way ....

Thanks will do , and again thanks a lot to explain it in depth.

Going to give it another shot :D