Having Fun with Coding4Fun’s Windows Phone 7 Controls
Coding4Fun Windows Phone 7 Controls
I’m a big believer in having a hobby project as you can probably tell from the first sentence in my “personal webpage using Silverlight” article. One of my current hobby projects is to re-do my current WP7 application in the marketplace. I knew up front that I needed a “Loading” animation and a better “About” box. After starting to develop my own, I noticed a great set of WP7 controls byCoding4Fun and decided to use them in my new application. Before I go any further they are FREE and Open-Source.
Get the bits.
It is really simple to get started, just go to the CodePlex site and click the download button.
After you have downloaded it then extract it to a Folder and you will have 4 DLL files. They are listed below:
Now create a Windows Phone 7 Project and add references to the DLL’s by right clicking on the References folder and clicking “Add references”.
ProgressOverlay Animation
After adding the references, we can get started. I needed a ProgressOverlay animation or “Loading Screen” while my RSS feed is downloading.
Basically, you just need to add the following namespace to whatever page you want the control on:
xmlns:Controls="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls"
<Controls:ProgressOverlay Name="progressOverlay" >
<Controls:ProgressOverlay.Content>
<TextBlock>Loading</TextBlock>
</Controls:ProgressOverlay.Content>
</Controls:ProgressOverlay>
Bam, you now have a great looking loading screen. Of course inside the ProgressOverlay, you may want to add a Visibility property to turn it off after your data loads if you are using MVVM or similar pattern.
A Better "About Box"
Next up, I needed a nice clean “About Box” that looks good but is also functional. Meaning, if they click on my twitter name, web or email to launch the appropriate task.
Again, this is only a few lines of code:
var p = new AboutPrompt();
p.VersionNumber = "2.0";
p.Show("Michael Crump", "@mbcrump", "michael@michaelcrump.net", @"http://michaelcrump.net");<span class="Apple-style-span" style="font-size: 11px; line-height: normal; "> </span>
A nice clean “About” box with just a few lines of code! I’m all for code that I don’t have to write.
The InputBox
It also comes with a pretty sweet InputPrompt for grabbing info from a user:
The code for this is also very simple:
InputPrompt input = new InputPrompt();
input.Completed += (s, e) =>
{
MessageBox.Show(e.Result.ToString());
};
input.Title = "Input Box";
input.Message = "What does a \"Developer Large\" T-Shirt Mean? ";
input.Show();
PhoneHelper Class
I also enjoyed the PhoneHelper that allows you to get data out of the WMAppManifest File very easy.
So for example if I wanted the Version info from the WMAppManifest file.
I could write one line and get it.
PhoneHelper.GetAppAttribute("Version")
Of course you would want to make sure you add the following using statement:
using Coding4Fun.Phone.Controls.Data;
You can’t have all these cool controls without a great set of Converters. The included BooleanToVisibility converter will convert a Boolean to and from a Visibility value. This is excellent when using something like a CheckBox to display a TextBox when its checked. See the example below:
The code is below:
<phone:PhoneApplicationPage.Resources>
<Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
</phone:PhoneApplicationPage.Resources>
<CheckBox x:Name="checkBox"/>
<TextBlock Text="Display Text" Visibility="{Binding ElementName=checkBox, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter} }"/>
That’s not all the goodies included. They also provide a RoundedButton, TimePicker and several other converters. The documentation is great and I would recommend you give them a shot if you need any of this functionality. Btw, thank Brian Peek for his awesome work on Coding4Fun!
Like this article?
Post Comment
e4UeW5 online dating websites This actually answered my problem, thanks!
WzqU84 Hello! I simply want to give a huge thumbs up for the good info you might have here on this post. I will be coming again to your weblog for more soon.
dqCtVL Incredible! This blog looks exactly like my old one! It's on a completely different subject but it has pretty much the same layout and design. Superb choice of colors!
EtUIwr I have read a few good stuff here. Certainly worth bookmarking for revisiting. I wonder how much effort you put to create such a magnificent informative website.
NBvUCa I'm not sure why but this blog is loading very slow for me. Is anyone else having this problem or is it a problem on my end? I'll check back later and see if the problem still exists.
Xm0o4G Im obliged for the article. Much obliged.
HbWjhw Major thanks for the blog post.Really thank you! Awesome.
ZfZIhz Hey, thanks for the blog.Really thank you! Want more.
9pBSJN Enjoyed every bit of your article post.Thanks Again. Awesome.
FiZnyx Major thankies for the blog article. Will read on...
kQxM5e Looking forward to reading more. Great article post.Really looking forward to read more. Great.
GdG2EO Major thankies for the blog article.Really thank you! Keep writing.
9wf7cU Thank you ever so for you post.Really thank you! Keep writing.
qgKkse I appreciate you sharing this blog post.Much thanks again. Cool.
z5yaLs Major thanks for the blog post.Much thanks again.
I noticed that it's hard to find your site in google, i found it on 18th spot, you should build some quality backlinks to rank it in google and increase traffic. I had the same problem with my site, your should search in google for - k2 seo services - it helped me a lot
E536JZ Im obliged for the article post.Really looking forward to read more. Fantastic.