DCSIMG
September 2009 - Posts - Ariel's Remote Data Center

September 2009 - Posts

Managing WPF resources contained in external assemblies

Posted Sep 15 2009, 02:10 PM by Ariel Ben Horesh  

Here is a small how-to solution to a very common question.

Suppose I have separated my client application to multiple projects, and each project contains his own WPF resource dictionary, how do I use it?

Bottom line, you need to merge your resource dictionary to the application main resource, let’s see how to do that.

private static void RegisterResources()
    {
        ResourceDictionary dictionary = new ResourceDictionary();
        dictionary.Source = new Uri(
            "pack://application:,,,/[ASSEMBLY NAME];Component/[SUBFOLDER IF ANY]/[DICTIONARY NAME].xaml");
        Application.Current.Resources.MergedDictionaries.Add(dictionary);
    }

Note: the strange Uri syntax, every [] is a place holder for you to put in your specific information.

I usually use this method somewhere in my module entry point. (If using prism, the class which implement IModule is a good candidate).

Ariel

תגים:, ,

Tips for Good Presentation (and lessons learned from my IDCC talk)

Posted Sep 15 2009, 01:12 PM by Ariel Ben Horesh  

Well, one day after my talk at IDCC. I feel pretty good about my talk, not many people know that everything that was connected to this talk was prepared under 4 days. Presentation slides, Sample project, planning and so on. And I’ve never realized how many small details one has while preparing for this talk.

So few tips I’ve learned during this session making process, through the session, and after the session.

  1. Follow Scott Hanselman’s Tips, every each of his tips is valuable, I tried to follow his advice.
    1. http://www.hanselman.com/blog/11TopTipsForASuccessfulTechnicalPresentation.aspx
    2. http://www.hanselman.com/blog/TipsForPreparingForATechnicalPresentation.aspx
  2. Think of your session pre-requisites, in my session, WPF knowledge was a must. I, for example, have not made it clear enough.
  3. Run your session on you friends and colleagues, at least 3-4 times before. Practice on your jokes even. Have them review it, if they are in business. Make sure your message in correct Don’t give people bad advices.
  4. Make sure you can see the clock during your session, I’ve separated my talk on to 5 sections (each is 15 minutes) and wrote it on a paper which was visible as well. It helped my time orientation during the talk. I only needed to have 1 second glance at the clock and my 5 sections paper and know if I’m running late and speed up or I’ve plenty of time to slow down the pace, or take a few questions.
  5. Next tip, I’ve thought of this technique on my own and am very proud of it, I found it really useful during my session. Instead of live-coding by inserting snippets. Before the talk comment your code, cover it with a region of you don’t want to people to see it before time. Also use a //TODO: commend before each section. I also gave it a number. Now during the talk all you have to do is uncomment your code. I didn’t have to remember what is the sequence, it was already ordered in my Tasks view pane on Visual studio. I could easily navigate between projects quickly, didn’t have waste time looking for my files. FTW!

 image

For those who have attended my session, I would be happy to receive any feedback. You will just help me improve myself. Thank you very much!

Session materials such as slides and projects will be available soon.

Ariel