Posts
133
Comments
328
Trackbacks
0
Sunday, December 11, 2011
Blogged Moved
Yep, you heard right. This blog has been moved to http://michaelcrump.net. I will no longer be posting anything to this site. If you are subscribed to my Feedburner account then no need to do anything. Just continue enjoying the XAML goodness! 
Posted On Sunday, December 11, 2011 2:10 PM | Feedback (0)
Friday, November 25, 2011
1360x768x32 Resolution in Windows 8 in VirtualBox

 

My Lenovo ThinkPad's built-in screen maxes at 1366x768x32. I wanted to use that same resolution with Windows 8 Developer Preview inside of VirtualBox. So, what did I do?

  • Downloaded the latest build of VirtualBox v4.1.6 (because it supports Windows 8 x64)
  • Installed Windows 8 Developer Preview in VirtualBox as I did earlier this year.
  • Installed Guest Additions.
  • Ran the CustomVideoMode described in this blog post.

…and quickly found out that I didn’t have the option to use 1366x768x32 inside of VirtualBox despite using the following command:

VBoxManage.exe setextradata  "[Virtual Machine Name]" CustomVideoMode1 1920x1080x32

 

So how do you fix it?

If you do a little research on this resolution, then you will find it is a non-standard resolution. Even if you run the command:

VBoxManage.exe setextradata "[Virtual Machine Name]" CustomVideoMode1 1366x768x32

It will still not show that resolution inside of VirtualBox. You can fix this easily by using the following command as shown below:

VBoxManage.exe setextradata "[Virtual Machine Name]" CustomVideoMode1 1360x768x32

SNAGHTMLaa756ce

I hope that you noticed the command used the resolution of 1360 instead of 1366. Now if you go to your display option for Windows 8 inside of Virtualbox then you can select that resolution.

image

Anyways, I hope this helps someone with a similar problem. I created this blog partially for myself but it is always nice to help my fellow developer. 

Thanks for reading.

alt Subscribe to my feed

Posted On Friday, November 25, 2011 12:33 PM | Feedback (0)
Friday, November 18, 2011
Fixing a broken toolbox (In Visual Studio 2010 SP1)

 

image

I was recently running into a situation where every time I opened Visual Studio 2010 SP1, the following message would appear for about 60 seconds or so:

"Loading toolbox content from package Microsoft.VisualStudio.IDE.Toolbox.ControlInstaller.ToolboxInstallerPackage
'{2C98B35-07DA-45F1-96A3-BE55D91C8D7A}'"

After finally get fed up with the issue, I started researching it and decided that I’d share the steps that I took to resolve it below:

  • I first made a complete backup of my registry.
  • I then removed the following key:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Packages\{2c298b35-07da-45f1-96a3-be55d91c8d7a}]
  • I went to the following directory: C:\Users\Your Name Here\AppData\Local\Microsoft\VisualStudio\10.0\ and created a folder called bk and moved the .tbd files to that folder (they are hidden so you will have to show all files). I then removed the .tbd files in the root directory.

SNAGHTMLcaac6ca

  • I then launched Visual Studio 2010 SP1 again and it recreated those files and the problem was gone.

Anyways, I hope this helps someone with a similar problem. I created this blog partially for myself but it is always nice to help my fellow developer. 

Thanks for reading.

alt Subscribe to my feed

Posted On Friday, November 18, 2011 7:49 PM | Feedback (6)
Monday, November 14, 2011
Kinect Presentation at Chippewa Valley Code Camp

 

On November 12th 2011, I gave a presentation at Chippewa Valley Code Camp titled, “Kinecting the Dots with the Kinect SDK”. As promised, here is the Slides / Code / Resources to my talk.

image
(click image to download slides)

The Kinect for Windows SDK beta is a starter kit for applications developers that includes APIs, sample code, and drivers. This SDK enables the academic research and enthusiast communities to create rich experiences by using Microsoft Xbox 360 Kinect sensor technology on computers running Windows 7.

Resources :

Download Kinect for Windows SDK beta 2 – You can either download a 32 or 64 bit SDK depending on your OS.

FAQ for Kinect for Windows SDK Beta 2

Kinect for Windows SDK Quickstarts for Windows SDK Beta 2

Information on upgrading Kinect Applications to MS SDK Beta 2. – Brand new post by me on how to upgrade Kinect applications to Beta 2.

Getting the Most out of the Kinect SDK by me for the Microsoft MVP Award Program Blog.

My “Busy Developers Guide to the Kinect SDK” (still references Beta 1 – but most information is still valid)

Helpful toolkits / templates mentioned in the talk.

