CodingWPF

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  99% of gargoyles look like (MR_BASTARD)  
 To:  99% of gargoyles look like (MR_BASTARD)     
35512.12 In reply to 35512.11 
:|

some things never change
0/0
 Reply   Quote More 

 From:  THERE IS NO GOD BUT (RENDLE)   
 To:  99% of gargoyles look like (MR_BASTARD)     
35512.13 In reply to 35512.11 
Heh. No. They're like CSS on meth.

0/0
 Reply   Quote More 

 From:  Rich  
 To:  THERE IS NO GOD BUT (RENDLE)      
35512.14 In reply to 35512.1 
Have just finished a year-long WPF project and I absolutely adore WPF.

I love the fact you can do crazy things like embed a movie as the border of a textbox, or you can bind the Visual property of something as the visual of something else (eg, binding the visual property of a MediaElement as the visual property of a panel so it gives you a very efficient reflection of the movie playing - see below)

I LOVE WPF LOVE IT LOVE IT LOVE IT. Unfortunately, now I'm stablising some old code. .NET 2.0 WinForms. Lovely.... :-\

XAML code:
 
    <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"; xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"; Margin="0" Background="#FFC0C0C0">
<StackPanel Margin="34">
 
<MediaElement Source="C:\video.wmv" Width="300" Name="mypic"/>
<!-- <Image Source="C:\picture.jpg" Width="300" Name="mypic"/> -->
<Rectangle Height="{Binding ElementName=mypic, Path=ActualHeight}" Width="{Binding ElementName=mypic, Path=ActualWidth}">
<Rectangle.Fill>
<VisualBrush Visual="{Binding ElementName=mypic}"/>
</Rectangle.Fill>
<Rectangle.LayoutTransform>
<ScaleTransform ScaleY="-0.7"/>
</Rectangle.LayoutTransform>
<Rectangle.OpacityMask>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Offset="0" Color="Transparent"/>
<GradientStop Offset="1" Color="#77000000"/>
</LinearGradientBrush>
</Rectangle.OpacityMask>
</Rectangle>
</StackPanel>
</UserControl>
 


Just make sure C:\video.wmv is a valid movie file.

I also love the runtime-evaluation of binding. For example, you can bind to a property of type 'Object' and in the XAML bind to a property that may or may not exist at runtime:

XAML code:
 
    <TextBlock Text="{Binding ElementName=SomeObject, Path=MyProperty}" />
 


If it exists, it works, if not, it silently ignores it.

This is VERY useful. And she's quite hot: http://www.beacosta.com/blog/




Rich
Web: LostJohnnies.com
Email: rich [at] lostjohnnies [dot] com
MSN Messenger: dexta1984 [at] hotmail [dot] com
____________________________________________________

0/0
 Reply   Quote More 

 From:  THERE IS NO GOD BUT (RENDLE)   
 To:  Rich     
35512.15 In reply to 35512.14 
I love the Command model, with the CanExecute handler. No more fucking about with enabling menu items, toolbar buttons, keyboard shortcuts and all that nonsense. One check in one place and it's magically picked up by everything.

I created a DialogCommands class with OK and Cancel commands in it, and got them to automatically wire themselves up to Enter and Escape.

So much better than any other UI framework I've ever used.

0/0
 Reply   Quote More 

 From:  Rich  
 To:  THERE IS NO GOD BUT (RENDLE)      
35512.16 In reply to 35512.15 
Commands are pretty awesome.

I find constructing DependencyPropertys to be a bit faffy.

We've been doing a bit of stuff around amendability using XAMLReader.Load() which allows for really easy control injection.

I especially like the way you can specify assemblies in your imported XAML that the originating program has no concept of, and do your code-behind stuff in them. Really flexible.

I'm sold, can you tell? :)




Rich
Web: LostJohnnies.com
Email: rich [at] lostjohnnies [dot] com
MSN Messenger: dexta1984 [at] hotmail [dot] com
____________________________________________________

0/0
 Reply   Quote More 

Reply to All    
 

1–16

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats