SilverlightShow: Implicit Styles in Silverlight Comments Silverlight articles, Silverlight tutorials, Silverlight videos, Silverlight samples Argotic Syndication Framework 2008.0.2.0, en-US (Emil Stoychev) Re: Implicit Styles in Silverlight <p>In WPF you can inherit from implicit styles using BasedOn="{StaticResource {x:Type Button}}", will this work in Silverlight (I did implement a TypeExtension using the new markupextension.</p> weitzhandler Fri, 24 Feb 2012 01:09:16 GMT Re: Implicit Styles in Silverlight <p>Hi, cabronek,</p> <p>You are totally right, a default stype with <em>TargetType = "ButtonBase"</em> won't apply to a Button control. It is my fault. Thanks for clarifing that inaccuracy.</p> ppopadiyn Tue, 28 Jun 2011 10:58:53 GMT Re: Implicit Styles in Silverlight <p>Hi,</p> <p>A default style with <em>TargetType="ButtonBase"</em> won't apply to a <em>Button</em> or any other control inheriting from <em>ButtonBase</em>, because, as far as I know, implicit styles are applied only to the exact type specified in the <em>TargetType</em> property. So if you want to have a common style for all types of buttons (<em>Button</em>, <em>RadioButton</em>, <em>CheckBox</em>), I'd suggest creating a style for <em>ButtonBase with a key/name </em>and<em> </em>with all required setters and then creating empty (without setters) implicit styles for every type of button with <em>BasedOn</em> set to the style for <em>ButtonBase</em>.</p> cabronek Mon, 27 Jun 2011 17:30:29 GMT RE: Implicit Styles in Silverlight <p>Hi Kevin</p> <p>If you set the same property in the base and in the derived style, the value from the derived style will be applied.</p> ppopadiyn Tue, 29 Mar 2011 20:33:35 GMT RE: Implicit Styles in Silverlight What if based and derived both style having same property value? Kevin Tue, 29 Mar 2011 09:59:37 GMT RE: Implicit Styles in Silverlight OK. <p>Thank Mr. Ppopadiyn,</p> Kanthesha Murthy Mon, 21 Mar 2011 11:40:28 GMT RE: Implicit Styles in Silverlight Well, probably you can do that via procedural code. However i've never tried declaring styles in the code-behind. I prefer declaring styles in XAML. ppopadiyn Sat, 19 Mar 2011 20:13:43 GMT RE: Implicit Styles in Silverlight <p>Thank Mr. Ppopadiyn,</p> <p>Can we do it in C# code?</p> Kanthesha Murthy Fri, 18 Mar 2011 06:51:02 GMT RE: Implicit Styles in Silverlight <p>Hi <span id="ctl00_cphMiddle_ContentPlaceHolderContent_itemComments_dlstComments_ctl08_lblCommentAuthor">Kanthesha Murthy</span>,</p> <p>Unfortunately, you cannot specify more than one target type at once. However, what you can do is to set a base class for the TargetType. Thus, all controls that derives from that class will be affected. For example, the <em>Button</em> control derives from <em>ButtonBase, </em>and so does the <em>RadioButton</em>. So if you set: TargetType = "ButtonBase", that style will be applied to all controls that inherits ButtonBase. I hope you catched the idea. :)</p> <p>Regards</p> ppopadiyn Thu, 17 Mar 2011 15:03:31 GMT RE: Implicit Styles in Silverlight <p>Hi All</p> <p> I am new to I have a doubt I think I will get answer here</p> <p>My doubt is can we assign same width to many different controls using only one style? ie. can we use more than one</p> <p>TargetType values (TargetType="Button, TextBlock, ...") like this. so that If I change Width in one style it will affect all the controls Which I have listed in TargetType.</p> <p>Thanks in Advance.</p> <p> </p> Kanthesha Murthy Thu, 17 Mar 2011 14:54:34 GMT RE: Implicit Styles in Silverlight 4 <p>Hi ,</p> <p>Explained Nicely</p> GOPINATH Fri, 07 Jan 2011 07:34:30 GMT RE: Implicit Styles in Silverlight 4 How does one get text to wrap in a button control? LostInSpace Tue, 28 Sep 2010 22:48:36 GMT RE: Implicit Styles in Silverlight 4 <p>Hi Theo#</p> <p>I tried to use merged dictionaries and implicit styles, however without success. Obviously in this beta version of SL4, it doesn't work.</p> ppopadiyn Fri, 22 Jan 2010 10:52:43 GMT RE: Implicit Styles in Silverlight 4 Hi, is this supposed to work with merged resource dictionaries as well? I mean define a resource dictionary, include a merged dictionary and add a style based on a style of the merged dictionary. I can't make it work... Theo# Thu, 14 Jan 2010 14:51:59 GMT