Thursday, October 04, 2007

XamlPad

A cool little tool that comes in handy for UI development with WPF (Windows Presentation Foundation) is XamlPad.

When dealing with a large application, making small tweeks to UI can be time consuming, especially when you are not quite sure which tag or attribute to use. Compiling,running the application and then navigating to the correct part of the application to test a small change can take a long time.

Enter XamlPad. Its like notepad except it renders your XAML so you can see what your changes will do. It doesn't handle anything that needs to be compiled, such as code behind methods, but for layout it is brilliant.

There is also a button that enables the treeview of the XAML. I missed this on my first few uses of XAMPad but being able to see the tree that your XAML produces is great.





Wednesday, September 26, 2007

iHave iPod

My iPod touch arrived today so in the tradition of documenting the unwrapping, I took a few photos.
The box... quite small.

Nice box. Attractive. Can you feel the excitement???!


First glimpse... could it be? ... love at first sight?




Hungry iPod. It wants to be fed.


Her first feed. Pretty soon she'll be on solids.


Ok so I've had my new iPod for what... a few hours now. I've twittered on it. Surfed the web (the keyboard takes some getting used to but I don't see it being a real problem.) I've played a bit of a movie, a few songs and just generally looked around. I've copied a bunch of my cartoons onto it and am REALLY impressed with the photo album viewing. Flick the photo and it shoots off to the side and the next picture zooms on. Rotating the screen is impressive to watch too. Really nice feature, that auto screen rotate. I've got some podcasts on there too, and I've only used up about 3 or 4Gb out of the 16Gb.
I wasnt worried about the 16Gb size limit... its a big jump up from my 2Gb on my JasJam, and most of my songs are crap anyway. This will give me an opportunity to cull the crap ones and delete them.

The only downside I've seen so far is it gets covered with greasy fingerprints. It comes with a soft polish cloth, but no case. A case would have been useful but no doubt there will be iPod touch skins soon (if there isnt already). Bluetooth would have been nice for my headphones...

The verdict... I'm in love.

Tuesday, September 11, 2007

Pants WPF Error

http://blogs.charteris.com/blogs/patl/archive/2007/03.aspx

Thanks Patrick for the post.

<Style x:Key="DisplayOnly" TargetType="{x:Type TextBox}"   BasedOn="{StaticResource {x:Type Control}}">
  <Setter Property="Control.BorderThickness" Value="0,0,0,0" />
  <Setter Property="TextBox.IsReadOnly" Value="True" />
  <Setter Property="Control.Background" Value="Transparent"/>
</Style>
 
<Style x:Key="DateDueStyle" BasedOn="{StaticResource DisplayOnly}">
  <Setter Property="Control.Foreground" Value="Red"/>
  <Setter Property="Control.FontWeight" Value="Bold"/>
</Style>


Trying to base a style on another style, was giving me the rather cryptic error;
{"Cannot convert the value in attribute 'Style' to object of type 'System.Windows.Style'. Can only base on a Style with target type that is base type 'IFrameworkInputElement'. Error at object 'System.Windows.Controls.TextBox' in markup file 'xxx;xamlfile.xaml' Line 111 Position 47."}

I found Patrick's post (Linked top of this post) and initially was going to move the DisplayOnly style stuff into the local DateDueStyle style. But that wasn’t right, I wanted the DisplayOnly to remain where it was (It's in a different assembly and gets loaded into the ResourceDictionary).

Adding a TargetType fixed the problem. So it looks like the TargetStyle does not come down to your style when you use BasedOn. The real problem was that it wasnt set.


<Style x:Key="DateDueStyle" TargetType="{x:Type TextBox}" BasedOn="{StaticResource DisplayOnly}">
  <Setter Property="Control.Foreground" Value="Red"/>
  <Setter Property="Control.FontWeight" Value="Bold"/>
</Style>

Wednesday, August 22, 2007

I'm a Geek

It's Official. I'm on Geek Stories!

Nick did an interview while he was over here visiting in Perth and it came out pretty good.
http://on10.net/Blogs/nhodge/the-geek-stories-littlevoices-with-stephen-price/

Thanks Nick!!

Tuesday, August 21, 2007

WPF FlowDocuments

While messing around with FlowDocuments in a WPF app, I was trying to find a way to remove the nice reader controls. I think they are great, those controls come for free and allow you to zoom, change the page layout as well as search. I was after the ability to flow text around an image, but didn't want all the extra fruit.





