Zayko in the Net

Personal blog of Vitaly Zayko

NAVIGATION - SEARCH

Microsoft Ribbon for WPF (October 2010 update)

Now works with Visual Studo 2010 Express!

Other changes:

  • Ribbon Split Button is only half-highlighted when users mouse over the button
  • Ribbon Title is bottom-aligned, should be centered
  • Ribbon Quick Access Toolbar icons are clipped and top-aligned
  • Ribbon Contextual Tab header text is getting truncated if too long
  • Ribbon Gallery  Item does not stretch to fit its Parent Panel
  • Initial enabled state of Ribbon Split Menu Items can be incorrect if they have children
  • Ribbon Split Menu Item with sub-items is disabled if CanExecute=false
  • WPF Ribbon Dropdown does not close when CanAddToQuickAccessToolBarDirectly="False" was set at various level within the Ribbon
  • InvalidOperationException may occur when switching themes and the WPF Ribbon is Minimized
  • Ribbon Tab Header content may not appear when Ribbon starts out collapsed
  • RibbonTab.TabHeaderLeft & RibbonTab.TabHeaderRight are incorrect when Ribbon starts out hosted in a Collapsed control
  • Ribbon Tool Tip: Title and Footer Title gets clipped if the stringis too long
  • Vertical and horizontal alignments for the standard Ribbon controls should be centered, they were not.
  • After removing all items from the Quick Access Toolbar, phantom items remain visible
  • Right clicking on the System icon will not place the Context Menu properly
  • System Icon, Title and Quick Access Toolbar are not displayed correctly when Ribbon Windows is maximized
  • A minimized Ribbon will render on top of the window when a Popup is opened.
  • RibbonWindow.Icon does not pick appropriate small size icon from *.ico  Icon file.
  • IndexOutofRange Exception would pop when removing a Tab from an Observable Collection.
  • WPF Ribbon can use ClearType when targeting .NET Framework 4.0 control.

Click here to download.

Technorati Tags: ,

Custom icons don’t appear in Windows Phone 7 toolbar

Playing with most recent Windows Phone 7 Tools I found that custom icons don’t appear in emulator by default although they exist in a solution.

wp7_no_icons

 <shell:ApplicationBarIconButton IconUri="/Images/add.png" Text="Add" Click="AddClick" />
 <shell:ApplicationBarIconButton IconUri="/Images/remove.png" Text="Remove" Click="RemoveClick"/>

This happens because pictures adding with “Resource” as default build action. To make this work, select your recently added picture in Solution Explorer, switch to Properties and change Build Action to “Content”. After recompiling you will get your icons in place.

vs_menuwp7_with_icons

Technorati Tags:

Adding Buttons to Window Thumbnail in WPF 4 for Windows 7 (C#)

I'm pretty sure you all noticed that when you move your cursor under an App in Windows 7 Task bar, small window copy (aka Thumbnail) appear and there are small buttons on some windows could be attached. Good examples are Windows Media Player or WinAmp.

Windows Player Thumbnail with buttons on it

There is a good reason to put such buttons there: using them you can manage this Application without necessity to open its window.
Here is how to add this functionality to your own WPF App.
Add reference to TaskBatItemInfo just like we did to add progress bar in this post.
Add references to ThumbButtonInfo, so you will see something like this:

 <Window.TaskbarItemInfo>
     <TaskbarItemInfo>
         <TaskbarItemInfo.ThumbButtonInfos>
             <ThumbButtonInfo ImageSource="/IconProgressDemo;component/Icon1.ico" Description="Play!" Click="ThumbButtonInfo_Click" />
             <ThumbButtonInfo ImageSource="/IconProgressDemo;component/Icon2.ico" Description="Stop!" Click="ThumbButtonInfo_Click" />
         </TaskbarItemInfo.ThumbButtonInfos>
     </TaskbarItemInfo>
 </Window.TaskbarItemInfo>
 

Now just handle Click event in way you want and you done!

 private  void  ThumbButtonInfo_Click(object  sender, EventArgs  e)
 {
     MessageBox .Show((sender as  System.Windows.Shell.ThumbButtonInfo ).Description);
 }
 
Technorati Tags: ,,