-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 ColorToSolidColorBrushConverter #4021
Implement ColorToSolidColorBrushConverter #4021
Conversation
Unfortunately, it doesn't even build on my machine. VS complains about net4.7 SDK missing (we use 4.7.2 for years) and VS doesn't show the csproj file. Neither can I change the SDK (combobox empty and disabled). I can't test without significant time investment and, to be honest, I've dropped the idea of using MahApps after some more obstacles. If you want to reproduce it: A simple trace listener looks like this public sealed class BreakDebuggerTraceListener : TraceListener
{
public override void Write(string message)
{
}
public override void WriteLine(string message)
{
Debugger.Break();
}
} and this is how you enable it for your application before startup: TraceSource dataBindingSource = PresentationTraceSources.DataBindingSource;
dataBindingSource.Listeners.Add(new BreakDebuggerTraceListener()); |
@nzain Can you say what other obstacles are you mean? |
@punker76 We have a large WPF desktop (framework) app and we have our own styles. Not really using themes, just basic WPF with a few changes to the defaults. We used a small fraction of Xceed's extended wpf toolkit comunity edition (one SplitButton, one ColorCanvas, a few NumericUpDown, many many BusyIndicator occurences). We always had problems with Xceed's toolkit and upgrading this nuget package always broke the AvalonDock for many versions and for different reasons every time. Thus we were stuck on a quite old version. As you may know, they've changed their license and that finally forces us to find alternatives. We've successfully migrated to Dirkster's AvalonDock fork (works much better). I thought MahApps could fill the remaining gap (ColorPicker, SplitButton, NumericUpDown), but MahApps heavily revolves around its own style (and it doesn't match ours). Try to use the |
Hi @nzain Thank you for providing this simple class. The debugger breaks if I enter an invalid color name but IMO this should be the case. All other binding issues seems to be resolved now. Let me say a few words to your other issues:
Thank you for clarifying this more as it sounded like "MahApps is total mess". 👍 Happy coding |
Sorry for that! I'll keep an eye on MahApps 👍 |
This should resolve the binding issues.
56a7456
to
12c11cb
Compare
@timunie your changes have been merged, thanks for your contribution 👍 |
Describe the changes you have made to improve this project
Implement a
ColorToSolidColorBrushConverter
because if we bind direct to aColor
we might get binding issues.Unit test
none
Additional context
This is an issue for some users but not for all.
@nzain can you clone my branch, attach your tracing-tool and give me a feedback if it works now for you as well? Thank you.
@seba30 if you enter a wrong color name I want to raise an error so the user gets notified that the value was wrong. So in this case the binding issue is wanted.
Closed Issues
Closes #4019