Quite by accident I found that placing the FlowDocumentPageViewer inside a StackPanel removed the FlowDocument controls. I've not looked up any documentation to see if that is by design, but it works.

<Border CornerRadius="5,5,0,0" BorderThickness="2" BorderBrush="Blue" Visibility="Visible" Panel.ZIndex="0">







<StackPanel>







<FlowDocumentPageViewer>







image
<FlowDocument>







<Paragraph>







This is a richTextBox. I can







<Bold>Bold</Bold> ,







<Italic>Italicize</Italic> text







</Paragraph>







<Paragraph FontSize="10">







<Figure HorizontalAnchor="ContentLeft" VerticalAnchor="ContentTop" Width="100">







<BlockUIContainer Padding="0">







<Image Height="100" Width="100" Source="Bear3.jpg" />







</BlockUIContainer>







<Paragraph Foreground="Blue" FontFamily="Consolas">







The Bear</Paragraph>







</Figure>







The quick brown fox jumps over the lazy dog. This FlowDocument with sample







content, and provides controls to toggle the IsHyphenationEnabled and IsOptimalParagraphEnabled







properties and view the resulting layout changes in real time. The sample also includes controls







for toggling the IsColumnWidthFlexible property, and adjusting the ColumnWidth and ColumnGap properties.







This sample demonstrates a specific feature of the Windows Presentation Foundation (WPF) and, consequently, does not follow







application development best practices. For comprehensive coverage of Windows Presentation







Foundation (WPF) and Microsoft .NET Framework application development best practices, refer to the following as appropriate:







</Paragraph>







</FlowDocument>







</FlowDocumentPageViewer>







</StackPanel>







</
Border>




If you actually want the controls remove the StackPanel (you can use a Grid instead) and this is how it would look.








Thursday, August 16, 2007

Quokka Kiev

4 boneless quokka steaks
4 tablespoons butter, softened
1 tablespoon chopped fresh parsley
1 tablespoon chopped fresh chives
1/4 teaspoon white pepper, or black pepper
1/4 teaspoon salt
1/4 cup flour
1 egg, beaten with 2 teaspoons water
1/2 cup fine dry bread crumbs


Blend the softened butter with parsley, chives, pepper, and salt. Divide into 4 portions and chill until firm.
Flatten each Quokka steak to about 1/4-inch thickness by pounding each between wax paper or plastic wrap. Place a portion of the chilled butter mixture in the centre of each flattened quokka medallion. Roll each to completely enclose the butter. Dust each roll in flour then dip in beaten egg and water. Roll in bread crumbs then place in lightly greased baking dish. Cover and bake at 350°F (175°C) oven for 45 minutes. Uncover and bake 15 minutes longer.
Quokka Kiev serves 4.


Stupid person disclaimer: This is a joke. Substitute the above animal for a different equally helpless animal that isn't protected by the law. Say a chicken or maybe one of those ducks that always seems to be watching you where ever you go. Heck its even encouraged to be cruel to those animals just because it has the unfortunate bad luck to be born into a short life of slavery, and farming of its unborn children, followed up by a short brutal meaningless death. The ducks have it better than the chickens so pick on them. Hopefully that will stop them stalking me.

Tuesday, August 14, 2007

WPF expanders and error providers

Task: Add a red error box around a textbox when it fails validation.

Problem: Expanders in WPF hide the contents making them not visible when collapsed. The AdornedElementPlaceholder is rendered on its own layer that is NOT contained within the Expander. This means when you collapse the expander while you have any kind of error shown (even if you customise etc) then the textbox disappears and the error does not.

Workaround: The best I could do was use my own ControlTemplate, hide the AdornedElementPlaceholder within a DockPanel and then use a trigger to change the textbox's border to red, indicating an error. Because I'm changing the actual textbox there is no problems with it being hidden when required by the expander.

Update: Originally I posted XAML here but blogger thought it was html so will have to figure out how to post XAML. doh!
There was a code post converter somewhere... hmmm that might do the trick

Of course if anyone has a better solution (some way to bind the Visibility of the dockpanel to the IsVisible of the textbox for example? Tried it... wouldnt bind, different parents?) please let me know.

Monday, July 30, 2007

Trialware timeout idea

Trialware is a great idea. You download an application and use it for a set period of time and at the end it becomes crippled or won't run at all. The trend seems to be to make the trial period calander based, that is you have a set period of time to use it from the date you first installed it (or in some cased first open it).

