XAML Intellisense broken …

I do not know the complete cause for the broken intellisense in my Silverlight XAML editor. It could be installation of the windows SDK or the Latest MSDN but to fix it is relatively simple ..

Locate the TextMgrP COM library and re-register it. I located it at

C:\Program Files\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll


Regsvr32 “C:\Program Files\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll”

and intellisense should be back and operational

– Mark

Silverlight Cont …

I have been working more and more with Silverlight and really like what I see. There have been a few issues thus far that I have been able to get around;

1. When ever I make a change to my web service that the Silverlight application is calling I have to delete the service reference and recreate it or I get some strange errors on execution. I tried rebuilding the references but the errors would still occur. So Delete! Not a big issue now but I can see it rearing its ugly head when it came tome to deploy.

2. I created a user control that had 2 event handlers on it. In the consuming page when I subscribed to both events I would get a strange XML parse error. If I removed either handler attribute it would compile correctly. Since my control was a hack to see how things work I reworked the handler functionality to be more consistent and was able to work through this issue as well.


I am a windows developer at heart and though I develop for the web as well, I just like the flow of developing for the desktop. Silverlight seems to have bridged that gap for me and I am really impressed with this initial release.

I am also finding typing out the XAML by hand because of the Readonly designer a good thing as I am learning the underlying syntax and how the flow of things work.

– Mark

SLX 7.2.2 is now Gold

SalesLogix 7.2 SP2 went gold on Friday. This is the best release to date and brings the quality level up. The release is currently available to Beta partners but expect it to be available to your BP’s very shortly.

– Mark

My First Silverlight Success

So I got a little deeper into Silverlight this morning as I was initially discouraged with my initial introduction with Silverlight. Things seemed somewhat more difficult then I thought they would be and I was assuming that it was me more then the toolset.

My Goals

My goal was to create a simple search function that would work against a SalesLogix database through the provider. To make this happen I would need the Silverlight control, and a web service to provide the search data.

Starting off with the UI and moving backward I created the basic XAML to display a filter text box, button and a results grid.


All looked pretty good with the display and the resulting XAML is;

<Grid x:Name="LayoutRoot" ShowGridLines="False" Background="LightSteelBlue" Margin="2"> <StackPanel>    <StackPanel Orientation="Horizontal" Margin="2">

  <TextBox Width=”400″ x:Name=”searchValue”></TextBox>

  <Button x:Name=”Button1″ Click=”Button1_Click” Content=”Search” Width=”95″ Height=”30″ />


  <my:DataGrid AutoGenerateColumns=”True” x:Name=”myGrid” Width=”500″ Height=”180″></my:DataGrid> </StackPanel> </Grid>

Now that my layout was good. I ran the application to make sure that it displayed in the browser. All is good.

Web Service

Creating the Web service was not too bad. Standard ASP.net web service that was stubbed out as usual with the HelloWorld default method. 

I created a basic Account class to be a property bag to return up to my Client as follows;

/// <summary>

/// Summary description for Account

/// </summary>

public class Account

{    public string Name { get; set; }

