wpf - Style breaks when x:Key is added -


under <window.resources>, have following style defined:

    <style targettype="textbox">         <setter property="height" value="22" />         <setter property="width" value="125" />         <setter property="horizontalalignment" value="left" />         <setter property="verticalalignment" value="top" />         <setter property="foreground" value="black" />         <setter property="background" value="whitesmoke" />     </style> 

it works fine until needed inherit style on style

<style basedon="{staticresource textboxstyle}" targettype="{x:type passwordbox}"> 

which means need add x:key=textboxstyle text box style above.
when this, styling text box breaks altogether.
tried doing same button styling, , same thing happens, style break if add key it.

the solution thought of individually add style elements, trying not do.

no, not need add x:key reference it:

<style basedon="{staticresource {x:type textbox}}" targettype="{x:type passwordbox}"> 

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 -