Oct
05

Blend 4 Crashes on Launch (“Blend 4 has stopped working”)

I had some trouble today with Blend 4 which was continuously crashing on launch, even after an uninstall and re-install of the program.

Thankfully, I found a very helpful forum post on MSDN which helped me fix the issue.

I have recently installed the Developer Preview of Visual Studio 11 and it turns out that there are some compatibility issues with version 4.5 of the .Net Framework with this preview release.

In order to fix the issue you can run the following commands in your command prompt (don’t forget to run as an administrator);

The workaround is to run:
%windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall “%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Framework.dll”
%windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall “%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Blend.dll”
%windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall “%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Project.dll”

If “%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.WindowsPhone.dll” is present (for scenarios like Blend V4 SP1 or future releases), please also run:
%windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall “%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.WindowsPhone.dll”

You can find the original post here….. http://connect.microsoft.com/Expression/feedback/details/690246/blend-4-crashes-on-startup

Hope this helps some of you out if you are having the same problem.

Technorati Tags: , ,

May
05

Telerik RadControls for Windows Phone 7 Giveaway!

Update: Entry for this contest has now closed and the winner will be announced here shortly!

Recently I have been using the fantastic RadControls for Windows Phone 7 by Telerik in my work on Windows Phone 7 applications.  The toolkit has been built from the ground up to provide controls and capabilities that are not currently available as part of the OOTB Windows Phone tookit.

There are some great components to this collection, including the RadDataBoundListBox which according to Telerik is “ the fastest version of the standard ListBox component”, which is a massive help when considering performance within your applications.  Having seen this control in action, I can honestlty say that it lives up to Telerik’s claims.  Other components include an Animation Framework, WrapPanel, DockPanel, Gauges and several other implementations of the ListBox.  For more information about the controls visit the Telerk RadControls for Windows Phone 7 page.

This really is a great product and now you have a chance to win a copy for yourself .  To enter just do the following (a quick thank you here to Michael Crump for starting his competitions as this prompted me to do this contest! Check out his blog if you haven’t already…it’s great!);

  1. Follow me on Twitter @garypretty and follow Telerik @RadControls
  2. Leave a comment on this post using a valid email address (these details will not be passed on to anybody!!).
  3. Tweet the following “I entered to win a copy of the awesome @Telerik Windows Phone 7 @RadControls from @garypretty. Enter yourself here http://bit.ly/mAtgzF #WP7″

This contest is now over. Lookout for another one soon!

That’s it! Pretty simple really and for those 3 simple steps you could win something great!

This will run for two weeks and the winner will be drawn on the 19th May 2011 and then announced on here shortly afterwards.  Good luck!

Technorati Tags: , , ,

Mar
06

Using the RADJumpList from Telerik for Windows Phone 7

jumplistA while back I downloaded the preview of the RadControls for Windows Phone from Telerik, a new set of controls built from the ground up to make the lives of developers creating apps for the platform easier. The list of controls that are included in the impressive pack include a Data Bound List Box, Date and Time Pickers, an Animation Framework and a Transition Control and this last week saw another beta release of the kit introducing more control goodness including the new Gauge control.
 
I will be writing another post summarising the whole kit soon, but for now I just wanted to quickly introduce you to the RADJumpList control which I have had the pleasure of using as part of an app I am working on at the moment.
 
The RADJumpList is essentially a list box control that allows grouping of its items in a snap and then allows the user to jump between groups easily.  A good example of a situation where you might do this is for a phone book / contact list where the items are group by the first letter in the contacts name, and this sort of functionality can be seen in the Windows Phone 7 OS as part of the in built contacts list.  However, grouping is not all that this control can do, as it also comes with built in support for sorting, filtering and great performance for the scrolling and display of the list right off the bat.
 
The thing I like about this control is the fact that all of the above features are optional and can be used on their own or in conjunction with each other to get the experience that you want.  As an example, you may want to simply have a list box that sorts its items for you and all you need to do to achieve this is to create a Sort Descriptor as seen in the code below;
 
GenericSortDescriptor<ItemModel, string> sortByField =
    new GenericSortDescriptor<ItemModel, string>(item => item.itemField);
radJumpList.SortDescriptors.Add(sortByField);

 

Grouping and Filtering with the control is done in a similar fashion using Grouping and Filtering Descriptors.

With regards to the look and feel of the control, it is of course totally customisable using templates in the same way as you would with an ordinary list box using an ItemTemplate for your list items and then editing other templates to control the display of components such as the Group Picker and the Group Headers.

If the RADJumpList sounds like something you could use or would find useful then I would strongly recommend you download the tools from the Telerik web site and check out the fantastic demo project included which features a full application for Windows Phone featuring all of the controls including the Jump List.  Keep an eye on on my blog in the coming days and weeks for more info about the Telerik Windows Phone tools (and for anybody who is interested in Sharepoint as well I will be looking at Telerik’s latest offering for Sharepoint 2010).

Technorati Tags: , ,

Oct
16

Christmas Presents App for Windows Phone 7

I have been incredibly busy the last few months and some of the things I have been working on are applications for Windows Phone 7.

Today saw the publication of the first of my applications to the Windows Phone 7 marketplace, Christmas Presents.

Christmas Presents is a simple but effective application that will allow you to manage all of your Christmas shopping, ensuring that you stay on top of which presents you need to buy, who they are for and how much you are spending.

Currently features include

- A summary including the overall budget, remaining spend and a countdown to Christmas.
- Individual budgets for each person.
- Mark presents as purchsed and then wrapped.
- Shopping list displaying all presents that haven’t been purchased yet.
- Currency automatically matches your phone settings.

If you have the Zune client installed you can see the Christmas Presents app page here.

Below are some screenshots of the application.  Please comments and let me know that you think and what features you would like to see included in future versions.

Summary Screen

Summary Screen

People List

People List

Person Details

Person Details

Shopping List

Shopping List


Again, please comment and let me know what you think and what features you would like to see in future versions.

May
19

Bing Silverlight Control with the Bing Web Service Application

After reading Carl Dickinson’s post on Mando Group Labs about the Bing Silverlight Control, I wanted to give it a try myself.

I decided to set about using the Bing Silverlight control to display available hotels from LateRooms.com.  LateRooms.com have an affiliate scheme that exposes the availability of hotels via XML feeds (you do need an affiliate ID to use the feeds but this could easily be replaced by any other similar feed).

You can view the sample app I have created here (note: LateRooms has mostly UK hotels so probably best trying a UK location, e.g. “Southport UK”). 

To create the app I create added four controls to my page;  

  • Bing Silverlight Control – This is obviously the main focus of the app.
  • A text box and a button to accept a location from the user and start the request to get the hotels.
  • A list box to display a picture, the name and the first line of the address for each of the hotels.

Once the user enters a location into the text box and clicks the button the following happens;

  • The location entered by the user is sent to the Bing Geocode web service and providing it can find a match it returns the lattitude and longitude for the location.
  • This map is then centred on this location.
  • Finally the newly returned coordinates are used to get a list of available hotels from the LateRooms XML feed. This list is then iterated through and a pin for each hotel is added to the map and the list is then bound to the list box.

Finally I added an event handler to the selection changed event of the list box to re-centre the map on the coordinates of the selected hotel.

There is plently more that could be done with this app, not least making the UI a little more attractive, but I wanted to just get a feel of how easy it was to implement some basic Bing maps functionality in Silverlight.

If you are interested to see the source code to the application let me know and I can post it.  Right now I am off to try some more experiments!

Don’t forget if you liked this, subscribe to my RSS feed and / or follow my Twitter (links at the top of the page).

Technorati Tags: ,

Apr
29

The Silverlight Masterclass!

The Silverlight Tour comes to the UK – and it’s called the Masterclass!

This 3 day hands-on training with both designer and developer tracks looks awesome and (uniquely) has two expert trainers per course. 

Currently scheduled in London, Manchester, and the Midlands for June, all courses also come with the chance to win an xbox 360, and Silverlight Spy licences!

Early bird discount of £100 if you book in May, and if you are a member of #SLUGUK or #nxtgenug there are additional discounts to be had.

Full Details are here: http://silverlightmasterclass.net

In addition bbits are holding a raffle for a free ticket for the masterclass. To be eligible to win the ticket (worth £1095!) you MUST paste this text, including all links, into your blog and email Ian@bbits.co.uk with the url to the blog entry.  The draw will be made on June 1st and the winner informed by email and on http://silverlightmasterclass.net

Technorati Tags: ,

Apr
08

Silverlight and Windows Phone 7 Link Post

With the recent announcements regarding Silverlight 4 and Windows Phone 7 Development, I thought I would share a few links to some sites I have found useful, both recently and in the past when starting to work with Silverlight and Windows Phone 7 dev using Silverlight.

Windows Phone 7 Dev

WP7 Panorama App  Â
http://blogs.claritycon.com/blogs/design/archive/2010/03/30/building-the-elusive-windows-phone-panorama-control.aspx

Twitter App Receiving Push Notifications on WP7   Â
http://skeevs.com/blog/?p=35

Push Notifications Types and a Tutorial Â
http://blogs.claritycon.com/blogs/design/archive/2010/03/30/building-the-elusive-windows-phone-panorama-control.aspx

Building a Flickr AppÂ
http://skeevs.com/blog/?p=4&cpage=1#comment-16

Bing Location Programming on WP7 Â
http://www.earthware.co.uk/blog/index.php/2010/03/writing-a-bing-maps-location-aware-application-for-windows-phone-7-series/

Windows Phone 7 Icon Pack  Â
http://www.sevenforums.com/news/74137-windows-phone-7-series-icon-pack.html 


General Silverlight

Silverlight 4 – A guide to the new features Â
http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx

Getting Started with Silverlight and Blend   Â
http://refcardz.dzone.com/refcardz/getting-started-silverlight?oid=hom20371

Silverlight UI ControlsÂ
http://www.silverlight.net/learn/tutorials/controls-cs