Coding4Fun Kinect Toolkit – Lots of extension methods and controls for WPF and WinForms.

KinectContrib – Visual Studio 2010 Templates (not updated for Beta 2 as of 11/14/2011).

Fun Projects for learning purposes (all updated to Beta 2):

Kinect Mouse Cursor – Use your hands to control things like a mouse created by Brian Peek.

Kinect Paint – Basically MS Paint but use your hands!

Kinecting the Dots: Adding Buttons to your Kinect Application (not on Beta 2 – but check out the guide by me on how to do this)

Thanks for attending!

I had a really great time at the event and would like to personally thank everyone for coming out to support the local community. 

Thanks for reading.

alt Subscribe to my feed

Posted On Monday, November 14, 2011 4:36 PM | Feedback (0)
Information on upgrading Kinect Applications to MS SDK Beta 2.

 

 

Introduction

Microsoft recently released the Kinect for Windows SDK Beta 2. It contains many enhancements and fixes that can be found here. The only problem with it is that a lot of current demo applications no longer function properly. Today, I’m going to walk you through a typical scenario of upgrading a Kinect application built with Beta 1 to Beta 2.

Note: This tutorial covers WPF, but you can use the same techniques for WinForms.

1) Fix the references

Let’s start with a fairly popular Kinect demo called Kinect User Interface Demo.

SNAGHTML99e3ca4

This project uses the beta 1 version of Microsoft.Research.Kinect.dll and version 1.0.0.0 of Coding4Fun’s Kinect library.

After you download the source code and extract the zip you will see the following references in Visual Studio 2010:

Pay attention to the following references as these are the .dlls that you will have to update:

  • Coding4Fun.Kinect.Wpf
  • Microsoft.Research.Kinect

image

If you click on Coding4Fun.Kinect.Wpf file you will see the following version information (v1.0.0.0):

image

This needs to be upgraded to the Coding4Fun Kinect library built against Beta 2. So head over to http://c4fkinect.codeplex.com/ and hit download and you will have the following files.

image

Go ahead and hit the delete key on your keyboard to remove the Coding4Fun.Kinect.Wpf.dll file from your project. Select “Add Reference” and navigate out to the folder where you extracted the files and select Coding4Fun.Kinect.Wpf.dll.

SNAGHTML4e9332a

If you click on the Coding4Fun.Kinect.Wpf.dll file and check properties it should be listed at 1.1.0.0:

image

Fix Microsoft.Research.Kinect.dll

The official SDK Beta 2 released a new .dll that you will need to reference in your application. Go ahead and select Microsoft.Research.Kinect.dll in your application and hit the Delete key on your keyboard. Go ahead and select Add Reference again and select Microsoft.Research.Kinect.dll from the .NET tab. Double check and make sure the version number is 1.0.0.45 as shown below.

4

References fixed – Runtime needs to be updated.

So we have fixed the references in a typical Kinect application that uses Microsoft’s SDK and C4F Kinect libraries. Now, we will need to update the runtime. All Beta 1 Kinect applications will instantiate the Runtime with the following code:

image

Can you see that it is now marked with [Depreciated]? That means we need to update it before Microsoft decides to remove it from future versions of the SDK.

We can fix this very easily by replacing this code:

readonly Runtime _runtime = new Runtime();

with

Microsoft.Research.Kinect.Nui.Runtime _nui;

and adding similar code to our Loaded event as shown below

public MainWindow()
{
    InitializeComponent();
    Loaded += new RoutedEventHandler(MainWindow_Loaded);
}

void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
    if (Runtime.Kinects.Count == 0)
    {
        txtInfo.Text = "Missing Kinect";
    }
    else
    {
        _nui = Runtime.Kinects[0];
        _nui.Initialize(RuntimeOptions.UseColor);

        // Video Frame Ready Event can happen now!!! 
        //_nui.VideoFrameReady += new EventHandler<ImageFrameReadyEventArgs>(_nui_VideoFrameReady);
        _nui.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);

    }
}

In this sample, I am testing to see if a Kinect is detected and if it is then I initialize the runtime with my first Kinect by using the Runtime.Kinects[0]. You can also specify other Kinect devices here. The rest of the code is standard code that you simply modify however you wish (ie Skeletal, Depth, etc) depending on what type of video feed you want.

Conclusion

As you can see it really wasn’t that painful to upgrade your project to Beta 2. I would recommend that you go ahead and upgrade to Beta 2 as future versions of the SDK will use these methods. 

Thanks for reading.

alt Subscribe to my feed

Posted On Monday, November 14, 2011 7:33 AM | Feedback (1)
Monday, October 31, 2011
My guest-blog post on Kinect for the MVP Award Program Blog

