xaml - Apply style for buttons in all Windows in WPF -
i have style setup in xaml creation of round corner button
s in wpf window. style apply buttons on windows in application.
is there way, similar css, put file , reference somehow in windows? or need copy , paste every time.
you use application resources that.
here's bit of code example (in app.xaml)
<application.resources> <style targettype="button" x:key="gelbutton" > <setter property="margin" value="1,2,1,2"/> <setter property="horizontalalignment" value="left"/> </style> </application.resources>
and then, buttons (for example):
<button height="50" width="250" style="{staticresource gelbutton}" content="button 1" /> <button height="50" width="250" style="{staticresource gelbutton}" content="button 2" />
hope find you're looking for.
Comments
Post a Comment