My name is Edward Tanguay. I'm an American software and web developer living and working in Berlin, Germany.

Notes Items

SILVERLIGHT NOTES ON ARTICLE created on Thursday, November 19, 2009 permalink
Notes On Article: Silverlight 4 Beta – A guide to the new features
I scanned this article by Tim Heuer when Silverlight 4 came out to get an idea of what is new: i.e., lots! Below is my list of what I'll be using.
  1. This is a beta release, no end-user runtime is available, no go-live license.
  2. Has links to 9 tools you need, hope its easier than installing the silverlight 3 beta was, but they seem to have fixed this: It is NOT necessary to install the SDK and developer runtimes again if you are using the tools installer.
  1. "With Visual Studio 2010, we finally have our designer surface back for Silverlight."
Printing Api
  1. Highly extensible model to enable you to create a virtual visual tree to print for the end user directly from Silverlight.
Right-click Event Handling
  1. We now enable the MouseRightButtonUp/Down events for you to attach to and handle.
Webcam and Micrphone Access
  1. With a few simple lines of code you can request permission to your users to leverage their capture devices and then capture both the audio and video.
Mouse Wheel
  1. Has APIs for you to handle MouseWheel events, you can attach this event handler to other items as well, not just ListBox.
Richtext Area
  1. Provides an editable text control that enables rich text editing: bold, italics, different sizes, etc.
ICommand Support On ButtonBase and Hyperlink
  1. Can now have Command and CommandParameter on Button and Hyperlink, for MVVM apps.
  1. Clipboard.SetText("Some text to save in the clipboard area");.
  1. <WebBrowser x:Name="MyBrowserControl" Width="800" Height="600" />, or fill elements with HTML using HTMLBrush.
  1. Out-of-browser can now run with elevated privileges (WPF-like).
Access To My Folders
  1. You can now have direct local file access to the users’ "My” folders, e.g. "My Videos" (on Mac: /users/username/Videos").
  1. Dynamic sheet = excel.ActiveSheet;.
Notification Window
  1. You can now create Notification Windows (toast) in out-of-browser apps.
Network Credentials
  1. (on WebClient) myService.Credentials = new NetworkCredential("someusername", "somepassword");.
  2. If your application is a trusted application (elevated permissions), then the requirement for a cross-domain policy file is no longer required.
Full Keyboard Input
  1. Any application in full-screen mode can now have full keyboard input for things like TextBox (e.g. for kiosk apps).
Word Ellipse:
  1. <TextBlock Text="France makes World Cup despite Henry controversy" TextTrimming="WordEllipsis" Width="120" />.
Drag and Drop:
  1. InstallButton.Drop += new DragEventHandler(InstallButton_Drop); also: DragOver, DragEnter, DragLeave, nice.
Element Name Binding
  1. This nice scenario from WPF now available in silverlight: <RotateTransform Angle="{Binding ElementName=slider, Path=Value}"/>.
  1. StringFormat now available: <TextBox Text="{Binding Path=PublishedDate, Mode=OneWay, StringFormat='MM-dd-yyyy'}"/>.
  2. <TextBox Text="{Binding Path=SomeBindingValue, Mode=TwoWay, FallbackValue=N/A}" />.
  3. <TextBox Text="{Binding Path=QuantityOnHand, Mode=TwoWay, TargetNullValue=0}" />.
SILVERLIGHT NOTES ON VIDEO TUTORIAL created on Wednesday, July 29, 2009 permalink
Notes On Video Tutorial: Silverlight 3 (Teil 2 von 10) - Out of Browser
This is an excellent quick demo (in German) of the most important features of out-of-browser (checking for network connection, installing with a button, checking if application is installed or not, etc.), using this video I was able to get my first out-of-browser silverlight application working in about 5 minutes, very nice, no problems with it, put my application on my website and viewed it with another computer which had to first install silverlight, worked well, impressed.
 > > >  watch video tutorial here, 28:00
  1. Users can install it without being administrator.
  2. Shows an example in the browser and then on the desktop, even a desktop icon.
  3. Right clicks on his application in the browser and selects "install SL3OOB as an application".
  4. Then closes them all and sees the icon on the desktop.
  5. Starts it again.
  6. Shows how to deinstall (right-click, remove).
  7. Works on Mac and Windows.
  8. Recaps the advantages.
  9. Says you can check where the application is running.
  10. You can do automatic updates.
  11. You can also check if there is a connection to the internet.
