# Tuesday, April 06, 2010

Element to element binding was new with Silverlight 3.0.

To know more about it, I invite you to read this post from Jeff Prosise.

Some improvements are made in Blend 4 Beta and Visual Studio 2010 RC to improve your everyday work on this point.

The old way (Blend 3.0/Visual Studio 2008)

Suppose that you want to bind the value of a Slider to a TextBlock text :

In Blend 3.0, you must select the TextBlock, go into the common properties, select the Text property and the Data Binding in the contextual menu :

Once this is made, you must select the Element Property, browse the three to find the element and the property to bind to.

In Visual Studio 2008, there was nothing to help you to generate this simple XAML piece:

<TextBlock Height="32" Margin="8,0,12,8" VerticalAlignment="Bottom" Text="{Binding Value, ElementName=slider, Mode=OneWay}" TextWrapping="Wrap"/>

The new way (Blend 4.0 beta/VS 2010 RC)

In Blend 4.0, you still have the same option. But you also have a more friendly option with the new "Element Property Binding" option.

Choosing that item, you only have to select the element you want to bind to with your mouse :

A new dialog then opens to ask you which property you want to bind to :

In Visual Studio 2010 RC, you also now have now the option to work with the properties window to do the same thing.

Go to the Text property in the Properties window. Click on the small Value Source icon :

Select "Apply Data Binding"

In the dialog that appears, select an ElementName source, choose the slider :

Then in the Path, choose the property you want to bind to :

Tuesday, April 06, 2010 10:57:17 PM (Romance Daylight Time, UTC+02:00)
# Monday, April 05, 2010

After having installed the Windows Phone Developer Tools CTP and the Blend Add-in Preview/SDK for Windows Phone above my Visual Studio 2010 RC and Blend 4 Beta, I decided to port my Home Loan Application to Windows Phone.

This was quite easy to do.

This is currently a really raw application and the final result looks like that:

You can download this sample here

I don't know why but I had troubles with the out of the box PhoneSlider style :

It looks nice but it was impossible for me to work with it inside the emulator.

So I took the default style :

And I just skinned the button to change the square into a plain circle :

This last looked better to me!

Monday, April 05, 2010 10:32:20 PM (Romance Daylight Time, UTC+02:00)
# Monday, February 22, 2010

Once you've installed Office Web App on your Sharepoint 2010 Beta 2 (on a single server farm in my case), you may encounter the message "an error has occurred" when you try to open an office document in Office Web App.

Don't forget to activate the Office Web App feature on your site collections if you want to avoid that :

  • Go into the "Site Actions" of your site collection

  • In the "Site Collection Administration", select the "Site collection features"

  • Activate the "Office Web Apps" Feature :

And have fun with this very nice feature!

Monday, February 22, 2010 10:49:21 PM (Romance Standard Time, UTC+01:00)
# Tuesday, February 02, 2010

 

A few days ago, we had issues to connect to an Analysis Services 2008 cube from Excel 2007.

Imagine that you are in a Windows domain or workgroup and that you must connect to an Analysis Services on a remote server/server farm with its own workgroup or domain.

In our case, we are building something like software as a service (SAAS) platform for a client where the concerned cube is just one small part of all the services & software we've to build. To access the cube, we are currently using a VPN connection.

The first thing is that Analysis Services is relying on a Windows authentication to work, this is the only option we have:

http://msdn.microsoft.com/en-us/library/ms143708.aspx

It's not possible for us to create a trust between the remote environment and the consumer one. And one or two other data consumers may connect from other environments.

 

When trying to access the cube with XL 2007, we can thus forget the "Use Windows Authentication" as the user we are logged on with is not known by the remote environment.

But we can choose to enter the user name and password of a windows user on the remote platform:

For the user name, we tried the forms "User", "RemoteDomain\User", "User@RemoteDomain" when working with a domain, "RemoteServer\User", "User@RemoteServer", or with the IP replacing the remote server name when working in a workgroup.

The problem was always the same, XL shows this window :

Then, after choosing a cube or perspective, it takes very long time before showing the message "Initialization of the data source failed" :

No choice, you click the ok button and then a new dialog window (Multidimensional Connection 9.0) appears:

And only then you are ready to work.

This is of course really annoying.

So, after unsuccessfully playing with and without domain users, what did we do?

  1. We saved the connected workbook to reopen it later. We still had the very long waiting time and the "Initialization of the data source failed".
  2. We saved the XL connection to reuse it. We still had the very long waiting time and the "Initialization of the data source failed".
  3. We configure the HTTP Access to SSAS (http://msdn.microsoft.com/en-us/library/cc917711.aspx). This time, we didn't have to wait a long time to receive the "Initialization of the data source failed".
  4. To avoid the multiple windows and warning messages, we added the user and password to the Windows Vault of the Credential Manager of Windows 7 : http://windows.microsoft.com/en-us/windows7/What-is-Credential-Manager

About the Credential Manager, it's easy to find it in Windows 7 and Vista. In Windows XP, you can type the command: control userpasswords2

With the credentials managed by the credential manager, the user only has to type the URL of the SSAS and check the Windows authentication option.

Perhaps there are other ways to deal with these issues but we're happy to find this quick setup answer to deal with these.

Tuesday, February 02, 2010 11:08:20 PM (Romance Standard Time, UTC+01:00)
# Tuesday, January 12, 2010

Good news for RIA lovers : Silverlight is now really present in Sharepoint 2010!

Here is the message you may read if you go to the menu "More Options" of the Site Actions menu if you don't have Silverlight installed.

That doesn't mean that you can't do anything but here is how the options dialog looks like :

If you install the Silverlight plug-in, here is the new look of this dialog :

It's hard to show with a snapshot but this new presentation is really nice, with small animations and fluent navigation.

More than that, Microsoft added a new Silverlight Web Part. It has never been so easy to run a Silverlight application inside Sharepoint.

To use this Web Part, simply edit a Web Part page and add a new Web Part.

In the categories, choose Media and Content and then the Silverlight Web Part :

A new dialog will then appear asking for the silverlight XAP URL :

Enter the URL of a XAP (hosted in a document library, in the 14\TEMPLATE\LAYOUTS folder or anywhere else). In my case, I'll reuse a Silverlight XAP hosted in the IIS hosting my blog.

Here is the result :

Of course, you can modify the URL, appearance, layout and other stuffs in the editor part.

If time permits, I'll write another post about the new Client Object Model an how to use it in a Silverlight application.

Tuesday, January 12, 2010 10:26:22 PM (Romance Standard Time, UTC+01:00)