CodingXAML

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  THERE IS NO GOD BUT (RENDLE)  
 To:  ALL
36241.1 
Working on a little personal project at the moment, and playing with WPF/XAML a bit more than I can at work. It's really rather good. I needed to create an animated timer, basically a circle with a line inside it that spins like a stopwatch hand. In any previous Windows GUI framework, that would have been a complete pain in the arse, involving GDI drawing and sin/cos tables. In XAML, it's half a dozen lines of declarative code, without any C# code-behind at all.

Happy now?

0/0
 Reply   Quote More 

 From:  99% of gargoyles look like (MR_BASTARD)  
 To:  THERE IS NO GOD BUT (RENDLE)     
36241.2 In reply to 36241.1 
That's because Bill Gates and Steve Ballmer love you so much and they just want to see you happy.

bastard by name, bastard by nature

0/0
 Reply   Quote More 

 From:  THERE IS NO GOD BUT (RENDLE)  
 To:  99% of gargoyles look like (MR_BASTARD)     
36241.3 In reply to 36241.2 
That makes up for Steve Jobs hating me.

Happy now?

0/0
 Reply   Quote More 

 From:  andy  
 To:  THERE IS NO GOD BUT (RENDLE)     
36241.4 In reply to 36241.1 
.....and the code is?
0/0
 Reply   Quote More 

 From:  Manthorp  
 To:  andy     
36241.5 In reply to 36241.4 
quote:
.....and the code is?


It translates as: Jesus is Audrey Tatou's great grandad.

"We all have flaws, and mine is being wicked."
James Thurber, The Thirteen Clocks 1951

0/0
 Reply   Quote More 

 From:  99% of gargoyles look like (MR_BASTARD)  
 To:  THERE IS NO GOD BUT (RENDLE)     
36241.6 In reply to 36241.3 
He doesn't hate you, he just doesn't think you're funny. Besides, he has a lot going on at the moment.

bastard by name, bastard by nature

0/0
 Reply   Quote More 

 From:  Manthorp  
 To:  THERE IS NO GOD BUT (RENDLE)     
36241.7 In reply to 36241.3 
It was no reason to eat his liver though, with or without Fava Beans.

"We all have flaws, and mine is being wicked."
James Thurber, The Thirteen Clocks 1951

0/0
 Reply   Quote More 

 From:  THERE IS NO GOD BUT (RENDLE)  
 To:  andy     
36241.8 In reply to 36241.4 
The code to draw the Timer is
XAML code:
<Grid Width="16" Height="16" Name="Grid" Margin="2">
  <Ellipse Stroke="#FF000000" StrokeEndLineCap="Round" StrokeStartLineCap="Round" StrokeThickness="1.5" Fill="#44FFFFFF"/>
  <Path Stretch="Fill" Stroke="#FF000000" StrokeEndLineCap="Round" StrokeStartLineCap="Round" StrokeThickness="2" Margin="6,3,6,6" Data="M48,24 L48,19.25" Name="Path">
    <Path.RenderTransform>
      <RotateTransform x:Name="Rotator" Angle="0" CenterX="1" CenterY="5"/>
    </Path.RenderTransform>
  </Path>
</Grid>
 


and the code to animate it is

XAML code:
<Storyboard>
  <DoubleAnimation Storyboard.TargetName="Rotator"
     Storyboard.TargetProperty="(RotateTransform.Angle)"
     From="0" To="360" Duration="0:0:4" RepeatBehavior="Forever"/>
</Storyboard>
 


OK, so a dozen lines. It's still a hell of a lot better than GDI.

Happy now?

0/0
 Reply   Quote More 

 From:  Voltane  
 To:  THERE IS NO GOD BUT (RENDLE)     
36241.9 In reply to 36241.8 
It's still a hell of a lot better than GDI.


NOD Rules!!!!

< /End Derail>
0/0
 Reply   Quote More 

 From:  THERE IS NO GOD BUT (RENDLE)  
 To:  Voltane     
36241.10 In reply to 36241.9 
Was that a C&C joke in my ever-so-serious coding thread? :{

Happy now?

0/0
 Reply   Quote More 

Reply to All    
 

1–10

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