Decided To Upgrade My Computer To Silverlight 3, Expression Blend 3 So I Could Run the Demo
  1. Uninstalled everything that had to do with Silverlight 2 or 3 (about six items).
  2. Installed Expression Blend 3, but VS web developer couldn't open sl3oob project (probably sdk tools not installed).
  3. Opened it in expression blend 3, it loaded ok, ran project, but http://localhost:51493/Default.aspx shows a blank page, hmm.
  4. So went here to install silverlight 3 plugin in firefox.
  5. Successful, it says: The version of Silverlight installed is: Silverlight 3 GDR 1 (3.0.40723.0).
  6. Running demo again from expression blend, hmm, http://localhost:51493/Default.aspx is still blank.
  7. Ok but then went to http://localhost:51493/SL3OOBTestPage.aspx and got what he had in the demo.
  8. Impressive, worked very nicely, ok, so now to get visual web developer to work with silverlight 3.
  9. Yes, I right-clicked on a file in blend and it tried to open it in visual web developer but failed.
  10. Installing sdk tools, etc. for visual web developer.
  11. Installing the Silverlight 3 SDK it said that it was alreayd installed, ok, uninstalling visual web dev and then installing it again.
  12. Installing silverlight 3 tools.
  13. So after visual web developer had its tools (10 minute install), then everything worked, and when you start it in visual web developer, it starts on the right page (not as in blend).
  1. Says you have to change the manifest.
  2. Shows the manifest.
  3. Shows all that you can change, title, width, height, shortname, blurb for download, symbols, and GPU acceleration.
  4. Says you don't have to type this but can just edit the properties of the project.
  1. Is in visual studio.
  2. Rightclick properties, shows that it is not out-of-browser enabled, then clicks box and it is.
Testing This Myself
  1. Creating new silverlight 3 in blend.
  2. Make a 640 x 480 gradient with a button that changes text.
  3. interesting, I didn't specify the exact size and it didn't get it right:
  4. I specified the size in the properties and it got it right.
  5. added icons from, work well:
  6. Uploaded and put it here, works well, and checking with another computer: got the get microsoft button, worked, asked about an update, worked very easily, no problems.
Continuing Video
  1. Shows how to install without right click, instead: App.Current.Install().
  2. It cannot start by itself, the user has to actively start it.
  3. Shows an event Currnt_InstallStateChanged.
  4. shows show he can show the current state of the install:
  5. show how to find out where the application is running:
  6. Demonstrates this with the example.
  7. shows how to check for an update, nice:
  8. Makes a change, compiles, shows in browser that there is a new version.
  9. The update is automatic, very nice, you just click the button and you get it, nice.
  10. Then shows how you know if you have an internect connection.
  11. Looks at it in visual studio, on his laptop he pulls the wlan cable, wow, as soon as he pulled it, both applications showed that they were offline (e.g. for a green/red light), he plugs it back in and his wlan icon shows it is on and both applications show that they have a network connection.
  12. Then does a recap.
PRISM NOTES ON ARTICLE created on Saturday, July 25, 2009 permalink
Notes On Article: Composite Application Library in WPF Application
If you are building a Prism application and struggling with how to simply get modules loaded into menus which allows the user to click and bring up various modules, etc. Eugene Pankov has put together a very good basis application to study and build on. Here are my notes:
  1. interesting that his module controller removes the previous module and replaces it with a new one:
    private void DisplayModule(string moduleName)

            IModulePresentation module = TryResolve<IModulePresentation>(moduleName);

            if (module != null)
                IRegion region = regionManager.Regions[RegionNames.MainRegion];
                currentView = region.GetView(RegionNames.MainRegion);

                if (currentView != null)

                currentView = module.View;
                region.Add(currentView, RegionNames.MainRegion);
  2. interesting also that each main module file (e.g. DocumentsModule.cs) has an View property which is of type "object":
             /// <summary>
            /// A View associated with the module.
            /// </summary>
            public object View
  3. also interesting that he has module names as well (we ended up doing this in our project as well):
        public class ModuleNames
            public const string Documents = "Documents";
            public const string Users = "Users";
            public const string Security = "Security";

            public const string MainMenu = "MainMenuModule";
            public const string ModuleSelector = "ModuleSelectorModule";
            public const string ServerSelector = "ServerSelectorModule";
            public const string DefaultModule = "DefaultModule";
  4. He also has quite a bit going on in his code-behind e.g. in DocumentsView.xaml, here he publishes an event each time the view is activated.
  5. he uses the region.Activate() method which I haven't really understood yet, interesting:

                    IModulePresentation module = TryResolve<IModulePresentation>(moduleName);

                    if (module != null)
                        IRegion region = regionManager.Regions[RegionNames.MainRegion];
                        currentView = region.GetView(RegionNames.MainRegion);

                        if (currentView != null)

                        currentView = module.View;
                        region.Add(currentView, RegionNames.MainRegion);

                        if (serverContextService.CurrentServerContext != null)
                            // Save current module name
                            serverContextService.CurrentServerContext.CurrentModule = moduleName;
  6. He writes that the code-behind of the views contains no business logic, that all goes in the presenter code, but he does have layout management logic in the code behind.
  7. Then the module itself assigns the View to its own property View (takes it from the presenter).
  8. There is a MenuController in the Shell project, which is very similar to ModuleController described above. Its purpose is to display menu views in the Main Menu Region in response to the MainMenuChangeEvent.
  9. his implementation of MenuController might solve the MenuItems with ObservableCollection issue, although wait, he seems to do menus manually in XAML:
  10. and he binds each of the menu commands manually as well (too bad, was looking for an example were menuitems are bound dynamically, where    modules can "bring and register their own menuitems"), but he doesn't seem to do this dynamically:
  11. and here's how he changes the skin, in SkinCommandController, interesting he has a SkinFactory:
