Expression Blend 3 will not allow you to edit templates for Silverlight Toolkit November 2009

by Hayley 12. February 2010 14:25

If you are using Expression Blend 3 to try and modify templates for controls in the Silverlight Toolkit such as the accordion and grid splitter in Expression Blend you may get an issue where you go to edit the template but the only option available to you is “Create Empty”. 

This seems to be because Expression Blend by default uses the toolkit control dlls that are in

%Program Files%\Microsoft SDKs\Silverlight\v3.0\Libraries

These files appear to cause this issue with the latest version of the control toolkit. To fix this problem just update the Libraries folder with the latest versions of the toolkit dlls.

Tags:

Windows Mobile Obituary (Why I’m getting an iPhone)

by Hayley 11. November 2009 13:12

Oh Windows Mobile it was fun while it lasted. I still remember the first time I set my hands on a copy of you running on a HP iPaq. I wasn’t even out of university and you were there, you and the .NET Compact Framework 1.0. What a dynamic duo you were, doing so many things your competitors’ weren’t. A simple managed way to write and deploy applications, a touch screen. Well not finger touch unless you had tiny fingers. But with a stylus for business applications you were amazing.

Unfortunately, your time is over. A new competitor has killed you. If only you’d had a slick easy to use interface. Skinning you just wasn’t the same, your ugly exterior just kept coming back, and one year after I brought what will be my last version of you you still have the same old nasty interface that I still need a stylus to use. WHY! *sob*

You could have been the best, a system that gave me all I asked for. Exchange support YES! A dedicated development network YES! (now NO!), applications that I want to use. It was all there in front of you, you had the market in your hands, but you wasted it.

Now you have tried to play catch up, but it just hasn’t worked. An app store, what a great idea, a shame that the small number of apps that are on there cost sometimes 4-5 times what your competitor’s applications do. A ‘re-skin’ that your hardware partners are not going to configure for their older hardware. What’s the point? It’s just a shiny overlay over the same old ugly you.

And now you aren’t even playing nice with the hardware I have. Touch support keeps going missing. A serious problem as I have no other way to interact with you and when I reconfigure you still cannot get it right. When I compare you with what I can have you are sadly lacking.

In fact I don’t even know if I’m going to miss you.

Tags: , , ,

Rant | Windows Mobile | iPhone

SilverlightFX and ISM (Silverlight Toolkit)

by Hayley 10. November 2009 08:59

Theming is a pain. There are multiple ways to theme an application, that revolve around two main methods. Use the Silverlight Toolkit and ISM or use a system that inserts the correct resources from a theme file into the application resources using XamlReader.Load at application start time.

Both of these methods have drawbacks. With ISM controls are implicitly styled. If you style a combo box, all combo boxes in the application are styled the same way. Great! But what if you need to explicitly style portions of your application or use a brush resource that can change dependent on the theme? Normally you would place these resources into your application file, access them using StaticResource and go. This means you lose your theming for application wide resources when they are explicitly styled.

The solution:

For me I needed the best of both worlds. The ability to quickly change themes using ISM, but also the ability to be able to theme components of the system using explicit styles. I already use SilverlightFX as it contains an effects library and a framework for MVVM, but it also contains a theming system .

It’s easy to integrate the two solutions together.

Create the grouped theme files

SilverlightFX uses a Themes folder to maintain all themes for an application. Setup a theming application for SilverlightFX as explained in Nikhil Kothari’s Silverlight FX theming post. The SilverlightFX theming can then be used for any theming that requires an explicit StaticResource. Make sure you set the build action on all the files in this folder to ‘Content’ not ‘Page’, even though Nikhil’s blog states that I missed it more than once.

image

Add the Silverlight Toolkit themes to the SilverlightFX theming project

Now you need to add the theme files from the Silverlight Toolkit into your solution. Using the Xaml and not the DLLs means that if you need to add a new custom control to the ISM theme you (or your designer) can easily modify any implicit styles that already exist.

First copy the Xaml files from the Silverlight Toolkit project into the correctly named folder in the Themes folder. I suggest you rename the Xaml to remove the toolkit namespace, it makes it easier to find the theme you want.

So you now have the files for both systems in folders.

image

Now you have the files for the toolkit in your system, but no way to get the application to use the correct theme from both at the same time. If you are loading your theme dynamically on start up from your initparams then only the SilverlightFX theming will be working. I get the theme name from the SilverlightFX setup and then use binding to apply that same theme name to the ImplicitStyleManager. I use a class that gets the theming from SilverlightFX and then exposes that as a resource in App.xaml (it’s not theming related and therefore should live in the application resources)

This property is loaded from a static string which accesses the ApplicationLifetimeObjects of the application class. So it requires the SilverlightFX ApplicationContext to exist.  (This is just the code from SilverlightFX that initially loads the theme in the ApplicationContext class, you can get it from there and see how SilverlightFX does it’s theming loads)

private static string theme;
      public string Theme
      {
          get {
              //Taken from SilverlightFX codebase
              string _themeName = ((ApplicationContext)App.Current.ApplicationLifetimeObjects[0]).ThemeName;
              IDictionary<string, string> _startupArguments = ((ApplicationContext)App.Current.ApplicationLifetimeObjects[0]).StartupArguments;
              string name = _themeName;

              if (_themeName.StartsWith("$"))
              {
                  string[] nameParts = _themeName.Split('|');
                  if ((nameParts.Length > 2) || String.IsNullOrEmpty(nameParts[0]))
                  {
                      throw new InvalidOperationException("Invalid theme name. Either the name must be a simple name, or must be in the form $<ThemeInitParam>|<DefaultName>.");
                  }

                  if (nameParts.Length == 2)
                  {
                      name = nameParts[1];
                  }
                  if (_startupArguments != null)
                  {
                      string selectedName;
                      string argName = nameParts[0].Substring(1);
                      if (_startupArguments.TryGetValue(argName, out selectedName))
                      {
                          name = selectedName;
                      }
                  }
              }
              else
              {
                  name = _themeName;
              }

               return "Themes/" + name + "/" + name + ".xaml";
          }
          set { theme = value; }
      }

I then can bind the ImplicitStyleManager on any page to this resource and implicit styles work as well

theming:ImplicitStyleManager.ResourceDictionaryUri="{Binding Path=Theme, Source={StaticResource params}}"
theming:ImplicitStyleManager.ApplyMode="OneTime"

To add a new theme for your application you can now create an implicit theme using ISM then add any explicit styles you need into the SilverlightFX theme file.

I haven’t got a sample application created for this yet, but I will in the next few days.

Tags: , ,

Silverlight

What an interviewer wants to see from a job candidate

by Hayley 29. October 2009 08:00

Currently at my work we are recruiting new staff. My role in this is to normally interview a candidate for their second interview with another of the more senior developers. To prepare for this we normally create a series of questions that are specific to the person we are interviewing, the results from their technical test and the responses from my boss at the first interview stage.

These are a few things that make candidates stand out or things that make the interviewing process more interesting and less scary for both parties (yes the interviewer is nervous too!).

  1. If you have your photo on your CV, please take it off. People are very likely to prematurely form an opinion of someone if they see a picture of them. The interviewer wants to form their initial opinion on the content of your CV, and your skills, not what you look like (only seems fair, as people make judgements based on how someone looks very quickly).

    Also if you are a girl working in IT, never have a picture on your CV, as some very dodgy recruiters in the UK are using fake CVs with nice pictures to get interest from companies, so having a picture in your CV makes your CV look like one of these fakes.  You don’t want to end up in the ‘not a real CV’ basket.
  2. Customise your CV to the job application. Maybe this can’t happen so much in the UK where recruiters spam your CV out to every company they can find. But if you can, even after you’ve been approached for an interview, send over a customised CV, and a covering letter.
  3. Don’t lie on your CV. Be honest about your skills. If you aren’t very strong in one area of the areas the job calls for, but you still want the job and you’re strong in other areas, show that in your CV. Be proud about the things you can do well, don’t just pad your CV with a list of technologies you have little experience with, trying to make your CV look like you are more widely experienced than you are. Identify and promote one or two things you and the interviewer can talk about for an hour. You will run into problems at the start of an interview if you’re asked a question about something you have no experience in.
  4. If you’ve finished University and you have a degree, no interviewer is interested in your high school results. If you are lacking content in your CV, add a description under each of your previous employers giving the interviewer a little more detail about what you worked on. Show the interviewer what excited you about your previous jobs.
  5. When you arrive at an interview, shake the interviewer’s hand firmly and look them in the eye. It shows confidence. I know that you’re nervous about the interview but the more confident you appear, the easier it is to get through the interview. Plus engaging with the interviewer from the start makes the interview easier for all parties.
     
  6. Always try to have questions to ask at the interview. If you are at your second interview, you’re a possible good fit for the company and they are taking the time out to interview you again. Telling the interviewer that all your questions have already been answered in the first interview implies that you have not considered the role further since the first interview. Don’t hesitate to ask for more information if something comes up during the interview. It makes you look even more interested in the role.

