xaml - Apply style for buttons in all Windows in WPF -


i have style setup in xaml creation of round corner buttons 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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -