Sonntag, 7. August 2011

Windows Phone: New Silverlight toolkit announced

Good news for Windows Phone developers: it's just been announced that the Silverlight Toolkit for Windows Phone will be getting a Mango update sometime in August.

This update will giving developers just a few extra weeks to tweak their Silverlight extensions before the Marketplace starts accepting Mango apps. No word on the exact changes the new toolkit will contain, but I think Jeff Wilcox will give us some goodies in there.

Samstag, 2. Juli 2011

Windows Phone Mango 80004005 error

Currently my Mango update for Windows Phone fails with error code 80004005.

Answer from Microsoft:

“This is an error that is still being diagnosed at Microsoft.  At this time there is no workaround for it.  You should restore your phone to its NODO image and wait until there is a resolution for this problem.”

Some suggestions from Microsoft

On these crash / update issues there are two general approaches that you can try.


1. Try to apply the update using a different desktop / laptop system.

2. If a different system still doesnt' help, then remove any personal data from the device and perform a hard reset. Then try the update process again

Montag, 27. Juni 2011

MVC3: Combine JavaScript files

A nice tool on codeplex to combine and minifier several JavaScript files:

Combres - WebForm & MVC Client-side Resource Combine Library – Home

  • Open the Package Manager Console (Tools > Library Package Manager > Package Manager Console)
  • In the command window:
    • If you work with ASP.NET MVC: enter Install-Package Combres.Mvc
    • If you work with ASP.NET WebForm: enter Install-Package Combres

Register Route
This step is only necessary for ASP.NET 3.5 users. ASP.NET 4.0 users can skip to the next step. This step is necessary because there's currently no way to generate/transform/reference different code/config/assemblies for different .NET runtimes with NuGet.
  • Delete the generated file AppStart_Combres.cs
  • Remove the reference to the assembly WebActivator
  • Open global.asax code-behind file
    • Import Combres namespace, i.e. using Combres;
    • Add this to the first line of either RegisterRoutes() or Application_Start(): RouteTable.Routes.AddCombresRoute("Combres");

Modify Combres.xml
  • Open App_Data/Combres.xml (this should be auto-created when you install the Combres NuGet package)
  • Add/remove resource sets, resources etc. as per your need. See this article for more information.

Reference to Combres' resource sets in view
  • Open any view page (e.g. master page) which need to reference JS/CSS resource sets defined in Combres.xml
  • Add the followings:
<%= WebExtensions.CombresLink("siteCss") %>  
<%= WebExtensions.CombresLink("siteJs") %>

Sonntag, 26. Juni 2011

HTML5: Deprecated Tags

HTML5 has introduced a lot of new fantastic elements that will be helpful to build better web pages. But the specification also deprecates a few tags that you maybe used in your web pages. So keep them in mind and use  the more semantically correct tags or use CSS for styling.

Presentational tags that are deprecated:

  • basefont
  • big
  • center
  • font
  • s
  • strike
  • tt
  • u

Also the support for frames has been removed. That means that the following tags are gone:

  • frame
  • frameset
  • noframes

A few other tags are replaced by better options:

  • acronym replaced by abbr
  • applet replaced by object
  • dir replaced by ul

In addition to deprecated tags there are many HTML attributes that are no longer valid:

  • align
  • link, vlink, alink and text attributes on body tag
  • bgcolor
  • height, width
  • scrolling on the frame element
  • valign
  • hspace, vspace
  • cellpadding, cellspacing, border on the table tag

Deprecated HTML attributes are:

  • target for links
  • profile for head tag
  • longdesc for img and iframe

If you plan on using HTML5 for your website, be sure to look at this elements and attributes to be compatible with the future and HTML5. You can use http://validator.w3.org to validate your page with the standards.

Dienstag, 14. Juni 2011

Windows Phone: Share files with Skydrive on Mango

“Today, more than 250 million documents are shared through SkyDrive, making it one of the most popular ways to upload, view, edit or share documents on the web. Again, we worked to connect our services to the applications and devices you use every day. You can save your Office documents right to SkyDrive from Office 2010 on your PC and Office for Mac 2011, or you can upload documents from your web browser. Once documents are uploaded, SkyDrive works seamlessly with the Office Web Apps for accessing, editing and sharing docs in your browser or in the desktop client. And, thanks to SkyDrive, OneNote works seamlessly across your PC, phone (OneNote Mobile for Windows Phone and OneNote Mobile for iPhone) and web browser (the OneNote Web App).”

Don’t wait for your cloud - use Hotmail and SkyDrive today on your PC, Mac, or Phone

Windows Phone: Off-thread decoding of images with Mango

A new blog post in Silverlight Phone Performance team blog about new posibilities of decoding images in a listbox in a background thread per xaml definition with the new property CreateOptions.

For more details see: Off-thread decoding of images on Mango, how it impacts your application ? - Silverlight for Windows Phone Performance team blog - Site Home - MSDN Blogs

Dienstag, 7. Juni 2011

Silverlight 5 beta: Issue with Toolkit controls

With Silverlight 5 beta there is an issue concerning the usage of the Silverlight Toolkit controls. For some of them (in my sample the MenuItem) you get a compile error

“The type or namespace name 'ContextMenu' does not exist in the namespace 'System.Windows.Controls' (are you missing an assembly reference?)”

Oops?! If you use intellisense to select the MenuItem control it exists. So definitively a bug in Silverlight 5. After a quick search a found also a hint in Microsoft Connect: Silverlight Forum: SL5 NumericUpDown control compile error | Microsoft Connect

XAML which produce the error:

<StackPanel>
    <ListBox x:Name="ListBoxTest">
        <toolkit:ContextMenuService.ContextMenu>
            <toolkit:ContextMenu x:Name="contextMenu1">
                <toolkit:MenuItem Header="Test"></toolkit:MenuItem>
            </toolkit:ContextMenu>
        </toolkit:ContextMenuService.ContextMenu>
        <ListBoxItem Content="Listitem 1"></ListBoxItem>
        <ListBoxItem Content="Listitem 2"></ListBoxItem>
    </ListBox>
</StackPanel>

Workaround by setting the Menuitems with code behind:

New XAML:

<StackPanel>
    <ListBox x:Name="ListBoxTest">
        <toolkit:ContextMenuService.ContextMenu>
            <toolkit:ContextMenu x:Name="contextMenu1">
                <!--<toolkit:MenuItem Header="Test"></toolkit:MenuItem>-->
            </toolkit:ContextMenu>
        </toolkit:ContextMenuService.ContextMenu>
        <ListBoxItem Content="Listitem 1"></ListBoxItem>
        <ListBoxItem Content="Listitem 2"></ListBoxItem>
    </ListBox>
</StackPanel>

Code:

public MainPage()
{
    InitializeComponent();
 
    var menuitem = new MenuItem() { Header = "My Menu" };
    //menuitem.Click += new RoutedEventHandler(menuitem_Click);
 
    contextMenu1.Items.Add(menuitem);
}