Hopefully this helps someone, I wish I’d been given some of this advice when I started out in the UK job market.

Tags: , , , ,

Interviewing

Blog comments using AJAX in Umbraco are live!

by Hayley 19. September 2008 08:53

I got blog comments with AJAX working today, took a bit of mucking around and I still have to do the styling for the comments.  But they are there so go nuts...

 

For those who are interesting in how I created it, I borrowed most of the code from Christian Palm's website.  This post of Christian's about AJAX and Umbraco was where most of the code came from.  I did implement an XSLT macro that allowed me to call the .NET class that generates the comment list HTML on the page, so that I wasn't duplicating HTML code. I hate having to track down multiple places to change code.

 

There are other links available to get information about using AJAX with Umbraco for blog posts the Umbraco forum AJAX post that discusses it is very useful.

 

Next on the list is the photography gallery.  I'm going to pull images from my Flickr gallery probably using the Flickr API.

Tags:

Umbraco and Live Writer gotcha

by Hayley 18. September 2008 03:48

I was having trouble getting Live Writer to work.  It worked fine on my test site (girlgeek) but the updates would not appear on my main site (www.girlgeek.co.nz).  I found the problem.  In my master page I had entered links for live writer to allow it to automatically configure for my blog.  But they were referencing the test site not live...  So remember to update these links if moving Umbraco sites from a test to a live environment.

 

<link rel="EditURI" type="application/rsd+xml" href="http://www.girlgeek.co.nz/umbraco/channels/rsd.aspx" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.girlgeek.co.nz/umbraco/channels/wlwmanifest.aspx" />

Tags:

Umbraco Day 1

by Hayley 8. August 2008 05:58

Well I've setup my own hosting, with www.openhost.co.nz (Awesome support btw! and great price!)

So I decided to install umbraco so that I no longer have to edit the content of any of my sites via the aspx directly.  So far so good, I'm using v4 beta currently so if I feel the need I can just use my existing master pages with a little bit of formatting.  The fact I'm going to have to refresh my xslt skills is a wee bit daunting, but I'll start posting howtos and any templates I create for Umbraco here, might as well share the love.

Tags:

Update on the camera

by Hayley 23. May 2008 08:13

I've ordered the 450D, but it's taking forever to arrive!  Pre-orders and waiting is just so annoying.  All I want to do is get out there and take some photos.

 

Technorati Tags: ,,

Tags:

Sushi Picker

by Hayley 23. May 2008 08:06

So, I've decided I need a new demo application.  Something that's fun and as with all demo applications, completely no use to anyone.

In that theme I've decided to build an application called Sushi Picker, based on two things.  We have sushi at work several times a week, and it always involves me being given several handfuls of money and lists of requests on small post-it notes.  Which makes it annoying to ask the ladies at our favourite sushi place what I want.  Not only that I have to then figure out what change everyone gets, and if they forgot to give me money how much they owe me or whoever paid for it.

The second reason is because I had a dream about it and in my dream it seemed like a cool idea.  Because I'm a geek and I'm like that :P

So I'll update how I'm going to do this later, but the general plan is that it'll be a Silverlight or WPF application that everyone can use to put in their orders, it can calculate how much the sushi is going to cost, and when the sushi comes back it can figure out how much is owed to me! (I may expand the idea so it can be used for other food types as well).  Before you ask 'Why don't you do this in Excel', I'm going to code it because it'll teach me some new .Net technologies, that I'm starting to fall behind in and I'll gather bonus geek points.

I'm going to finally attempt to use my WCF links that I posted in my very first post.

And as a final note I'm going to try and blog the whole process so I don't have to do it again at the end!  So wish me luck here we go...

Tags:

What to buy? - Cameras

by Hayley 8. May 2008 05:42

With moving to the UK in September, I've been looking at a new camera to buy, Nic for Christmas brought a Canon mini camera, but I want something a bit larger, the problem is I don't know whether to purchase a D-SLR or something smaller.  I've always been interested in photography, but never had the money to afford a decent camera.

 

Currently I'm looking at getting - Lumix FZ18 which has reviewed well and although it is not a D-SLR looks like something I could start with, and move up to an SLR at a later date.

 

Any ideas my 5 friends?

Tags:

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About Hayley

I'm a .NET developer, currently working in London. In my day to day work I'm completely interested in Silverlight and WPF development and most things C# that make my world easier. At night I play with website design and the Umbraco CMS.