8

Hi, I'm using WPF... I'd like to set the background col-

The solution:

Comments
  • 3
    wait. WPF (.net technology) and there are Java imports in the beginning. are you lying to us?
  • 5
    Image compression goes brrrr
  • 5
    Oh man this is so much simpler and shorter than Xamarin!
  • 1
    @iiii That's actually swift!

    I just grabbed a long file off GitHub to represent the enormous code footprint of just setting simple shit like background colors.
  • 1
    ?

    public SolidColorBrush Background {
    get {
    this.background = Colors.*;
    RaisePropertyChanged("Background");
    })

    Plus the XAML binding and implementing the INotifyPropertyChanged interface

    Not as bad as the picture? I abstracted the latter to a ViewModel class.
  • 1
    @donuts Background is an example (though, not a far off one. Changing the background color of a ComboBox is pretty much as long as the pic).

    Styling in WPF is either 1-5 lines or 30+ line bitchfuckclustershit
  • 0
    @AlgoRythm hm... looks like Combo has a Background property in the XAML so same thing?

    Honestly though I haven't used WPF/C# in a while...

    Work is all Java JS.

    https://docs.microsoft.com/en-us/...

    But yes I don't like doing frontend in general. For WPF, I just created a library with all the VM interface implementation classes and ResourceDictionary that I used for all my apps.

    Oh yeah for the backing fields my VM class just has a Dictionary<String, Object> and protected Get<>(), Set() methods.

    Dunno if the latest C# finally implemented those natively but never figured out why they didn't...
  • 0
    @donuts I think it's simple for a combo box, assuming that you need to do simple changes anything overly complex and you lose all the default aero look or whatever the current style default is for its generic look.

    As much as CSS can be a pain in web development at least it doesn't randomly decide oh you did something wrong? Here let me revert your input field to the default browser look....
  • 0
    @TestInProd423 hm... I recall you modify on top of the default style though?

    i.e. <Style Type=Button BasedOn="{StaticResource {x:Type Button}}"> ...
  • 0
  • 1
    I’m pretty sure changing the background color of elements in WPF doesn’t require this much code.
Add Comment