Introduction

I’m sure by now you have heard that the Kinect SDK has been released by Microsoft. I recently had a chance to Guest Blog for the Microsoft MVP Award Program Blog on “Getting the Most out of the Kinect SDK”. Now before we get started learning about it, let’s look at what it is:

*Kinect for Xbox 360, or simply Kinect (originally known by the code name Project Natal),[8] is a motion sensing input device by Microsoft for the Xbox 360 video game console. Based around a webcam-style add-on peripheral for the Xbox 360 console, it enables users to control and interact with the Xbox 360 without the need to touch a game controller, through a natural user interface using gestures and spoken commands.[9] The project is aimed at broadening the Xbox 360's audience beyond its typical gamer base.[10] Kinect competes with the Wii Remote Plus and PlayStation Move with PlayStation Eye motion controllers for the Wii and PlayStation 3 home consoles, respectively.

*Definition taken from the wikipedia article on Kinect

The Full Article

The full article is hosted on the Microsoft MVP Award Program Blog. You can also access it by clicking on the screenshot below. Don’t forget to rate it and leave comments if you wish.

image

mike_new_avatar Michael Crump is a Silverlight MVP and MCPD that works for Telerik as a XAML Evangelist. He has been involved with computers in one way or another for as long as he can remember, but started professionally in 2002. After spending years working as a systems administrator/tech support analyst, Michael branched out and started developing internal utilities that automated repetitive tasks and freed up full-time employees. From there, he was offered a job working at McKesson corporation and has been working with some form of .NET and VB/C# since 2003.

You can follow Michael on Twitter or keep up with his blog by visiting michaelcrump.net or subscribing to his RSS Feed.
Posted On Monday, October 31, 2011 2:39 PM | Feedback (0)
Thursday, October 27, 2011
My Silverlight Show Featured Article Series on Silverlight 5

 

image

Introduction

In case you missed it, I have a 10-part series on Silverlight 5 on SilverlightShow.net. In this extensive guide to Silverlight 5, I give a step-by-step introduction to Silverlight 5, and dives into the features most important to a Silverlight developer.

You can check out the first 3 parts now and I will be adding a new one each week.

The Roadmap for this Series

I’ve included the Roadmap for the series below as you may want to visit other sections as you learn Silverlight 5. I picked the following features as I thought that you may find them useful in your day-to-day work. If you want a specific topic covered then please leave it in the comments below.

1) Introduction to SL5 – This post which provides a brief history of Silverlight and relevant links.

2) Binding - Ancestor Relative Source Binding and Implicit Data Templates.

3) Graphics –XNA 3D API and Improved Graphics Stack.

4) Media - Low-Latency Sound using XNA and Remote Control and Media Command (Keys) Support.

5) Text - Text Tracking and Leading, Linked and Multi-column Text, OpenType Support, Pixel Snapped Text and TextOptions.

6) Operating System Integration Part 1 - P/Invoke, Multiple Windows and Unrestricted File System Access in Full Trust.

7) Operating System Integration Part 2 - Default Filename for SaveFileDialog, 64-bit browser support and Power Awareness.

8) Productivity and Performance - XAML Binding Debugging, Parser Performance Improvements and Multi-core JIT for improved start-up time.

9) Controls - Double and Triple click support, PivotViewer and ComboBox Type-Ahead.

10) Other items - In-Browser HTML, PostScript and Tasks for TPL.

Other Resources by Me:

My webinar on “Getting started with the Silverlight 5 Beta”.

mike_new_avatar Michael Crump is a Silverlight MVP and MCPD that works for Telerik as a XAML Evangelist. He has been involved with computers in one way or another for as long as he can remember, but started professionally in 2002. After spending years working as a systems administrator/tech support analyst, Michael branched out and started developing internal utilities that automated repetitive tasks and freed up full-time employees. From there, he was offered a job working at McKesson corporation and has been working with some form of .NET and VB/C# since 2003.

You can follow Michael on Twitter or keep up with his blog by visiting michaelcrump.net or subscribing to his RSS Feed.
Posted On Thursday, October 27, 2011 12:43 PM | Feedback (2)
Tuesday, October 18, 2011
My Windows 8 Development Article Collection.

 

Below you will find my entire collection of Windows 8 Development Articles. I will focusing on XAML / C# Metro Applications in Windows 8, but may occasionally post on HTML / JS.

Please bookmark this page as I plan on keeping this page updated with my latest Windows 8 articles.

Windows RT XAML/C# Metro Applications

Enabling Frame Rate Counters for XAML Applications in Windows 8
*NEW* - Adding an Application Bar to your XAML Metro Applications.

Windows RT HTML/JS Metro Applications

Enabling Frame Rate Counters for HTML Applications in Windows 8

Windows RT General Education

Download all the Build Videos with RSS
Killer Build Interviews and XAML Sessions.

Using Windows 8 in a Virtual Machine

From Soup to Nuts: Using VirtualBox with Windows 8 Developer Preview

Build Related Information

Bullet Points from Build–Day 1 and my thoughts

Thanks and come back for more Windows 8 Development articles!

mike_new_avatar Michael Crump is a Silverlight MVP and MCPD that works for Telerik as a XAML Evangelist. He has been involved with computers in one way or another for as long as he can remember, but started professionally in 2002. After spending years working as a systems administrator/tech support analyst, Michael branched out and started developing internal utilities that automated repetitive tasks and freed up full-time employees. From there, he was offered a job working at McKesson corporation and has been working with some form of .NET and VB/C# since 2003.

You can follow Michael on Twitter or keep up with his blog by visiting michaelcrump.net or subscribing to his RSS Feed.
Posted On Tuesday, October 18, 2011 6:31 AM | Feedback (0)
Friday, October 14, 2011
I am now an INETA Community Chamption

 

image

Introduction

I recently found out that I have been awarded with the Q3 Community Champion Award from INETA. It is a honor and a privilege to be part of this Elite group of community leaders. I cannot tell you how excited that I am to be acknowledged by my peers for the community work that I do.

Below is what the email said:

I would like to congratulate you on winning the INETA Champion Award for
the third quarter of 2011. I want to personally thank you for your time
and effort in supporting and helping your community. It is through
community members like yourself that we all can impact and influence the
people around us in the software industry.

You will be receiving your award shortly and I would like to request that
you send me your address so we can promptly deliver your award to the
correct mailing address.

This award is an annual award so please remember that you cannot be
awarded the Champions Award for the next 12 months. I do hope you continue
the community support and please accept a big thank you from myself and
the entire INETA board on your accomplishment and dedication.

Learn more about the award

The INETA Community Champion Award is an annual award given to those who give to the developer community. It is awarded on a quarterly basis and lasts for twelve months. Members record their numerous contributions to the community. At the end of each quarter the top contributors will be selected to receive the INETA Community Champion Award.

You already do so much. Why not get RECOGNIZED! Examples of eligible activities are:

  • Writing a newsletter article
  • Updating your user group web site
  • Managing meeting logistics
  • Introducing speakers
  • Presenting at a user group meeting
  • Mentoring new presenters

Winners will be announced after the end of every quarter in the INETA newsletter and on the INETA Website. Each Community Champion will receive a letter of commendation, a certificate of achievement, use of the Community Champion badge and a valuable prize.

Conclusion

I would encourage you to visit the official INETA Community Champion Site and nominate someone that has met the criteria explained above.

Thanks everyone for voting for me and I will continue working hard for the community!

mike_new_avatar Michael Crump is a Silverlight MVP and MCPD that works for Telerik as a XAML Evangelist. He has been involved with computers in one way or another for as long as he can remember, but started professionally in 2002. After spending years working as a systems administrator/tech support analyst, Michael branched out and started developing internal utilities that automated repetitive tasks and freed up full-time employees. From there, he was offered a job working at McKesson corporation and has been working with some form of .NET and VB/C# since 2003.

You can follow Michael on Twitter or keep up with his blog by visiting michaelcrump.net or subscribing to his RSS Feed.
Posted On Friday, October 14, 2011 3:26 PM | Feedback (1)
Wednesday, October 12, 2011
Adding an Application Bar to your XAML Metro Applications.

 

Introduction

We are all familiar with the Application Bars in Windows Phone 7…

image

It can be achieved with a few lines of code as shown below:

<phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar>
        <shell:ApplicationBarIconButton IconUri="/icons/download.png" IsEnabled="True" />
        <shell:ApplicationBarIconButton IconUri="/icons/settings.png" IsEnabled="True" />
        <shell:ApplicationBar.MenuItems>
            <shell:ApplicationBarMenuItem x:Name="mnuReturnToHome" Text="return to home" Click="mnuReturnToHome_Click" />              
        </shell:ApplicationBar.MenuItems>
    </shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>

We want to do the same thing with our new XAML Metro Applications. The good news is that it is just as easy as the Windows Phone 7 with a few other cool features.

Let’s get started…

Fire open Visual Studio 11 and select File->New Project. Then select Visual C# –> Windows Metro Style –> Application and give it a name and hit OK.

 image

Once the MainPage.xaml loads then replace the Grid with the following code snippet:

<Grid x:Name="LayoutRoot" Background="#FF0C0C0C">
    <ApplicationBar VerticalAlignment="Bottom">
        <StackPanel Orientation="Horizontal">
            <Button Content="Exit" x:Name="btnExit" />
        </StackPanel>
    </ApplicationBar>
</Grid>
Now you should be able to run the project with a simple Ctrl+F5 or from the Debug menu. 

image

But you will quickly notice that all you have is a black screen.

image

Note: Black screenshot added for laughs. Smile

App bars are transient by default, which means they start out hidden and only appear in response to a gesture or in this case a right mouse click. If you right click on the application (if using an emulator or a non-tablet device) you will see the application bar appear.

image

You can also press CTRL+ALT+A if you are a keyboard kind of guy/gal.

I want my app bar always visible!

You can make the app bars display at all times by setting the IsPersistent property to True.

<Grid x:Name="LayoutRoot" Background="#FF0C0C0C">
       <ApplicationBar VerticalAlignment="Bottom" IsPersistant="True">
           <StackPanel Orientation="Horizontal">
               <Button Content="Exit" x:Name="btnExit" />
           </StackPanel>
       </ApplicationBar>
   </Grid>

How do you change the way app bars are dismissed?

You can change the way that app bars are dismissed by setting the DismissMode property.

image

From the documentation:

  • The default value is EdgeSwipe, which requires an edge swipe gesture, right-click, or CTRL+ALT+A.
    LightDismiss causes the app bar to disappear when the user interacts main part of the app, and
    TimeDelay causes the app bar to disappear after a specified delay.

In the sample code below you will see that we set two properties. The DismissMode and Delay. (We set this example to hide the application bar after 5 seconds).

<ApplicationBar Background="White" VerticalAlignment="Bottom" DismissMode="TimeDelay" Delay="5000">
   <StackPanel>
         <Button Content="Bottom" Background="Black" />
   </StackPanel>
</ApplicationBar>

Is my app bar limited to the bottom?

No, You may change the VerticalAlignment to any of the following values. The only one that I found beneficial was the Top or Bottom. 

image

As you can see several options exist.

Can I have both a Top Application Bar and a Bottom Application Bar?

Sure, just add in the code similar to the following:

<Grid x:Name="LayoutRoot" Background="#FF0C0C0C">
    
    <!--Top App Bar-->
    <ApplicationBar Background="White" VerticalAlignment="Top" DismissMode="TimeDelay" Delay="5000">
        <StackPanel>
            <Button Content="Top" Background="Black" />
        </StackPanel>
    </ApplicationBar>
 
    <!--Bottom App Bar-->
    <ApplicationBar Background="White" VerticalAlignment="Bottom" DismissMode="TimeDelay" Delay="5000">
    <StackPanel>
          <Button Content="Bottom" Background="Black" />
    </StackPanel>
    </ApplicationBar>

</Grid>

What about adding an Image to my button?

I did it the following way.

<Grid x:Name="LayoutRoot" Background="#FF0C0C0C">
    <ApplicationBar VerticalAlignment="Bottom" DismissMode="TimeDelay" >
        <StackPanel Orientation="Horizontal">
            <Button Content="Exit" x:Name="btnExit" />
            <Button >
                <Button.Content>
                    <Image Height="20" Width="20" Source="c:\users\mbcrump\documents\visual studio 11\Projects\ApplicationBarSample\ApplicationBarSample\Images\SmallLogo.png"/>
                </Button.Content>
            </Button>
        </StackPanel>
    </ApplicationBar>
</Grid>

I am pretty sure there are probably other more elegant ways, but I did it simply using my existing XAML knowledge and the image supplied by the project template. I wanted to see how much of the “use your existing skills” was true.

image

Conclusion

It was pretty easy to get up to speed with the new Application Bar in XAML Metro Applications. I am investing a lot of free time learning how to develop Metro Application using XAML/C#. If you are interested in more articles like these then please look through my last few post on my blog. Also, don’t forget to come back for more articles on a wide range of XAML technologies.

mike_new_avatar Michael Crump is a Silverlight MVP and MCPD that works for Telerik as a XAML Evangelist. He has been involved with computers in one way or another for as long as he can remember, but started professionally in 2002. After spending years working as a systems administrator/tech support analyst, Michael branched out and started developing internal utilities that automated repetitive tasks and freed up full-time employees. From there, he was offered a job working at McKesson corporation and has been working with some form of .NET and VB/C# since 2003.

You can follow Michael on Twitter or keep up with his blog by visiting michaelcrump.net or subscribing to his RSS Feed.
Posted On Wednesday, October 12, 2011 6:38 AM | Feedback (1)
Tag Cloud