c# - UWP: styling the window buttons does not work on the close button -
in windows 10 uwp can style title bar , window buttons (windows chrome). not work on close button when use hover or click onto them. take following snippet:
color primarycolor = color.fromargb( 0xff, 0xff, 0x00, 0x00 ); color contrastcolor = color.fromargb( 0xff, 0x00, 0x00, 0x00 ); color semicolor = color.fromargb( 0xff, 0x7f, 0x00, 0x00 ); applicationview appview = applicationview.getforcurrentview(); appview.titlebar.buttoninactivebackgroundcolor = contrastcolor; appview.titlebar.buttoninactiveforegroundcolor = primarycolor; appview.titlebar.buttonbackgroundcolor = contrastcolor; appview.titlebar.buttonforegroundcolor = primarycolor; appview.titlebar.buttonhoverbackgroundcolor = primarycolor; appview.titlebar.buttonhoverforegroundcolor = contrastcolor; appview.titlebar.buttonpressedbackgroundcolor = semicolor; appview.titlebar.buttonpressedforegroundcolor = contrastcolor;
this should make buttons black red foreground (the icon). when pressed half red background should used.
works flawlessly min , max buttons - on close button background , foreground (and inactive version of it) display correctly. hover , pressed states fall default windows values.
refer following image. close button has red (the default one) , default white foreground when hovered over.
_
does have idea problem is? bug or doing wrong?
thanks in advance!
-simon
you're doing right, way right now. keep in mind still changing title bar styling based on user feedback, it's possible change. if want more control on aspects of title bar, consider building customized title bar using coreapplicationviewtitlebar.extendviewintotitlebar property. not sure if solve specific problem, though.
Comments
Post a Comment