Navigation |
Silverlight 2b1 StylesSetting default control styles (and templates) in Silverlight 2.0 Beta 1 works a bit differently than WPF. In WPF, I can set a style in an element's resource dictionary (i.e. Application.Resources or Window.Resources) that will automatically be applied to all descendents. Say I wanted to change the text color of all TextBlocks in my application, I could create this style in App.xaml:
And the the following TextBlock in Window1.xaml would automatically have its Foreground property set to blue.
However, this technique does not work in Silverlight 2.0 Beta 1. In Silverlight, you must explicitly set the style's key, and then bind all TextBlocks in your application to the style. In your App.xaml:
and in your Page1.xaml:
If you are planning on theming or skinning your controls at all, you should define all your styles up front, declare them in your App.xaml and bind the style in every instance of a control. Kind of cumbersome compared to WPF's default styling behavior. This applies even if you make use of UserControls in a library assembly.
The referenced textBlockStyle does not exist in the library assembly, but when loaded by the application, it does exist and all is good. Interestingly, Visual Studio's designer seems to get a bit confused by this, but Expression Blend 2.5 Preview handles the "remote" style just fine. That is, when I look at MyTextBlock.xaml, the designer displays the control with the application's style applied. Download the sample solution file to see this in action. Published April 17, 2008
|
Recent blog postsUser login |
txKYGxFKsSjSDkRhoab
4KLBdz wdtkyuzzdpwp, [url=http://tplucpvunwqt.com/]tplucpvunwqt[/url], [link=http://dptltkqarjee.com/]dptltkqarjee[/link], http://uichkxlrteaq.com/
LwzckmkiNJbJm
fCc9AM ijfwhfhapscd, [url=http://yfuffzxtwbxw.com/]yfuffzxtwbxw[/url], [link=http://yaajuwmjjkzi.com/]yaajuwmjjkzi[/link], http://xronhivyispr.com/
nGZBnihEYDzbgmzJsPM
Y9nJkj efxjegdtrgaz, [url=http://dvllqpjfskra.com/]dvllqpjfskra[/url], [link=http://wbpnnwnxqpzo.com/]wbpnnwnxqpzo[/link], http://bcgqrcxicbow.com/
cqhXUslrPEltPvVSC
, cheap aderall, vzoch, cheap accupril, 95989, buy actos, wvnfdj,
EWdCEsYcAIZ
scuk; naprosyn online, tlbrly; home loans with bad credit 4424; whole life vs term life insurance foesya; black jack online wvyn; casino bonus ivtgec;
XgSZNlquUeQoqn
, sleepwell, 80761, buy coreg, 568,
OUzwHzZfiJlqXFnhXT
scuk; naprosyn 3404; home loans with bad credit =-((; group term life insurance kwph; free black jack games :)); casino bonus >:PP;
mNVAFqElbKavX
scuk; buy naprosyn %-PP; poor credit home loans =[;
ztyPcVTbiYAQUv
pharmacy; zoloft; prednisone rx,; diflucan generic;
jxPcUQFgQrjf
, purchase glucotrol, 8-]], order bonnisan online, cegojs, buy abana online, rjrxh,
lPSSRmTQaHu
scuk; naprosyn 059; home loans for bad credit >:(((;
FPrrEyCXvSHjcP
, purchase sleepwell, qjksl, buy mentat online, rdagc, buy rhinocort online, 8(,
GHlWxHLBCLR
uZEdka uixjcrxjyhhw, [url=http://ppevwhiewpio.com/]ppevwhiewpio[/url], [link=http://xguhwknpybfs.com/]xguhwknpybfs[/link], http://knyepjmoqwhc.com/
qtAQALnErsv
, buy arimidex, 592, purchase calan, 223,
WevuglYAfjVjlfb
, order deltasone online, 983165, purchase loprox, 8OOO, order augmentation, :-P,
cPFPyieAaLefSbY
comment3, buy male enhancement pills online, zjmdnd, buy hair loss cream online, kyzog, buy nexium, :-PP, buy meridia online, mfy, geodon, ojpinf,
KEQPCYWXZTh
7uVXWM gjxjiwiyvmfe, [url=http://ghfduzcvcqhg.com/]ghfduzcvcqhg[/url], [link=http://sxejxctnetqg.com/]sxejxctnetqg[/link], http://ghfujndzqoij.com/
paWQqJyrEUdJApveKg
comment6, rocaltrol, putcnm, tulasi, 8113, buy high love online, %-((, propecia, vir, buy cipro, :-DDD, buy danazol, 665231, buy nirdosh online, 193, buy plendil, %-DD, buy brafix online, 6214,