click tracking
Katrien's MSDN Blog - Site Home - MSDN Blogs
Posts
  • Katrien's MSDN Blog

    Live Framework – creating a Silverlight Mesh-enabled web application in 8 steps

    • 14 Comments

    After seeing what the new Mesh-enabled web applications can do during the last PDC in Los Angeles I couldn’t wait getting my hands on a token and creating something.

    First of all, if you have not yet been using Live Mesh signup for an account here: http://www.mesh.com/. This is the public beta so you can start using the client application and Live Desktop to synchronize and share data.

    In this post however, I’m talking about the developer Live Framework CTP which at this stage in on limited access. Read on… 

    In order to create your first Mesh-enabled project you need to install the Live Framework Tools CTP. You will be able to download this once you get your token.

    Silverlight Mesh-enabled web application

    1. I started by creating a new project of type “Silverlight Mesh-enabled Web Application”.

    image

    2. The Visual Studio template automatically generates two projects for this type of application:

    • A Mesh host project, this is the actual Mesh application (with a .meshproj extension for Visual Studio)
    • A Silverlight project, which will generate the XAP file to be included in the Mesh app.

     image

    At this moment the development experience is still not a fluent task: in order to debug your project you need to package it into a zip file and upload it to the cloud (manually). Once that is done the XAP file can be uploaded seamlessly by Visual Studio in order to debug remotely. Let’s review the steps to do this.

    Publishing the project in order to debug and test

    3. Developer portal, create the new project, choose “Mesh-enabled Web application”:

    image

    4. Once the project is created, keep the project details page open, you will need to get back to this page to upload the package and get the Application Self-Link further on.

    5. Back in Visual Studio, build your project. Building the project will generate a .zip file with the name of your project. The zip file contains the files from the host project (the .meshproj in Visual Studio) as well as the .xap file of the Silverlight project).
    Check the ProjectDir > Bin > Debug directory to retrieve the .zip file that was generated upon build. An easy way to get to the file system from within Visual Studio is by right-clicking on the project and choosing “Open Folder in Windows Explorer”.

    image

    6. Go back to the Developer portal and retrieve the project detail page. Click the Upload Package to upload your .zip file. This will deploy the Mesh-enabled web application and make it available on Live Mesh as well.

    image

    Once the package is uploaded you can click “Test Now” to try out your application on the Live Mesh site. Let’s not do that just yet.

    7. Uploading .xap file through Visual Studio.

    Back in Visual Studio, Press F5 to debug, this will launch the “Mesh publishing tool” from Visual Studio. Note: I’ve no idea if this is really called the Mesh Publishing tool, that’s just the name I’m giving to it. This popup will request you to upload the .zip file to the portal (which we have done in step 6). Copy and paste the “Application Self-Link” which can be found on the project’s properties page.

    image

    The XAP file will be published to the Mesh and once all these steps are completed your application will be launched in the browser. You may be required to login again.

    image

    8. Test your app and debug. The application will start launching the in on the Live Desktop, I set a breakpoint on the constructor and yes, my breakpoint is hit over the Mesh!

    image

    Breakpoint in Visual Studio:

    image

    The process of uploading the latest .xap to the Mesh happens at every time you debug the application. This is a good thing because it means you online need to go through the different steps once to upload the initial project. Visual Studio then does the work of uploading and deploying the new .xap file to the server every time you debug.

    image

    Note that throughout this post we are addressing the Developer CTP at developer.mesh-ctp.com, not Live Mesh in beta that is currently public.

    image

    This post does not yet use any Live Framework APIs or access any resources. That’s for another post where I will be saving some information to the Mesh and getting the offline and online experience.

    How can you get started?

    At his moment the CTP is limited, attendees of the PDC are one of the first to get tokens. But… I do have two tokens that I will give to the first two people replying on this post. Be quick and you might be able to start your own Live Fx & Mesh developments.

    And if you want to get ideas on all that’s possible with the Live Framework, there are several sessions worth watching from PDC: http://www.microsoftpdc.com/

    Start meshifying!

  • Katrien's MSDN Blog

    Expression Blend SketchFlow 4 integration with SharePoint

    • 14 Comments

    One of the new features that were just announced about Expression Blend SketchFlow 4 is the integration of SketchFlow projects with SharePoint. What does this mean? It allows you to publish SketchFlow prototypes to a SharePoint library and manage stakeholder feedback directly in the SharePoint library.

    Knowing that hosting the prototype and having your stakeholders send e-mails back and forth with feedback is not always straightforward, I think this is a really nice and useful addition to SketchFlow.
    Let’s have a look at how this integration works.

    For showing how this works I’m using one of the prototypes that comes with the Expression Blend 4 samples, in this case the "MockupDemonstration’ solution.

    image

    Once I’m ready to publish this SketchFlow prototype, I can choose “Publish to SharePoint…”

    image

    I’m using my personal SharePoint “My site” since I don’t have an external full SharePoint server available.

    image

    At this point the SketchFlow application is packaged and published in the “MockupDemonstration” folder on my site. After publishing the app I can open the library and and copy the link for distribution.
    When I browse to the SharePoint library I will get a new folder as requested, with a new sub-folder for this version of the project. Inside this folder you will find the .XAP file that contains the prototype as well as a TestPage.html.

    image

    As expected, opening the TestPage.html will load the associated .XAP file from the same folder. And that’s it: for hosting the prototype nothing more is needed.

    Integrating feedback

    SketchFlow’s SharePoint integration would only be half useful without the capability to integrate feedback.

    image

    Because the prototype is being accessed through the SharePoint library, uploading the feedback directly to SharePoint is also available as a choice in the player. After entering your initials, the feedback is uploaded to SharePoint. Several reviewers can give feedback which is all saved into the SharePoint library corresponding to the prototype version.

    image

    Content of the feedback folder:
    image

    The next step is getting that feedback into Expression Blend 4. To do this I activate the SketchFlow Feedback pane (if not visible, activate it by going to Window > SketchFlow Feedback). You will see in this pane that left to the + icon to load feedback files there is now a image  icon to refresh feedback from SharePoint. After synchronizing the latest feedback, Expression Blend will show you the details as you would get in Expression Blend 3, ordered by revision.

    SNAGHTML589416

    Further iterations will generate new versions on SharePoint and new revisions. This allows you to keep feedback linked to a certain version correctly structured in SharePoint.

    Have fun with sketching and SharePoint collaboration!

  • Katrien's MSDN Blog

    Different ways for loading images and files in Silverlight 2 applications

    • 12 Comments

    When loading files in Silverlight 2 applications, this can range from images, video, fonts, etc, there are several options available. You might want to call files that reside on another server, files that are embedded into the .xap application or zip files that are downloaded and unpackaged on the client. In this post I’m reviewing the different options available for this, differences between them and how to implement each of the options.

    As an example to load the files I’m using a UserControl with an image on it. A very simple example that is clear enough to show the different approaches. All of the examples I'm showing here have a XAML based approach with a code based counterpart, except for the sample for on demand download.

    Base UserControl

    <UserControl x:Class="SLLoadResourcesApproaches.Page"
        xmlns="http://schemas.microsoft.com/client/2007" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
        <Grid x:Name="LayoutRoot" Background="White">
            <Image x:Name="imageElement" Stretch="Uniform" />
        </Grid>
    </UserControl>

    This just displays the image, nothing more:

    image 

    Referencing files in the same directory as the Silverlight application (ClientBin directory )

    In other words, this is the default location of your .xap file, so files that are located in the same directory as the base application. By default when you create the Silverlight application with a test web site in Visual Studio this is the ClientBin directory. No extra code is needed to load files in this location.

    If the file is placed in the ClientBin directory, call the file in XAML:

    <Image x:Name="imageElement" Stretch="Uniform" Source="_DTH8643.jpg" />

    Or in code:

    imageElement.Source = new BitmapImage(new Uri("_DTH8643.jpg", UriKind.Relative));

    Note: for the above sample you can use a forward-slash preceding the image name to express that it is located relative to the .xap file (same directory in this case). This is important to not as here it is not the root of the domain name (absolute path) that is taken into account. Take this example where I have a sub-directory to ClientBin, I’m referencing the file as /images/imagename.jpg.

    image

    To reference the file in the images directory in the ClientBin:

    imageElement.Source = new BitmapImage(new 
    Uri("/images/_DTH8643.jpg", UriKind.Relative));

    First time I used this it caused some confusion as I'm used to referrring to files in the root of the domain in this way, not in a sub-directory, so it's important to note this difference with Silverlight.

    Copying files to ClientBin upon build in Visual Studio

    In the case you are using the files directly in your Silverlight application and don't want to copy them manually to the ClientBin directory you can set this in Visual Studio. Note this is a copy to the ClientBin directory of the Silverlight application project, not the test web project you may have created.
    Build action: None.
    Copy to Output Directory: Copy always.

    image

    Loading files located outside of ClientBin (.xap location) directory

    In the above screenshot I have an image files located in the "images2" directory. To load images from that directory I can enter the full URL of the image:

    <Image x:Name="imageElement" Stretch="Uniform" 
    Source="http://localhost:55907/SLLoadResourcesApproaches_Web/
    images2/_DTH8643.jpg"
    />

    In C# code:

    imageElement.Source = new BitmapImage(
    new Uri("http://localhost:55907/SLLoadResourcesApproaches_Web
    /images2/_DTH8643.jpg"
    , UriKind.Absolute));

    Referencing files on external web sites

    If you want to call images that reside on external sites you can use the standard download method by using WebClient. Remember that cross domain restrictions apply.
    Other than that it is just like calling images using the full URL like above.

    imageElement.Source = new BitmapImage(new 
    Uri("http://farm3.static.flickr.com/2013/2438725399_4fa3c6eb2f.jpg?v=0", UriKind.Absolute));

    There is however maybe a better way to load a file in from an external site where you can better control the loading of your file before showing it in the UI. By using the WebClient class you can download external files on demand, be it from the current origin site or external sites (see below notes on cross domain restrictions). Using the WebClient you can control what to display while the image or file is being downloaded using event handlers. This approach however is not available in XAML but only in code.

    1. Create a WebClient object, an OpenReadCompleted event handler and start the download process

    WebClient webClientImgDownloader = new WebClient();
    webClientImgDownloader.OpenReadCompleted += new 
    OpenReadCompletedEventHandler(webClientImgDownloader_OpenReadCompleted); webClientImgDownloader.OpenReadAsync(photo);

    2. Set the source to the image in the OpenReadCompleted event handler

     void webClientImgDownloader_OpenReadCompleted(object sender, 
    OpenReadCompletedEventArgs e) { BitmapImage bitmap = new BitmapImage(); bitmap.SetSource(e.Result); imageElement.Source = bitmap; }

    Referencing files included in application package (the .xap file, not the assembly)

    When you need your Silverlight application to be independent of any files stored on the server separately you can include everything into a single .xap file. The same applies to file that are integral part of the application. If you know a certain file is always used when running the application it makes sense to include it in the .xap file as there is no reason to download it separately. Including files to be part of the package is what we call Content files.

    Files that are packaged into the .xap file need to have the Build Action in Visual Studio set to "Content".

    image

    To call the file from XAML:

    <Image x:Name="imageElement" Stretch="Uniform" Source="/_DTH8643.jpg" />

    Calling from code:

    imageElement.Source = new BitmapImage(new Uri("/_DTH8643.jpg", UriKind.Relative));

    Because the files is located at the same level in the application package as the assembly in which the code is running, the forward-slash preceding the name is required here as well.

    Files can also be located in sub-directories of the application package. You will notice that the directories are also included in the .xap file (as they would in any .zip archive file).

    Application resources: calling files embedded in the application assembly (DLL)

    As with other .NET assemblies, files can be embedded into the assembly as resources. For Silverlight applications, set the file Build Action to Resource.

    image

    Referencing resources embedded into the assembly is implemented in the same way as loading files included in the application (.xap). The difference is they are added to the DLL and thus no longer visible in the .xap file if you unzip it. 

    In XAML:

    <Image x:Name="imageElement" Stretch="Uniform" 
    Source="/_DTH8643.jpg" />

    Code call:

    imageElement.Source = new BitmapImage(new 
    Uri("/_DTH8643.jpg", UriKind.Relative));

    This is working well for the current assembly but if you want to use a file located in a referenced assembly (a Silverlight class library) you will need to add a special reference to indicate the assembly you are calling the file from. This is done by adding the following prefix to calling the file:
    /AssemblyName;component/

    So, in the example below I'm calling an image from the assembly named ReferencedSlLibrary.

    <Image x:Name="imageElement" Stretch="Uniform" 
    Source="/ReferencedSlLibrary;component/_DTH8643.jpg" />

    Code call:

    imageElement.Source = new BitmapImage(new 
    Uri("/ReferencedSlLibrarys;component/_DTH8643.jpg", UriKind.Relative));

    VS 2008 - SL 2 Beta 1 note: you will notice that the image does almost only get displayed in the Visual Studio designer if you set the source in the above manner, even for own assembly files. I'm guessing this is a bug in beta 1.

    Embedding fonts

    To embed fonts there is actually a specific implementation to call upon font files, see this great post by Tim Heuer on the different ways to do this.

  • Katrien's MSDN Blog

    Creating a Tile using theme’s color as background (Windows Phone 7)

    • 8 Comments

    The Windows Phone 7 Start screen default tiles like e-mail and agenda use the current Theme color with a visual and text in white. Depending on the theme color, whether it’s set to Dark or Light, white content will always on the Tile’s foreground color.

    tiles

    As I was working on a personal project this weekend I got into looking how to use this same approach for 3rd party apps. As it happens, it’s really easy to have your tile look like one of these default app tiles.
    Let’s first look at how a Tile is constructed. As explained in the section Push Notifications, in the UI Design and Interaction Guide for Windows Phone 7 document, a Start screen tile consists of:

    • Background image
    • An optional counter (foreground)
    • Tile’s/App title

    2010-11-01_1925
    Image source: UI Design and Interaction Guide for Windows Phone 7

    There is something not mentioned in the document which is the fact that your tile image, when using transparency, also inherits from the theme color. So in fact you have these layers:

    1. Lowest layer: theme background (not shown if your tile is not transparent)
    2. Intermediate layer: background image (your image)
    3. Foreground layer: Title and counter (optional, only used when doing tile updates through Push Notifications)

    Now that we know this, the process to create a transparent Tile image that will display in the color of the current theme is really simple. For the example here I’m creating an image using Paint.net, an incredibly good program to do image manipulation (and it’s free!). You can use your favorite program to do this.

    Creating a transparent image with white content in Paint.net

    Create a new image file with the dimensions 173x173.

    2010-11-01_1932

    Delete the white background, press CTRL+A (to select), then DEL.

    2010-11-01_1934

    Create your tile visual by using white as the color. Because the background color will always be the theme color you can count on white always coming to the foreground no matter what Theme the user has chosen. I just decided to create a rectangle with a circle. Nothing fancy but it does not really matter for this post. Be creative and don’t follow my example here Knipogende emoticon

    2010-11-01_1942

    Save the file as .PNG (in my case I named the file mytile.png). Paint.net gives you several options to save your PNG. Make sure you select something other than 24bit PNG since the latter does not allow you to save transparency. Not sure why this is though.

    2010-11-01_1945

    Adding the image as new Tile for your Windows Phone 7 project

    Open your project, or create a new one using Visual Studio 2010 (or Express edition).

    Copy the newly created image into the project. Via Explorer Ctrl+C / In Visual Studio: Ctrl+V. Other option is to use the Add existing item option in the project properties. By default your project will contain an image called ‘Background.png’. You can delete this one.
    Select your new tile image file and set it’s Build Action to “Content”.

    2010-11-01_1952

    Go to Project properties, choose the newly added image as the “Background image”. Note: seems like a misleading name to me, wonder why they did not call it Tile background or something similar.

    2010-11-01_1953

    Save your project and run in the emulator or device. Pin your application to the Start screen. You should now have your white visual with the theme’s color applied. Notice the application name supplied in the project properties also appears as the topmost layer. As you can see below, my rectangle is displayed as expected using either a dark (horrible brown) or a light theme.

    Emulator view:

    2010-11-01_2002  2010-11-01_2003

    On the real device:
    tilesfull

    Easy isn’t it?

  • Katrien's MSDN Blog

    IE8 Accelerator for MSDN Social Bookmarks

    • 7 Comments

    I’ve been using IE8 Beta 2 for a few weeks now and I’m getting quite used to do actions on text or links by using Accelerators. If you haven’t seen these, accelerators allow you to easily call a service on a link or a piece of selected text. For example, a standard Accelerator is “Map with Live Maps” which shows a map when selecting an address on a page.

    One service I use quite regularly is social bookmarking, lately I’ve been using the new MSDN Social Bookmarks one for work related bookmarks. Having IE8 I wanted to replace the bookmarklet from the Favorites toolbar by an accelerator.

    BTW, the folks at MSDN just did a nice redesign with all the social info gathered including your community contributions, forums threads etc. Nice job: http://social.msdn.microsoft.com

    Now back to the accelerator. For the description that goes with the bookmark I simply select an interesting sentence on a page and use the accelerator (if text is selected).

    Creating an Accelerator is very straightforward and easy, you just need to follow the OpenService specification, which is really just an XML file following a predefined schema. For the MSDN Bookmarks I enabled this on text selection, and on a right-click on a page:

    image

    Click to install the “Bookmark on MSDN Accelerator if you are using the IE8 Beta 2.
    And if you want to take a look at the few lines of XML needed to build it just download it directly from here.

    And if you’re looking for more Accelerators to share your bookmarks check out the gallery.

    Resources for creating your own Accelerator:

  • Katrien's MSDN Blog

    Windows 7 RC and support for VHD (including booting from VHD)

    • 7 Comments

    I’m loving the new Windows version, I’ve been using it on my work and my demo computers since the release of the Beta version in January. I’m not going back!
    Now with the release of Windows 7 RC we are coming closer to a scheduled release by holiday season 2009 (as announced during TechEd US keynote).

    Expiration of Beta and RC versions
    If you are using the beta version yourself it’s recommended to upgrade (actually do a clean install) for RC. The beta version will be expiring in July 2009.
    Windows 7 RC install will expire in February 2010.

    Note that the RC version is available for download until the end of June 2009, from the MSDN site.

    VHD support

    One of the interesting features in Windows 7 is support for VHD. There’s support in two ways: first is being able to create and mount a VHD file as a disk in the OS.

    This is done through the Disk management settings under Computer Management.
    image

    The second feature is booting from a VHD file. As my colleague Arlindo explained to me, this is not running on vritualization technology. It’s done through the boot loader which will unpack the VHD and then boot from there. So it’s not the same as running your VHD with Virtual PC.

    Creating a bootable VHD

    To create my bootable VHD I used a few sites with to gather the information and guide me through the process. These were:

    Because an existing VPC is not supported to be used as a bootable VHD, you are obliged to follow one or other procedure in order to get a new Windows 7 installed on the VHD. Basic steps are, as I followed from Cesar’s post:

    1. After the base Windows 7 OS is installed, restart the computer and run from Windows 7 DVD. Note: it
    2. Choose Windows Repair (or press Shift+F10 to load the command line at the first install screen)
    3. Start the Command prompt.
    4. Type Diskpart
    5. Diskpart utility will load. Type create vdisk file=c:\Windows7Build7000.vhd maximum=40000 (where “c:\Windows7Build7000.vhd” can of course be another location and name). The 40000 refers to the disk size. Adapt as required.
    6. Enter the command to select the newly created disk: select vdisk file=c:\Windows7Build7000.vhd
    7. Type: attach vdisk
    8. Type: exit (you exit Windows Repair, but Do Not Reboot), or close the command line
    9. Click “Install now” back in the installation wizard.
    10. Accept license and then make sure you choose “Custom (advanced")” in the installation type screen.
    11. Choose the newly created disk as a destination (by checking the size of your newly created VHD you should be able to recognize which one it is.
    12. If you get a warning saying that your computer hardware might not support this drive just ignore it.
    13. Continue installation wizard, Windows 7 gets installed and will reboot the system a few times. That’s it.

    After following this procedure I ended up with two Windows 7 entries in my boot sequence so this is something that needs to be addressed. I found out the last install (on VHD) is put at the top.

    100_1021

    The only change needed here is adapting the entries in the boot loader so that I know exactly which one is which. To do this we can use the bcdedit.exe command line tool.

    The bcdedit tool is pretty straightforward (see TechNet document on command line options). What I need to do is rename the VHD Windows 7 entry to something that is more logic, and secondly I would like my base OS to appear as the first in the dual boot option. To do this I opened up command line in admin prompt, and used these commands.

    bcdedit /v
    This command will list the boot loader entries. Copy the GUID for the VHD entry onto clipboard.

    bcdedit /set {GUID} description “Windows 7 – VHD”
    Setting the entry description, you can of couse choose whatever description fits you.

    bcdedit /displayorder {guid} /addlast
    Here we set the display order of the VHD entry to be displayed last. Since the entry already exists it’s simply moved to the end of the list.

    Now since I also want to make sure the first entry gets selected by default when booting, I copy the base OS GUID to clipboard and then use the /default option:

    bcdedit /default {GUID}

    With that I’m all set: my main install I’m using for my main (released) version demos and keeping the VHD for trying out all beta versions of technologies. And my boot entries show as I have set:
    100_1022

    Sleep mode also continues to work perfectly, indifferent from the fact that it’s been booted on the VHD or the base OS.

    To finish off, another interesting advantage of having a bootable disk on a VHD: you can use BitLocker to encrypt the whole disk where the VHD sits: if by any your laptop gets lost or stolen there’s no way to get the VHD’s content.

  • Katrien's MSDN Blog

    Live Framework – storing data in a Mesh-enabled Silverlight web application in 4 steps

    • 6 Comments

    In my previous post about the Live Framework and Mesh-enabled apps I described how to create your first project, publish and deploy it to the Mesh and debug using Visual Studio 2008 support tools.

    However, that was without taking advantage of any of the Live Framework and Mesh functionalities. In this post that’s exactly what I’ll be doing. The sample application will be storing some data and loading it upon running on the web on or the client (Mesh). To do this we are going to use the Silverlight Toolkit for the Live Framework, this one exists for Silverlight and for client (full) .NET applications. The Live Framework .NET library is one of the toolkits you can use to call the framework, but this is actually a wrapper around the RESTful APIs that can be accessed through HTTP. Because at the base it is all HTTP, any platform can access the framework.

    The toolkits that are available today are just extra help so that you do not have to deal with all the HTTP calls. Toolkits that are available today:

    • .NET Toolkit for the Live Framework
    • Silverlight Toolkit for the Live Framework
    • Live Framework JavaScript Kit

    Now let’s get to our sample application. To get my data stored and synchronized through the Mesh it is important to get a good look at the Live Framework Resource Model. The base objects in the resource model are MeshObejcts, DataFeeds and DataEntry objects. I must admit I still need to read on further into the SDK documentation and understand correctly when I should use which elements. As I have understood it a MeshObject is the highest element in your application that you would want to share. If my application (instance) can be shared as a whole I will only create one MeshObject. If sub-elements can be shared than each of the sub-elements should be a MeshObject.

    For now, I’ll be accessing the DataFeeds property. Nothing more than that for now. So in short, the application will contain a list of Party titles. Yes parties, guess I’m thinking about Christmas wish lists or something :)
    Please note I have not gone to defining the object model for the application, it shows a simple way how to access the Mesh and feeds directly.

    image

    1. First of all since we are using the Silverlight Mesh-enabled web application template in Visual Studio, this contains some base code to load the Mesh application service object.

    MeshApplicationService meshApp = Application.Current.GetMeshApplicationService();
     // once mesh contents are loaded we get callback
     meshApp.LoadCompleted += new EventHandler(meshAppLoaded);
    meshApp.Load();

    2. The app UI consists of a ListBox, a TextBox and a Button. ListBox is bound to an ObservableCollection of DataEntryResource objects. Each of the Party entries will be stored in a DataEntryResource on the Mesh.

    ObservableCollection<DataEntryResource> partyEntries = 
    new ObservableCollection<DataEntryResource>();

    3. Upon loading of the Mesh application service object we load the DataFeed in which we store the entries. This DataFeed does not exist upon first call of the application so we create in that case. I’m also inserting a default entry in the list named “My first party”.

    private void LoadDataFeed(MeshApplicationService meshApp)
    {
                
            DataFeed partyFeed = meshApp.DataFeeds.Entries.FirstOrDefault
    (pf => pf.Resource.Type == "Party_DataFeed"); if (partyFeed == null) { //Create the DataFeed partyFeed = new DataFeed(); partyFeed.Resource.Type = "Party_DataFeed"; meshApp.DataFeeds.Add(ref partyFeed); DataEntry entry = new DataEntry("My first party"); entry.Resource.Type = "Party_DataEntry"; entry.Resource.Title = "My first party"; partyFeed.DataEntries.Add(ref entry); meshApp.Update(); } //load the collection of DataEntry items if (!partyFeed.DataEntries.IsLoaded) partyFeed.DataEntries.Load(); foreach (DataEntry entry1 in partyFeed.DataEntries.Entries) { partyEntries.Add(entry1.Resource); } }

    4. To finish, we create the Button event handler to add an item to the collection of DataEntries.

    private void buttonAdd_Click(object sender, RoutedEventArgs e)
    {
        MeshApplicationService meshApp = Application.Current.GetMeshApplicationService();
    
        DataFeed partyFeed = meshApp.DataFeeds.Entries.FirstOrDefault(
    pf => pf.Resource.Type == "Party_DataFeed"); DataEntry partyEntry = new DataEntry(); partyEntry.Resource.Type = "Party_DataEntry"; partyEntry.Resource.Title = textPartyName.Text; partyFeed.DataEntries.Add(ref partyEntry); partyEntries.Add(partyEntry.Resource); textPartyName.Text = ""; }

    And that’s it. Data in the Mesh, be it on the client desktop or the web.

  • Katrien's MSDN Blog

    Quick tip: using the WP Connect utility instead of Zune client (Windows Phone 7)

    • 6 Comments

    Deploying and debugging your Windows Phone 7 applications on a device requires Zune client software to be running. However, Zune client software blocks access to your local media database making it impossible to debug anything using media APIs. This may include photo choosers and launchers, XNA and Silverlight playback of media elements.

    The solution is simple, with the newly released Windows Phone Developer Tools October 2010 Update, a new tool WPConnect is provided to circumvent this issue. Download and install the tools update. Once done you can connect your device, close Zune software and launch WPConnect.exe from the installation directory. Normally this is “%ProgramFiles%\Microsoft SDKs\Windows Phone\v7.0\Tools\WPConnect”.
    More details on MSDN: http://msdn.microsoft.com/en-us/library/gg180729(v=VS.92).aspx

    Note: this applies to developers using an unlocked Windows Phone device. Unlocking your phone requires registration in the AppHub.

     

    Quick tip posts are short, useful posts pointing to content and tricks that might otherwise go lost in a typical 140 chars on Twitterverse.

  • Katrien's MSDN Blog

    Windows Phone 7 “Mango”: download SDK and consumer features unveiled

    • 6 Comments

    On May 24th Microsoft held a press conference announcing many of the new features coming to the next version Windows Phone 7. Codename for this version is “Mango” so we’ll refer to it by that name in the rest of this post. Note that the official name in the documentation is Windows Phone 7.1 beta.

    Mango was first unveiled at WMC event in Barcelona in February, more features including the full developer SDK functionalities were also shown during MIX conference in April. Take a look at the video below where Joe Belfiore walks you through the new consumer features.

    Read about the consumer features in Mango on these sites:

    Developers: download the SDK and take advantage of new features

    Developers can tap into more than 1500 new APIs in Mango and start taking advantage of the new features today. But what are the main new features? Too many to call out in this post but focusing on the top we get:

    • Background processing
    • Phone access: calendar and contacts, camera access, additional sensors
    • HTML5 support with Internet Explorer 9 on the phone
    • Support for Silverlight + XNA together
    • Silverlight 4
    • Live Tile enhancements such as multiple tiles, deep linking, updating Live Tiles locally, use back of tiles
    • Fast application switching
    • Local SQL database
    • Sockets
    • Tooling: new code profiler and emulator

    How to get started with Windows Phone 7.1 (Mango) Beta tools

    1 – Download the tools

    Download and install the updated SDK containing Visual Studio 2010, phone emulator and Expression Blend for Windows phone, including some tools like the .XAP deployment tool.
    Note: for current application development: the new updated tools allow you for multi-targeting. This means v1 projects can be worked on with the updated tools, as well as creating new applications targeting the Windows Phone 7.1 version. Running the two tools versions side by side is not possible, and in this way not required really.

    2 – Get yourself up to speed on the new developer features

    3 – Register for the Marketplace

    Today as a developer you can only submit applications for Windows Phone 7 (not Mango). In the near future the application marketplace for Mango will become available and from that point on you will be able to submit your “Mango” targeted application.
    Register for the marketplace on http://create.msdn.com. For tips on Belgium & Luxembourg specifics of Marketplace registration, watch this live meeting recording: “Windows Phone 7: Tips and Tricks about Developer Registration and Application Certification”.

    Happy coding!

  • Katrien's MSDN Blog

    Are you ready for Windows Phone 7?

    • 5 Comments

    Well, I hope you are because Windows Phone 7 is here!

    Yesterday was the official announcement around the commercial availability of Windows Phone 7 devices in Europe, Asia and United States. Starting with the press conference in New York where Steve Ballmer introduced the phone, you can watch the full session on demand here. Notice how Joe Belfiore walks you through the usage of the phone, making it a very personal experience. I highly recommend watching Joe’s demo.

    Belgium launch

    The phone will be in stores starting October 21st 2010, with four different devices available and the major operators selling these. In addition to a press conference we also organized an evening launch event where bloggers, social media and community was invited to.
    Check out the reports through the Twitter tag #wp7be.

    Four phones by launch on October 21st 2010

    Internationally there will nine different phones launched, for Belgium we will have four phone to start with LG Optimus 7, Samsung Omnia 7, HTC 7 Mozart and HTC 7 Trophy.

    clip_image001

    Engadget has some great WP7 coverage and a handset spec comparison.

    The big question is: are you read to start building apps for Windows Phone 7?

    Developing for Windows Phone 7 is done in .NET: either .NET in the form of Silverlight for apps, or in the form of XNA for developing games mainly.
    Tooling is free, and it contains a special version of Visual Studio, Expression Blend and a full Phone emulator. Download the tools for free.

    To get started with Windows Phone 7 development we have 12+ hours of content for you: Windows Phone 7 Jump Start training on-demand.

    To finish off, check out the first Windows Phone 7 commercial: Really?.

    Really?
  • Katrien's MSDN Blog

    Microsoft Expression 4 launched, what’s new and resources

    • 4 Comments

    Expression 4 was officially launched today at Internet Week New York. In this post you’ll find the main links to downloads, getting started and a concise overview of new features.

    Trials & downloads

    All the different versions of Expression Studio are available for download with 60-day trials. Download here.

    Upgrading from Expression 3
    If you have already installed Expression 3 on your machine and have a full license you will automatically have a registered version of Expression 4 when you install it on the same machine. More details can be found on the Expression site.

    Side note on Windows Phone 7 tools compatibility: don’t install Expression Blend 4 if you’re currently doing WP7 development. The WP7 tools are not compatible with the RTM version, do expect an update soon.

    What’s new

    imageExpression Blend 4

    Expression Blend adds support for Silverlight 4 and WPF 4 projects, still allowing you to continue developing your Silverlight 3 and WPF 3.5SP1 projects. Next to this multi-targeting support there are quite some new features of which I like to highlight the following:

    • New behaviors like CallMethodAction, DataStateBehavior, InvokeCommandAction, etc and Conditional behaviors. Conditional behaviors allow you to set conditions on any Action you want to execute. Checkout Silverlight TV 30 where Adam Kinney shows you how to use the new behaviors.
    • PathListbox, a feature that allows you to draw a path on the artboard and bind listbox elements to it.
    • New shapes like arrows, stars, callouts and more.
    • New pixel shader effects.
    • Lots more, check out Christian Schormann’s post and session from MIX.

    Expression Blend SketchFlow 4

    SketchFlow gets its second iteration with this release. There are quite a few noteworthy new features, of which the integration with SharePoint is the most important. This feature allows for publishing the SketchFlow project directly to a SharePoint library. The stakeholders can then use this to browse the prototype, add feedback and also save the feedback directly to SharePoint. Expression Blend Feedback also connects to the SharePoint library to load the comments.

    Some other new features in SketchFlow:

    • Feedback into work items in Team Foundation Server
    • General fixes like player artboad (scrolling)
    • New shapes
    • Default styles for controls when working with SketchFlow projects are Sketch Styles.

    Expression Web 4 – SuperPreview

    SuperPreview, part of Expression Web 4 allows you to debug your pages in multiple browsers on the same machine that you use for development. SuperPreview is a visual debugging tool that helps you visualize and understand how pages display on multiple browsers, including IE6 – 8, Macintosh Safari, and Windows Firefox. You can even overlay your page on top of your Photoshop comp to verify your coding. IE6 rendering engine is included in SuperPreview so you don’t to install it on your machine. In order to get IE7, 8, and FF, each of these must be installed on the machine.
    A new addition in this version is support for rendering on Macintosh Safari, which is supported via a remote (cloud) service technology preview. This is a beta service and you will need to sign-up for this.

    Expression Encoder

    Expression Encoder 4 Pro has support for a brand new H.264 encoding engine from Main Concept, which is more performant.
    Live Smooth Streaming: next to encoding for on-demand Smooth Streaming which was available in Expression Encode 3, the new version also has support for live stream encoding for from a range of video card and USB/Firewire devices.

    Expression Encoder Screen Capture
    The hidden feature I love in Expression Encoder is the Screen Capturing tool. Very easy to use and great for doing screencasts. New in this feature are zooming functions, capability to work with multiple clips in the new capture manager and registration of the codec on the host machine. In addition, free distribution of the codec allows for raw screen captures to be viewed outside of the application.

    Resources

    • .toolbox – This site does not yet have content that is specific to Expression 4 but it’s a great resource for learning how to take the most out of Expression Blend in several steps. Sign-up, create your avatar and go to school.
      [Update - .toolbox does have new Expression Blend 4 content, thanks Adam Kinney for pointing this out]
    • Project Rosetta – this learning resource has tutorials on how to go from Flash to Silverlight. Very useful if you are used to working on Flash and need to know how you can achieve the same things in Silverlight and Expression Blend.
    • Expression Blend OnRamp training – Learn Expression Blend in 5 days
  • Katrien's MSDN Blog

    Scott Guthrie in Belgium – event write up and links

    • 4 Comments

    Last Friday December 4th we had the pleasure to have Scott Guthrie visit Belgium after a few other European countries. For this visit we setup a full afternoon event together with the Visual Studio User Group (VISUG) at a Brussels movie theater. In this post I’m giving you an overview of the events and some resources that might be helpful if you want to go further. The sessions were not recorded.

    Setting up an event registration just a few weeks beforehand is not always feasible, however in the case of the session with Scott Guthrie we were fully booked even a week before the event date! Hopefully not too many people got left behind.

    The red polo shirts

    We need to say something about the red polo shirts. For the occasion we had foreseen red polo's for all attendees as a gig since Scott is quite known for wearing a red polo shirt when presenting. I think this was well received by the audience, we could see smiles all over :-)

    Scott AutoCollage_1

    Luc Van de Velde kicked off the sessions and showed the video made for MIX09 which also is all about the red polo. Check out the video for yourself: Channel9, how Scott Guthrie prepares for MIX09 keynote.
    I think Scott Guthrie was pretty surprised to see a full red room but nicely surprised we hope!

    Check out all the pictures of the event on the Live Gallery - Scott Guthrie in Belgium - 4 December 2009.
    The VISUG guys also recorded some interviews with attendees so keep an eye on their site.

    Session 1: Visual Studio 2010 and ASP.NET 4.0 Web Development

    In this session Scott did an overview of the newest features in the Visual Studio 2010 Beta IDE, web development settings and overview of ASP.NET 4. This includes improvements in ViewState, CSS rendering, URL Rewriting for WebForms and more. You can download the PowerPoint presentation as well as the demos from Scott Guthries blog.

    What next?

    To get started with Visual Studio 2010 yourself there’s quite some material online.

    1. Start by installing Visual Studio 2010 Beta 2. There is a full version as well as an Express edition.
    2. Follow the hands-on labs and video tutorials on Channel9’s ASP.NET 4 Training Course.
    3. Check out the Visual Studio 2010 and .NET Framework 4 Beta 2 Walkthroughs on MSDN.
    4. Read Scott’s blog post series on VS 2010 and .NET 4.

    Session 2: Silverlight 4

    Silverlight 4 Beta was announced during PDC keynote last November. Scott talked us through the major improvements in Silverlight 4 and showed us some very cool demos including the webcam with effects and a Facebook client in Silverlight Out-of-Browser mode. Download the PowerPoint presentation from Scott Guthries blog.
    Webcam demo 
    You can have a look at most of the demos by watching the PDC Day 2 Keynote online – check as from 0:53 for Scott’s part.

    What next?

    1. Download and install Silverlight 4 developer runtime and Tools for Visual Studio, as well as Expression Blend 4 Preview. You can find all the links here.
    2. Read Tim Heuer’s overview post on Silverlight 4
    3. Watch up to 18 videos on the different Silverlight 4 functionalities
    4. Read Gill Cleeren’s Silverlight 4 Advent calendar – a post a day!

    Session 3: ASP.NET MVC

    In this session Scott started to introduce ASP.NET MVC by going through the process of creating a new ASP.NET MVC application and then moving on to what is new in ASP.NET MVC 2.
    ASP.NET MCV lets you develop without using WebForms but still leaning on the capabilities of ASP.NET Core framework (for example Membership & authentication). It’s a different approach following the Model View Controller pattern in which you have higher testability, a clearer separation of concerns and basically much more direct access to the HTML. WebForms sometimes abstracts part of that.
    Download the PowerPoint presentation and a walkthrough from Scott Guthries blog.

    What next?

    1. Download ASP.NET MVC directly. It is also part of the Visual Studio 2010 Beta install.
    2. Start with learning how to use ASP.NET MVC by reading the tutorials or watching videos on ASP.NET MVC Learning center
    3. A good read are the posts by Belgian MVP Maarten Balliauw who also wrote a book on the subject.
    4. Phil Haack’s blog is also a great resource to check out.

    To conclude, I really had a great time following Scott’s sessions and I’m pretty positive everyone present at the event did the same. Now let’s all dive into it!

    Be sure to follow ScottGu’s latest tweets on Twitter.

  • Katrien's MSDN Blog

    TechEd EMEA: Visual Studio 2010 in the keynote and lots of Belgians

    • 4 Comments

    Back from Tech-Ed EMEA developers, running from 10 to 14 November 2008 in Barcelona. It was a very interesting week in turns of content but also in terms of meeting up with lots of interesting people. And proud to be a Belgian at this conference: besides Hans Verbeeck as the business owner we had a Belgian winner at the Speaker’s Idol: Kurt Claeys.

    Congratulations to Kurt, looking forward to his first session at TechEd next year in Berlin!

    100_0780 100_0803

    This year it was my first time at the Silverlight “Ask the Experts” booth where I had the pleasure to meet with some peers of mine, and MVPs that were ready to answer questions from attendants.
    Having booth duty did not prevent me from following some of the sessions. I especially enjoyed getting even more PDC content like Angus Logan’s session on Mesh enabled web apps, Windows 7, and David Chappell’s session on Geneva (codename for Microsoft’s identity and claims based framework). Non-PDC content like Bob Beauchemin’s sessions on SQL Server 2008 or Stephen Forte’s interactive session on data access were some of the other sessions I followed.

    Visual Studio 2010 main topic during keynote

    Opening keynote was presented by Pierre Liautaud, Vice-president Western Europe for Microsoft and Jason Zander was the overall keynote speaker.

    Taking place just one week after the Professional Developer’s Conference (PDC) in L.A., it’s not an easy task to bring more new stuff to the event. However, without leaving behind the importance of PDC the keynote did present us with quite some new information on VS2010.

    Jason Zander did a great overview of some of the new things to be found in Visual Studio 2010, and included lots of demos which is really what any developer wants to see!

    Visual Studio 2010 highlights:

    • Architecture explorer: Visual assembly and class explorer
    • Lots of WPF integration into the IDE, only goodness :-)
    • Generation of UML 2.1.1 Sequence diagrams
    • New testing - Test & recording?
    • Team System 2010: with the Lab Management feature where you can provision your virtual test environments.
    • Tools for SharePoint development integrated into the IDE. No more installing separate extensions as is now the case. Having done my share of SharePoint development in the past I know this one is really welcome.
    • C++ and MFC improvements

    Check it out: download the Visual Studio 2010 and .NET Framework 4.0 CTP here.

    In addition to VS2010 goodness, PDC content was not forgotten. The event had a special PDC Highlights track bringing the best of PDC to Barcelona. I thought this was a very useful decision to bring the PDC content to TechEd. Waiting one year would create too large a knowledge gap. This track included sessions on Windows Azure, Oslo, Live Framework and Windows 7.

    Finally, having the possibility to meet up with a lot of Belgian developers and exchanging views and ideas was another highlight for me. Thanks all for joining the conference and hope to see you around at another event in Belgium or at TechEd in Berlin next year!

  • Katrien's MSDN Blog

    Silverlight 3: Out-of-Browser Applications

    • 4 Comments

    One of the most awaited and requested features before the release of Silverlight 3 Beta was the ability to run Silverlight applications out of the browser. To be clear, this is not completely out of the browser, since the browser chrome/host is still being used. However, the application can be run directly from the Start menu (or desktop), depending on what the user chose.

    As a developer you can configure the application so that it can be installed for out of browser use. Next to out of browser, the application can also run offline but only if your code works in such a way that this is allowed. By that I mean you can work with IsolatedStorage to save some information local and use network detection to check for a network. If your application relies on services or files that are online you can disable working in offline mode (but still enable out of browser).

    While this feature has been blogged about with Silverlight 3 there are some notable differences with the Silverlight 3 RTW. First it’s important to note the syntax for the application manifest has been changed.
    Silverlight 3 Beta breaking changes: while the Beta version used “<Deployment.ApplicationIdentity>” the RTW version now uses <Deployment.OutOfBrowserSettings>

    Sample:

    <Deployment.OutOfBrowserSettings>
    <OutOfBrowserSettings ShortName="OobDemo Application"
    EnableGPUAcceleration="False"
    ShowInstallMenuItem="True">

    …</OutOfBrowserSettings>
    <Deployment.OutOfBrowserSettings>

    The good news is Visual Studio is now giving you an editor to configure the out-of-browser settings.

    Choose Silverlight project properties > Check “Enable running applications out of the browser” and click the “Out-of-Browser settings” button.

    image

    You might notice Visual Studio will create a separate “OutOfBrowserSettings.xml” file to store the settings. The contents of this file get concatenated with the AppManifest.xml file upon build, which is of course logical. If you need to change any of the settings manually (like the ShowInstallMenuItem), you will need to do this in the OutOfBrowserSettings.xml. Adding these out of browser settings in the App manifest file will result in duplicates.

    image

    When I now run this demo application and right-click I have the option to install the Silverlight application. This is the default behavior. You can also hide the display of the Install option in the right-click menu and control this programmatically, for example by adding a button “Install”.

    image

    image

    When controlling the installation through your own interface you can use Application.Install to install the application out of browser, however this needs to be triggered by a user action. In the sample below I’m responding to a button click event:

    private void Install_Click(object sender, RoutedEventArgs e)
      {
        if (Application.Current.InstallState == 
    InstallState.NotInstalled) { Application.Current.Install(); } }

    Looking forward to seeing applications make use of this feature, there is one out just as Silverlight 3 is released: it’s Sobees Silverlight Twitter client. Worth checking out (just right-click the app to install locally).

  • Katrien's MSDN Blog

    Watch VISUG session on VSX (Visual Studio Extensibility) online

    • 4 Comments

    Last week James Lau and Jean-Marc Prieur from the Visual Studio Extensibility team, visited Belgium and did a presentation at VISUG user group. If you missed the session or have not yet seen much about VSX this is a good opportunity. It's a 2 hour presentation with lots of demos.

    You can now watch the whole presentation online, it has been split into 5 parts:

Page 1 of 27 (399 items) 12345»