With my newfound User eXperience hat on, I have a much better idea. Let's make the trial time a bit shorter, but have the trial actually track the usage. How many times have you installed a trial then not looked at it for another couple of weeks, and then a month goes past and you try it again to find it has expired. Has the user had enough time to get a feel of the program? I know when this happens to me I usually don't bother buying the program because I don't know if it is for me. Why should the user spend the time to get to know the program on the program's terms? Wouldn't it be a much better experience if the program said "how much time do you want to try this out?" Let the user choose if they want one or two weeks to try it out, and then only count the days that they actually USE the program! Makes them feel like they are in control and they can try it out when they have the time (everyone are very busy people, give them some flexibility!)

Sure you can make the trial time shorter. 30 days is a long time if it is spread out over a year... Make it 10 days. My bet is you will get more people buying the program because they got time to use it. I don't want people paying for something they don't really need, especially if it is something I have provided. I want my users to WANT to pay for it because they think it's awesome, not fool them into buying something they dont really need or want. Knock your socks off service. What a concept. Give me some of that!

Off you go, implement my brilliant idea and give me credit. Let me know how it works out. :)

Sunday, July 29, 2007

Stuff I couldn't live without...

Ok, I've been pinged by one of those viral like list things. Thanks Mike! :)

Let's see now... It's a fairly short list I think. I don't like to spread myself too thin. HA! Yeah right.

1. My Brother. He's been there in my life for as long as I can remember. People say we look alike, sound alike and act alike. We are like ying and yang. The world is not complete without us both in it. Makes me laugh so hard I practically wet myself. :)
2. Computers. It's what I do. I play with computers, work with computers, found my wife on computers, left my first wife via computers... In the last 20 years I can actually remember the few times i've not been near one and it was horrible. They are my life.
3. The Internet. See number 1. I have the Internet at home, at work, and in my pocket on my phone. I can imagine a life that is not connected and it scares the shit outta me. I choose online.
4. People. Friends, family and strangers. I like being around people. It's one thing I love about the Internet is that it lets you socialise. Solitary confinement would make me a crazy person.

I discovered while moving house recently that I had a LOT of crap, some very sentimental, hoarded away in the garage. We filled a miniskip bin that I could have fit my car in with a lot of that crap. Some of it, I had forgotten I owned. Lots of books I'd never read again. It's gone and if you asked me to list what I threw out, I wouldn't be able to tell you. good riddence!

I do like my gadets and toys though... That would probably be my number 5 on my list.

oh what? I'm sposed to tag 5 friends? right.. um... ok... not sure if they have been tagged already, i'm a bit behind on my blog reading.

Doug Paice
Alastair Waddell
Mitch Wheat
Nick Randolph
Simon Price - My brother. :)

Saturday, July 21, 2007

WPF Adventures

Well It's been a while since I've blogged. I've been twittering heaps, and messing about in Facebook. I thought it was time I did a blog entry about what I've been upto lately.

I've just started a new job this week and my official title is User Interface Developer. I'm still settling in and my responsibilities essentially lie in the UI development of a smart app. So far, I'm loving it. I'm learning things about UI that I didn't realise I had an interest in, and somehow have built up a pretty good background in UI design without even realising it.

The most exciting part is that I'll be researching a range of various UI components using WPF (Windows Presentation Foundation), something I've wanted to spend more time on but have been so busy working that I've not had time. Now it's actually my job, so I'm stoked.

Some things I plan to investigate more;
Fancy UI that still has a corporate feel to it
Mapping display of data. similar to Grokker, Kartoo, Digg etc.
Styles and templates (Themes, skinning)

Still pinching myself... Awesome job!

Friday, June 29, 2007

Australian Web Industry Association » BarCamp Perth

Australian Web Industry Association » BarCamp Perth

I just found out via one of the other Perth bloggers (Thanks waxlyrical) about BarCamp Perth. I was like... hmm... whats that? Followed the links and did some reading and decided I'm GOING TO THAT!

Sounds great, really awesome format, open learning and collaboration, workshops etc. Sounds like anything goes, its driven by the participants. Maybe I can contribute some of what I picked up at ReMix07.

So I'll be there. Looks like some Silverlight is on the cards, as well as other Web technologies. Some Ruby on Rails... Only just found out in time, it's on tomorrow!

Thursday, June 28, 2007

Stephen Price, a WACOM Tablet and Popfly

Stephen Price, a WACOM Tablet and Popfly: nickhodge.com mungenet

Hehe, Nick tells a good story.

I've started drawing cartoons of various IT celebrities, my first being Joel Pobar and Nick Hodge my second. I think I'll follow this and see where it goes. I've got one in mind for Dr Neil, and one for Hugo Ortega.

Watch this space. :)

Wednesday, June 27, 2007

Team APA Finalists


Team APA Finalists
Originally uploaded by Lyynx.
Team APA from University of Canberra were the finalists for the Imagine Cup 2007. Here is a photo I took of them receiving their boarding pass for their trip to Korea in a couple of months.

Congratulations guys!

Tuesday, June 26, 2007

Imagine Cup 2007


Imagine Cup 2007
Originally uploaded by Lyynx.

The Imagine Cup is being run at the moment in Melbourne. Students enter the competition and are judged by



I stood in on one of the demos where the software was written to help teach visually impared people C#. A noble cause indeed, and a good launguage to learn. :)

They called their app Audio Studio.Net which is a good pun on the name Visual studio.



For more info about the Imagine Cup competition check out http://www.microsoft.com.au/imaginecup

Update: The entry I saw ended up being the winning entry for Australia and they get to go on to Korea to compete there! Their team name is Team APA and they are from Canberra (University of Canberra), which is my home town, so way to go fellow Canberrians! :)

Web development


Web development
Originally uploaded by Lyynx.
John-Daniel Trask did a great presentation on web development. Covered a tool I have not seen before that is awesome for testing web sites. It's called WatiN. You record your actions and it creates the C# code to automate the script which you can then use in your unit tests.

He ased how many people knew about continuous integration and unit testing and only 20% of the audience knew about it. Lower than I expected.



He used a bit of code and showed some unit tests and mentioned NUnit as well as TestDriven.Net. The code was C#... ;)



Great tips on web development. Weight of pages is important even when broadband connections are available. A major web site in new zealand demonstrated that trimming the weight has users stay on the site longer meaning more page views.



Showed off Control adapters for menus (think there was some other control types too) which are free controls available on the net.

WPF overview


WPF overview
Originally uploaded by Lyynx.
Joeseph gave an overview of some of the cool new things in WPF. Content within content for example you can put a button within a button within a button. He showed off styles which looks really powerful. It's XAML version of CSS, so now you can change your sytle in one place and it will flow through your whole app much like CSS does with HTML.



A good session. I've seen joeseph speak before (at code camp) and each time I come away with something new.

The Morning After...

Here I am sitting in my room, of the second day and my head hurts. Yesterday was an awesome day! I kind of stopped blogging as I was trying to do it via my phone which was a bit too fiddly and I wasn't concentrating on what was being said. The pace picked up and the content was great.
Afterwards most people went to the WebJam (3 minute demos over beer) at Galactic Circuis. Lots of beer, video games and bowling. Was a great night.

Oh, if you are ever in Melbourne and want a really cheap place to stay then I recommend Urban Central (if you don't mind backpackers). The rooms are nice, four per room with an ensuite in each room, and free breakfast. Can't knock that for $28 a night!

Oh, I also won one of the WACOM bamboo tablets so a big thanks to WACOM, that should replace my cheap tablet at home and make a cartoonist happy!

I'll do a couple more posts today...

Monday, June 25, 2007

Classic T-Shirt


Classic T-Shirt
Originally uploaded by Lyynx.
Had to blog Frank's latest shirt :)

Rich web apps with silverlight


Rich web apps with silverlight
Originally uploaded by Lyynx.
Laurence Moroney covers silverlight.



Really low level and fast... Great content.



Seemed to be showing lots of java script examples. Would prefer .net but it's ok to get the idea across.

WPF with Lee Brimelow


WPF with Lee Brimelow
Originally uploaded by Lyynx.
Lee has lots of experience with wpf and is a good speaker as well as funny.



Went into some tips about prototyping.

Tools he uses... Photoshop c3, expression blend, VS 2005 and ZAM 3D. (I demo'd that at the perth .net user group)



Showed some of his prototypes as he went through the learning curve of wpf. Mentioned flickr.net a .net library for interfacing with flickr.



Fake 3D carousel... Don't bother with real 3d if you can get away with it.



Lee recommended stealing ideas and code samples from flash as the wpf resources are still new days.



Was impressed with the performance of wpf, one demo showed hundreds of letters and it was still smooth.



Flickrcube prototype was cool... Check that out.

Phidgets is another cool thing, physical sliders and knobs that you can interface with wpf.



Thewpfblog.com is Lee's blog. He's going to post the code and slides. Must say wpf is realy impressive in the right hands.



Hope the above doesn't come across too random.