Silverlight Data Binding Â
http://www.silverlight.net/learn/tutorials/databinding-cs/

Visual State Manager  Â
http://www.silverlight.net/learn/tutorials/stylestemplatesvsm-cs/

Intro to BehaivoursÂ
http://www.kirupa.com/blend_silverlight/introduction_behaviors_pg1.htm

Technorati Tags: , ,

Feb
26

Multi-Select List Box in ASP.NET MVC

Recently I have been working on an MVC site using the Entity Framework. 

I have some related entities in my EF model, as show below in the form of “Reader” and “Category”, and the relationship between them, i.e. many to many.

When it came to proucing a view and action to perofrm the Create Reader action, I was somewhat puzzled as to how I could allow the user to select one or more categories for a reader. 

I started by having a view model that contained a list of all possible categories and then looping around these in my view and writing a check box out for each one.  When the form was submitted I looked through the form collection to find if any of the category check boxes had been selected.  I didn’t like this one bit and so I set out to find a cleaner way of carrying it out.

After some (quite a lot actually) searching, I stumbled accross the MultiSelectList type, which I could use in my ViewModel and then allow the default model binding to step in and do the leg work for me :) Great!

So, I created a view model, a simplified version of which you can see below;

    public class ReaderCreateViewModel : CustomViewModelBase
    {

        public ReaderCreateViewModel()
        {
            ReaderDetails = new Reader();
            CategoriesList = GetCategories(null);
        }

        public Reader ReaderDetails { get; set; }
        public MultiSelectList CategoriesList { get; private set; }
        public int[] SelectedCategories { get; set; }

        public MultiSelectList GetCategories(int[] selectedValues)
        {
            var te = new myEntities();
            List<Category> categories = te.Categories.ToList();
            return new MultiSelectList(categories, “id”, “Name”, selectedValues);
        }
    }

 As you can see from the code above, the view model contains my Reader entity, a list of type MultiSelectList, which is a list of available categories and an array of integers which represent the Id of any selected Categories.

Then to add a listbox to my view that will bind the MultiSelectList, I simply insert the following into my view.

            <p>
             <label for=”SelectedCategories”>Categories:</label>
        <%= Html.ListBox(“SelectedCategories”, Model.CategoriesList) %>
            </p>

Finally in my controller, I can simply check the SelectedItems object in my model for any selected Ids and add them to the Reader Categories list like this;

            if (model.SelectedCategories != null)
            {
                foreach (var selectedCat in model.SelectedCategories)
                {
                    int selectedCatId = selectedCat;
                    Category category = DataContext.Categories.Where(c => c.id                  == selectedCatId).FirstOrDefault();
                    reader.Categories.Add(category);
                }
            }

And that’s it.  Now there is probably a much better way of doing all or some of the above, but this worked perfectly for me when I needed it, so I hope it helps someone else out as well.  The final multi-select list box looked something like this;

Technorati Tags: , ,

Jan
12

ASP.NET MVC – Passing ViewData to a MasterPage

If like me you are using ASP.NET MVC for some of your web applications these days and use MasterPages within them, then you may have come accross the need to pass ViewData to the MasterPage.  For example, this might be for a dynamically generated navigation bar.

When I first started using MVC, I simply passed the ViewData required for the MasterPage along with every action, but even with a small site, this was a lot of code replication.

To solve this problem, we can create an ApplicationController class which inherits from the Controller class we all know and love.  Your applications’ controllers then in turn simply inherit from this new ApplicationController.

Below is a simple example of an ApplicationController.

namespace MvcSite.Controllers
{
    public abstract class ApplicationController : Controller
    {
        private MyEntities _dataContext = new MyEntities();

        public MyEntities DataContext
        {
            get { return _dataContext; }
        }

        public ApplicationController()
        {
            ViewData["categories"] = DataContext.Categories.ToList();
        }

    }
}

Hope this helps someone else as well. Certainly removed a headache for me!

Technorati Tags:

Oct
26

3 mobile broadband not working (“No Network”) on Windows 7…

Well, we moved into our new house this weekend….so I am pretty tired.  I cannot believe how much stuff we have managed to accumulate over a relatively short period of time!  So, now we are living in our very own building site. :)   The front room is currently made up of some scaffolding, two garden chairs and a TV (with Sky HD which got installed this morning…..got to get the priorities right people).

Because of the move, I currently dont have a landline and consequently, there is no broadband! I didn’t this that this would be a problem because I have borrowed a mobile broadband USB dongle from 3……not a problem that is until I plugged it in! 

Once I had plugged in the USB modem and installed the software, I simply got the message “No Network”, but the light on the device was green??  After several more tries of re-installing the device drivers and a few more ideas I decided to visit a friend a use their wi-fi to look for a solution. 

Turns out that if you want to use your 3mobile broadband device on windows 7, you need to download drivers BEFORE you upgrade!  Alternativly, if you are like me and are on Windows 7 already, you too can find a friend with an internet connection and download the updated Windows 7 Only drivers from Three here.

Technorati Tags: , , ,

Older posts «