[dba-VB] SCRUM/WPF - Buttons Styling Exercizes (StepN)

Gustav Brock Gustav at cactus.dk
Sat May 30 05:26:33 CDT 2009


Hi Shamil

That was much better! I'm convinced.
One more thing to add to the to-do list ...

/gustav


>>> Salakhetdinov Shamil <mcp2004 at mail.ru> 30-05-2009 11:06 >>>

Hi Gustav,

Yes, it looks like a lot of code but you can note that there are recurring blocks in it, which have just a few differences IOW they can be created by copy&paste. I'd also note that typing directly in XAML (when one knows what to type - I'm not yet that far there) woudln't be more time consuming and even probably less time consuming that using Expression Design: of course Expression Design would be useful to define the styles (and that work is more for graphic artists designers) but then those styles go to style dictionary of WPF application and one still better use direct XAML typing/XAML knowledge if onr plan to work professionally in WPF development...

And when styles are in a dictonary then the code for three buttons will become just several lines:

    <StackPanel Orientation="Vertical">
        <Button Style="{StaticResource specialButton}" Content="Foo" />
        <Button Style="{StaticResource specialButton}" IsDefault="True" Content="Bar" Margin="0,5,0,5" />
        <Button Style="{StaticResource specialButton}" IsEnabled="False" Content="Baz" />
    </StackPanel>

with a common for all WPF forms/pages/windows header and footer lines.

I'd also note that the styles we will make here for three buttons can be applied to all the buttons in many applications without any additional efforts just by referencing button's style from dictionary Style="{StaticResource specialButton}" ...

Not yet convinced?

Thank you.

--
Shamil

-----Original Message-----
From: "Gustav Brock" <Gustav at cactus.dk>
To: <dba-vb at databaseadvisors.com>
Date: Sat, 30 May 2009 10:20:00 +0200
Subject: Re: [dba-VB] SCRUM/WPF - Buttons Styling Exercizes (StepN)

> Hi Shamil
> 
> OK, that's a lot of code to write by hand to create three buttons - I'm not sure my patience will hold for writing code at this level, not when tools are available. I feel more comfortable using the native methods of Visual Studio. And still, the only reason I have Expression Design is because it comes as part of the web designer tools add-on to the Action Pack. The reason, I think, is because MS wishes to push Silverlight development. 
> 
> As for code behind xaml files, I have no idea.
> 
> Which ActiveX is needed, I don't know. But if I load your file in Chrome it pops an error box multiple times about a component not found. That component is xpcom.dll which doesn't sound like an ActiveX to me. However, if I search my Vista, no xpcom.dll is found so the message is true.
> 
> /gustav
> 
> 
> >>> Salakhetdinov Shamil <mcp2004 at mail.ru> 29-05-2009 23:48 >>>
> Hi Gustav,
> 
> I have created this code by hand - I have no Expression Design 2 here.
> 
> I'd guess Chrome, Safari and Opera will start support .xaml files rendering soon as recently FireFox 3.x have done: AFAIU rendering .xaml files is done by using something like ActiveX control - do you know which one?
> 
> BTW, what I do not know but (I'd hope that it should work) is how to use code behind with such .xaml pages? If create e.g. 
> 
> http://shamils-4.hosting.parking.ru/wpf/SpecialButtonStyleX.xaml.cs 
> 
> processing button click event then it will not run - it will be blocked because of security reasons - there should be possible I guess/hope to accompany such .xaml.cs files with special manifest files to have code behind enabled? 
> 
> Just wondering - if loading .xaml pages with code behind would be possible and also if it would be possible to have entry .xaml pages to call other ones located on server then that would be a way to make light .xaml (not XBAP) applications with .xaml pages loaded from server, compiled and run in demand...
> 
> Thank you.
> 
> --
> Shamil





More information about the dba-VB mailing list