    public string Phone { get; set; }

public Account()




The next thing I did was a new web method to get the accounts based on a value provided by the Client. Deciding to return a list of Accounts as I wanted to avoid any XML parsing on the client and it seemed the most natural way to access the data. The final code is


public List<Account> GetAccounts(string lookupValue)

{    SlxConnection conn = new SlxConnection("Dev64", "SalesLogix_Eval", "Admin", "Admin");

    List<Account> accounts = new List<Account>();

using (OleDbConnection connection = new OleDbConnection(conn.ToString()))



        string query = string.Format("select Account, IsNull(MainPhone,'') from Account where Account Like '{0}' order by Account", lookupValue);

        OleDbDataAdapter adapter = new OleDbDataAdapter(query, connection);

        DataTable table = new DataTable();


if (table.Rows.Count > 0)


            foreach (DataRow row in table.Rows)


Account account = new Account() { Name = (string)row[0], Phone = (string)row[1] };





return accounts;


Note that the SlxConnection class is nothing more then a specialized connection builder ensuring a proper provider based connection. You can use the actual connection string in the constructor of the OleDbConnection as well.

Adding the Service Reference

To access the web service I needed to add a service reference in the Silverlight project. I selected to add a ‘Solution based’ reference and when completed all of the proxy objects were created.

This step was the most confusing for me initially as I tried different ways to add a reference and most for me did not work. I finally was able to add the reference and use the Soap method to get the results I was expecting. Not that this is a problem with the implementation but with my current understanding on how everything works.

Wiring up the Search Button

Finally I was ready to wire up the search button. Every service call now seems to be ASYNC by default which is a good thing. So basically I new’d up instance of the AccountLookupSoapClient proxy that was created for me when I added a Service Reference.

ServiceReference1.AccountLookupSoapClient client = new ServiceReference1.AccountLookupSoapClient();

Next was to wire up the Async handler. Pretty simple type

client.GetAccountCompleted +=

And the ‘Add Event Handler’ auto complete starts, after hitting Tab, Tab and empty stub was available for me to add the code.

Then the code for actually making the WS call was added


Result Handler

When the Async call comes back the handler is called and on the UI thread so to populate the data in the grid all that was required was a check for an error and to set the grids ItemSource to the result.

The final code for the Silverlight page is;

private void Button1_Click(object sender, RoutedEventArgs e)

{    ServiceReference1.AccountLookupSoapClient client = new ServiceReference1.AccountLookupSoapClient();

    client.GetAccountsCompleted +=

        new EventHandler<TestingSilverlight.ServiceReference1.GetAccountsCompletedEventArgs>(client_GetAccountsCompleted);



void client_GetAccountsCompleted(object sender, TestingSilverlight.ServiceReference1.GetAccountsCompletedEventArgs e)


    if (e.Error == null)


        Account[] accounts = e.Result;

        myGrid.ItemsSource = accounts;



Run the application and Presto …


– Mark

Silverlight 2.0 SDK does not fully Un-install

I was having some strange IE blowups that seemed to occur after I Installed Silverlight 2.0. I decided to uninstall Silverlight and see if the issue was occurring because of it. After fiddling around a bit I discovered that the issue was occurring because of Flash.

So being still very excited to get into Silverlight I proceeded to re-install the SDK. I was promptly welcomed to ‘You cannot install because ..” message. Well I was able to install earlier and the only thing that changed was I had installed Silverlight before. Well I decided to to a no-no and go into the registry and folder structure and remove any reference to Silverlight, there were many. Long story short, after deleting all registry keys and a couple of folders I was able to install Silverlight again.

Be wary, uninstall does not actually uninstall.

– Mark

Reading helps …

In my earlier post I spoke of that problem that Silverlight 2.0 beta had with not allowing interactive support in the designer. I just finished reading a Blog by Scott Guthrie where he mentions this explicitly. So, the feature is not there yet, and I should not have griped about it :<

I also started to see strange crashes in my IE browser. Seem to happen around the same time as installing Silverlight, however found out that it was actually caused from Flash. As soon as I upgraded Flash to the latest version, crashes disappeared.

– Mark

Silverlight 2 First Impressions

I eagerly downloaded Beta1 of Silverlight yesterday anticipating the cool stuff I was going to enable. With the controls and web service functionality I believed that within a short time I would get something up and running.

So Downloading and installing was easy .. Not much of a problem here. I started up Visual Studio 2008 and created my first Silverlight Application. I reviewed the toolbox and saw all of the new controls available for me to write my application. I selected a button from the toolbox and tried to drag it onto the Canvas … Nothing, I double clicked the button, and again nothing.

It seemed for me, I would have to type in my XAML by hand. So I marched forward and started to code the UI. The fact that I cannot layout controls in the Designer is a big pain for me.

Another issue that I have is that the property browser just does nothing. I do not know if there is something I am missing in the install however all I can see is a label in the middle of the properties pane saying ‘Property editing not available.

I have been able to get some simple examples working but I honestly am not a big fan of having to type out reams of XAML to get something working.

My next steps will be to install Blend and see if that experience bodes a better design time experience.

– Mark