PRISM NOTES ON VIDEO TUTORIAL created on Tuesday, July 14, 2009 permalink
Notes On Video Tutorial: Building a WPF Composite Application Series Part 9: Intro to Event Publishing and Subscribing
this is a good video showing a concrete example of using the EventAggregator, shows publishing and subscribing
 > > >  watch video tutorial here, 09:54
  1. Going to look at events that are part of the prism framework, i.e. communicating with events between modules.
  2. Creates a class called CustomerSelectedEvent in the Events directory and inherits from CompositePresentationEvents<Customer>.
  3. in the CustomerListPresenter, gets and publishes the event like this:
  4. then in CustomerDetailsPresenter, subscribes to the event like this, notice he injects the EventAggregator:
  5. Then adds the view to the region, runs and shows how it works just the same way but now with prism events.
PRISM NOTES ON VIDEO TUTORIAL created on Tuesday, July 14, 2009 permalink
Notes On Video Tutorial: Building a WPF Composite Application Series Part 8: Custom Commands and Non-Command UI Elements
shows how to use CommandBehavior from, seems to be the same at AttachedCommandBehavior by Marlon Grech which I think is more useful since it allows you to have multiple commands on one element (e.g. left and right click)
 > > >  watch video tutorial here, 07:36
  1. Will show how to show command functionality to other elements besides button, e.g. listbox.
  2. Says there is a CommandManager, but that is only code-behind.
  3. Says he got a class called CommandBehavior from, this is the same as AttachedBehavior.
  4. Says there are lots of different ways to tackle how to provide commands in.
  5. interesting that he hooks onto the SelectionChanged event, I've only done MouseDown, etc. so far:
  6. Shows how to handle this in the Presenter (this is all the same as doing the MVVM.
  7. Says that there are different ways to do this, says that this is all .NET events not Prism per se.
  8. Handles the event.
  9. interesting how in the event handler method he creates and passes new EventArgs:
  10. Runs it, the application still works (he took out his previous event handling code).
PRISM NOTES ON VIDEO TUTORIAL created on Tuesday, July 14, 2009 permalink
Notes On Video Tutorial: Building a WPF Composite Application Series Part 7: Intro to Commands
Shows basic commands, if you know DelegateCommands from MVVM template, this is basically the same thing.
 > > >  watch video tutorial here, 09:38
  1. Is going to "make the communication between view and presenter easier".
  2. Shows a master/detail list and shows that he has code-behind which does some logic but mostly just filtering.
  3. interesting: he has bound the IsSelected property of his ListBox with the IsSelected property on his viewmodel:
  4. seems to be handling events in his presenter with this code:
  1. Says it is easier to use with commands in wpf.
  2. Makes a refresh button.
  3. In CustomerListPresenter makes public ICommand RefreshCommand (get/set).
  4. Ok, this is basic DelegateCommands as you find in the MVVM template.
  5. Mentions Execute and CanExecute.
  6. Does this.RefereshCommand = new DelegateCommand<string>(this.Refresh).
  7. And the action of the command is in the Refresh method.
  8. Shows this with debugging.
  9. Shows how CommandParameter works, says you could even pass a TextBox, but in the example passes the filter text.
  10. Says the listbox does not support this, so will do this in the next video.
PRISM NOTES ON VIDEO TUTORIAL created on Tuesday, July 14, 2009 permalink
Notes On Video Tutorial: Building a WPF Composite Application Series Part 6: Working with Models
This is all in Visual Studio, interestingly instead of making only a ViewModel he makes a Presenter which has a view injected in its constructor and this Presenter has an ObserverableCollection property of ViewModels, haven't seen that Presenter/ViewModel relationship before. He says he will put commands in the presenter but not in the ViewModel.
 > > >  watch video tutorial here, 14:01
  1. Needs to allow the presenter to expose data to the view.
  2. This is going to be a mix of MVP and MVVM.
  3. Shows model which is just a very simple class.
  4. Says he could just pass in the customers to the presenter and have them pass them to the view, but what he is going to do is create a CustomerViewModel.
  5. This provides specific functionality for the view.
  6. Basically he is just wrapping everything.
  7. interesting: one of his properties is a string to an image resource:
  8. He isn't doing any INotifiedChanged though, ok finally does do this when creating isSelected for listBox and so inherits BaseViewModel.
  9. So now has both a Presenter and a ModelView which both inherit from two different base classes that handle INotifyPropertyChanged.
  10. So he seems to want to have Commands, etc. in the Presenter and have his ViewModel be more of a simple model, where in a purer MVVM-only approach you would have this all in one.
  11. Now he is in the CustomerListPresenter again and does a ObserverableCollection<CustomerViewModel>.
  12. Makes a PopulatePresentationModel() which gets model objects and creates ViewModels with them and adds them to the ObserverableCollection (basic MVVM).
PRISM NOTES ON VIDEO TUTORIAL created on Tuesday, July 14, 2009 permalink
Notes On Video Tutorial: Building a WPF Composite Application Series Part 5: Building a Basic Presenter
No powerpoints this time, just VisualStudio, builds a presenter base class then a customer presenter than inherits from it. Interesting how he handles the injection: the view that comes in is told that its presenter is the current presenter.
 > > >  watch video tutorial here, 07:23
Creates PresenterBase
  1. Starts in file customerListPresenter.cs.
  2. Creates PresenterBase.cs which all can inherit from.
  3. Hmmm, adds using NorthwinCRM.Views.
  4. Inherits INotifyPropertyChanged, IDisposable.
  5. Changes to "public class PresenterBase<TView>" (interesting, this is different than MVVM).
  6. Does the plumbing for OnPropertyChanged(...).
  7. Then also implements IDisposable.
Creates Presenter
  1. Goes back to CustomerListPresenter.
  2. Puts the injection in the constructor (ICustomerListView view, ICustomerService service).
  3. So it seems that this presenter is going to be able to handle various views which inherit from ICusomerListView.
  4. In the constructor, it tells the view that was pass in that its presenter is "this".
PRISM NOTES ON VIDEO TUTORIAL created on Monday, July 13, 2009 permalink
Notes On Video Tutorial: Building a WPF Composite Application Series Part 4: Intro to Views
Talks about the two types of MVP approaches (supervising controller and then the more MVVM-like presentation model). Then actually creates the classes for view and the presenter which returns a datacontext.
 > > >  watch video tutorial here, 09:43
  1. There are many flavors of using CAL.
  2. There are two recommended MVP approaches: (1) Supervising Controller and (2) Presentation Model.
Supervising Controller
  1. You have a view and you minimize the code-behind.
  2. you put a class between the view and the model call the presenter:
  3. The presenters job is to separater all responsibilities from the view, handles events.
  4. The presenter can work with different views, can swap out views (this is different than MVVM).
  5. There can be direct communication between view and model for simple data (ok).
Presentation Model
  1. the presenter "builds a facade on top of the model" which makes the most sense for this particular view:
  2. The main difference is that we don't want the view talk to the model.
  3. This seems to be more like MVVM.
Building MVP
  1. Starts with view.
  2. Creates interface called IView, just has DisplayName.
  3. Then creates interface ICustomerListView which he leaves empty for now.
  4. Then goes to presenters folders, creates CustomerListPresenter which simply returns.
  5. Then creates ICustomerListView and adds a property as CustomerListPresenter.
  6. It returns this.DataContext as ICustomerListPresenter.
  7. Interesting that the datacontext is returned from the method.

PRISM NOTES ON VIDEO TUTORIAL created on Monday, July 13, 2009 permalink
Notes On Video Tutorial: Building a WPF Composite Application Series Part 3: Intro to Modules
Creates a module with a view, then in the bootstrapper registers this module so that it gets displayed.
 > > >  watch video tutorial here, 13:38
What Is a Module?
  1. A module is a set of related views, business logic and resources.
  2. A module is a way to encapsulate related solutions.
  3. The shell is nothing more than a set of modules exposing their functionality.
  4. Modules are discoverable.
  5. Aids in the seperation of concerns.
  6. modules have three main parts:
How To Display Views
  1. View injection: modules go to registy and say "I'm looking for the toolbar".
  2. View discovery: modules register themselves to the container and tell the container which views it has, the shell service then can interrogate the container and find out which views are available, but modules can also communicate directly.
Adds Module In Visual Studio
  1. So now has a NorthwindCRM project.
  2. Changes the module class to NorthwindCRMModule (conventional naming).
  3. Implements IModule (which only has Initialize).
  4. Creates private readonly IRegionManager regionManager.
  5. Passes in IRegionManager manager in the constructor.
  6. Has a folder called Views.
  7. Creates a View (UserControl), just a TextBlock.
Shows How Module Gets Displayed In Shell
  1. in initialize() in NorthwindCRMModule, defines navRegion:
  2. now in the bootstrapper in GetModuleEnumerator: