Windows 8 and Metro Style apps
8 Dec 2011 11:39 AM

(Yes, there's not a hyphen in Metro Style apps. I don't get it, but I'm sure some day it will be made clear.)

Since attending the Build conference that Microsoft held in September, I've been the proud owner of a Samsung tablet device running the Developer Preview build of Windows 8, along with a preview version of Visual Studio 11 Express. Given these tools, the only kinds of apps I can build are native Windows 8 Metro style apps--you know, the ones that run full screen, are "fast and fluid", and look really BIG.

Like the new UI or not, one thing is sure: the whole concept of Metro style apps is based on the HTML5/CSS3/JavaScript stack. Sure, you can create apps using C#/VB/C++ and XAML, and that works fine if you're already comfortable with those technologies. But if you're starting on developing WIndows apps now, and want to create Metro style apps, I would certainly contemplate jumping right into the JavaScript world.

Coming from a VB/C#/XAML background, I didn't find the transition to JavaScript particularly easy--I'm still struggling a little. Since IntelliSense support in Visual Studio 11 for JavaScript is there, but not particularly specific, using IntelliSense to help guide you as you create code will generally be not much help. It may improve over time, but since JavaScript relies on being late bound, it's awfully hard for the tool to predict the data type of the assignment without some contextual information.

On the other hand, using HTML and CSS to create layout means that you're taking advantage of tools and technologies that also allow you to use your skills creating Web sites, and there's something to be said for that.

It remains to be seen how well the Microsoft Store will do with consumers, but I'd bet that this is a really good time to start creating useful, touch-aware Metro applications for sale in the Microsoft Store. Once the "doors open", we'll see a lot of applications become available. I'm waiting to see how business applications, such as word processors and spreadsheets, do in a finger-driven world. Using Excel on the Windows desktop, on the Samsung tablet, is a bit of a challenge without a keyboard and mouse. No consumer will put up with this, and business productivity will require finger-sensitive replacement applications. It works on the iPad, it can work in Windows 8 as well.

It's worth downloading the Developer Preview (or the upcoming beta) of Windows 8 to spend some time with it. It's going to be an interesting 2012, that's for sure!

by KenG | with no comments
10 Years Later
16 Jun 2011 1:31 PM

Yes, it's been 10 years since .NET first got rolling, and I certainly feel (and look) ten years older! Technology, like biology, doesn't stand still, and things are, as always, changing.

You'd have to be very optimistic (or naive) to convince yourself that you can stop learning new stuff and continue to be employed, and I feel a major shift heading our way again. .NET is great, I love C# and VIsual Basic, but there's a new wave headed our way: HTML5, CSS3, and Javascript.

This link arrived in my inbox this morning: http://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83. The "Web Standards Update for Visual Studio 2010 SP1" adds support for HTML5 and CSS3, and you'd better believe that if you're not working with these platforms now, some day you probably will be.

If you have some spare cycles, I suggest you take some time and start investigating how HTML5, CSS3, and Javascript will play out. I'm digging in...

by KenG | with no comments
Comparing Development for iPhone, Android, and Windows Phone 7
9 Mar 2011 10:24 AM

Been buried writing a short presentation (well, 6-8 hours) on developing mobile applications for iPhone (using C# and MonoTouch), Android (using C# and MonoDroid) and Windows Phone 7 (using Visual Studio 2010 and Silverlight). Being comfortable with Silverlight, the WP7 application came together the easiest, that's for sure! The goal was to write code that could be used by all three platforms. Without conditional compilation, I wasn't able to make it a smooth sharing of code, although I tried, goodness knows I tried.

I'll reserve judgments for later, but I can certainly say that using MonoTouch is far, far easier than learning Objective C on the Mac. (MonoTouch development does require a Mac, however--you can write the code in C#, however.) Haven't spent much time with Android yet, but it appears that in the build of MonoDroid I investigated, there wasn't a UI designer. No fun there. Finally, creating WP7 apps using Silverlight feels like coming home to an old friend. Of course, I was dealing with calling a REST service from Flickr, and the service call must be made asynchronously, which adds to the fun.

The good news: Every time I hit a snag on either the MonoTouch or WP7 app, I was able to find online content that helped me solve the problem. Both simple apps got built. The bad news: I hit lots of snags that required me to go online searching for help. I'm embarrassed to say how long I spent working on these two little apps. 

Treat a DropBox Folder as a Drive
5 Sep 2010 11:21 AM

I'm an avid DropBox user-- I love that I can have a folder in my file system (along with any subfolders) automatically backed up online securely, and automatically synched with any and all of my computers. I love that I can share a file with anyone by simply dragging it into the Public subfolder and sending the link to someone via email.

I ran across this tip recently, for creating a drive letter associated with the folder. (This isn't new news, at all--I just hadn't thought of it.)

Use the SUBST command to assign a drive letter. To do so, create a BAT file in the STARTUP folder (select START|RUN and type Shell:Startup). In the BAT file, add statements like the following:

subst /d X:
subst X: "C:\Users\[user]\Documents\My Dropbox"

That's all it takes! Now when I boot up, Drive X: refers to my dropbox folder. Like I said, not a new tip by any means, but it certainly makes working with DropBox easier.

If you still don't have a free DropBox account, use this link (you and I both get a little more free storage space, if you do!): http://www.dropbox.com/referrals/NTU2MzQyNjk

 

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

by KenG | with no comments
Visual Studio Lightswitch: What Microsoft Access Could Have Been?
6 Aug 2010 4:48 PM

As you might know, Microsoft announced the new product, Visual Studio Lightswitch at the Visual Studio Live conference in Redmond this week (watch the keynote here). I'm excited to give this product a try, as I have several data-oriented applications for the home and extra-curricular activities that really don't require or deserve the full "from the start" development process.

On the other hand, it appears the VSLS (my acronym, not theirs) might provide the simplest way to create the applications I need, for tracking ticket sales and donors for a non-profit theatre group.

For years, when asked (and even when not asked) I've been telling folks at Microsoft what I think Access ought to become: a database-oriented design tool for beginners that generates XAML markup and a project that can then be loaded into Visual Studio for development purposes. Unfortunately, the lure of Sharepoint called Access in that direction, and it never became the XAML-producing tool I had hoped for.

VSLS, however, seems to be aimed in this direction. Don't let anyone tell you that it's a tool for beginners. Yes, if you let it do its default thing, a beginner can create a database-aware application that consumes and operates on data from many different sources, including SQL Azure. In addition to its default output, developers can open the project in Visual Studio Professional (or above) and can modify to their hearts' content. Unlike Microsoft Access (or even worse, tools like the VB6 Data Environment), this tool lends itself to further exploration and deeper modification.

The beta is due out on Aug 23. Give it a look--I will be spending some quality time with it. Let's kick the tires and see what we can create...

by KenG | with no comments
Silverlight and WPF not equivalent in VS 2010 Designers
22 Jul 2010 4:08 PM

You probably think that the Silverlight and WPF designer support is similar, if not equivalent, in Visual Studio 2010. Not quite.

Yes, the tools are the same, and yes, the "look and feel" is the same.

But there are several cases in which the behavior is different. One came up recently while recording the Silverlight and WPF courses, Part II. I was covering a chapter on shapes, and wrote the same code for both courses that displayed various shapes in a Canvas control. When I tried the WPF project, everything appeared in the designer, as I expected. In the Silverlight project, many times, the shapes didn't appear at design-time at all, but only at runtime.

Beware when using Visual Studio to design Silverlight applications that use shapes, curves, and other drawing features--you may need to view the application at runtime to determine if you have created the correct markup. An alternative, of course, is to use a different XAML-based editor (Expression Blend, anyone?)

by KenG | with no comments
GeekFest at TechEd
25 May 2010 7:48 PM

Let’s face it, going to a technical conference is good for your career but it’s not a whole lot of fun. You need an outlet. You need to have fun.

Cheap beer and lousy pizza (with a New Orleans twist)

We are bringing back GeekFest! Join us at Pat O’Brien’s for a night of gumbo, beer and hurricanes. There are limited invitations available, so what are you waiting for? If you are attending the TechEd 2010 conference and you are a developer, you are invited. To register pick up your "duck" ticket (and wristband) in the TechEd Technical Learning Center (TLC) at the Developer Tools & Languages (DEV) information desk.

You must have wristband to get in.

Tuesday, June 8th from 8pm – 11pm
Pat O’Brien’s New Orleans
624 Bourbon Street New Orleans, LA 70130

 

VB Parity for examples
24 May 2010 6:18 PM

Unfortunately, Microsoft has been tardy on creating both Visual Basic and C# samples for many products. Recently, they've been catching up. Here are the details:

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

WCF/WF: 236 Samples (WF_WF_Samples.zip)

WCF/WF: 240 Help topics

WPF: 350 Help topics

SharePoint 2010: Developer Training Kit

SharePoint 2010: 300 Help Topics

Parallel Programming MSDN Magazine Articles (VB Code now included inline): Debugging Task-Based Parallel Applications in Visual Studio 2010 | Data-Parallel Patterns and PLINQ | Solving 11 Likely Problems In Your Multithreaded Code | False Sharing

Parallel Programming: Patterns for Parallel Programming Paper: Understanding and Applying Parallel Patterns with the .NET Framework 4

Visual Studio 2010 Extensibility Samples: Build Progress Bar | Alpha Blend ToolBar | Winforms Control Installer | Spell Checker (VB versions going live this week) | Overview Margin (VB versions going live this week)

Visual Studio 2010 and .NET Framework 4: Training Kit

Visual Studio 2010 Community Launch Materials: Dev-Designer Collaboration | Projects on Track | Personalizing Your Environment | Using Your Existing Skills | Windows 7 for Developers (VB versions going live this week)

Visual Basic 10.0 Language (Additional Samples for Python & Simple Variance): VB Samples -> Language directory

Silverlight: Jesse Liberty’s mini-tutorial blog posts: SL HyperVideo | Silverlight/MEF/HVP | Project Turing RIA Services | Project Turing Multiple Tables | Silverlight TDD | MVVM

MEF: Glen Block blog: Hello MEF in Silverlight 4 and VB!  

Expression Encoder 3 Samples: http://encoder3vb.codeplex.com/

Expression Encoder 4 Samples (shipping in the Expression Encoder 4 SDK)

Windows Phone 7 Series: Still to come. Watch for more details.

 

by KenG | with no comments
Don't Need to Stinkin' Flash
10 Mar 2010 8:54 AM

I don't know about you, but I hate (with a passion) blinking/flashing/rotating junk on web pages when I'm trying to do research. The distraction is bad enough, but Flash is a big security problem (so I've been told--I've never personally had a problem with it) and takes time and bandwidth on my very limited pipe to the rest of the world.

I use FireFox as my daily browser (IE, Chrome, and Safari for testing), and have installed the Flashblock add-on in FireFox. It's a miracle! No more Flash (unless I want it). This add-on allows you to choose, on every page, whether to display the Flash content or not. Pages load faster, there's no distractions, and no Flash stuff unless I need it. If you're interested, the link is here:

https://addons.mozilla.org/en-US/firefox/addon/433

 

by KenG | with no comments
Modify Resources at Runtime in WPF
9 Mar 2010 9:32 AM

In general, it's no problem to modify WPF resources at runtime. You can use the TryFindResource method to search the same path as the XAML parser, given a starting point, and a name for the resource. like this:

Button btn = (Button)sender;
var brush =
  (SolidColorBrush)(btn.TryFindResource("TextBrush"));

if (brush != null)
{
  brush.Color = Colors.Red;
}

The problem comes in trying to modify application-level resources. In order to optimize for performance, application-level resources are frozen (that is, their IsFrozen property is set to True), so WPF "knows" that it doesn't need to monitor them for changes. What if you want to modify one one of these resources? That requires cloning the resource, making changes, and then applying it, like this (this example attempts to swap the colors in a RadialGradientBrush). One note: Because this code actually changes the content of the resource, in order for the markup to "notice" the change, the resource must be declared as a DynamicResource in the markup (as opposed to the more common StaticResource):

Button btn = (Button)sender;
RadialGradientBrush brush =
  (RadialGradientBrush)(btn.TryFindResource("BackgroundBrush"));

if (brush != null)
{
  // Swap the colors in the RadialGradientBrush:
  Color color = brush.GradientStops[1].Color;
  if (brush.IsFrozen)
  {
    // If it's frozen, you must create a copy,
    // modify it, and then apply it. This requires the
    // consumer of the resource to be dynamic.
    RadialGradientBrush newBrush = brush.Clone();
    newBrush.GradientStops[1].Color =
      brush.GradientStops[0].Color;
    newBrush.GradientStops[0].Color = color;
    Application.Current.
      Resources["BackgroundBrush"] = newBrush;
  }
  else
  {
    brush.GradientStops[1].Color =
      brush.GradientStops[0].Color;
    brush.GradientStops[0].Color = color;
  }
}

by KenG | with no comments
Filed under:
WPF the same as Silverlight? Don't think so...
4 Mar 2010 9:57 AM

Currently working on courseware for both Silverlight and WPF concurrently (perhaps not the wisest recent decision). My theory was (and note the past tense) that they both use XAML to describe their UIs, so how far apart could they be? I have spent the better part of a week creating a simple (actually, not simple at all) demo project to show off some of the simple controls in WPF and Silverlight (you know the drill: Button, TextBox, Slider, CheckBox, RadioButton--all the old favorites). Turns out that the behavior is very, very different between WPF and Silverlight, often in mystifying ways. Things that work in one environment aren't available in the other. The cut-down .NET Framework in Silverlight is far more limited than you would imagine (although it seems like a miracle that it works at all.)

My suggestion, if you're creating an app that you want to run both in WPF and Silverlight (and I'm not sure why anyone except courseware authors would do this): Create the Silverlight version first. Because its behavior is so limited, you're better off converting from Silverlight to WPF than the other way around. Beware, however, that some things work in Silverlight and not in WPF, so there are issues no matter which direction you go. (For example, in Silverlight, the MediaElement control will play a WMV file stored as a resource in the current project. I cannot get the WPF version to play the video--I ended up using an external file path instead.)

Do not fall into the trap: WPF and Silverlight may look and feel similar, but in fact, they're very different, with distinct issues and learning curves.

by KenG | with no comments
Who Needs a Kindle?
21 Jan 2010 11:57 AM

I've been reading a lot of books published by Amazon Kindle, but I refuse to carry (and pay for) another device. I've been reading books from Kindle on my iPhone, and it works great for me. Yes, you end up flipping pages a lot, but you can make the font quite large, and it works great for me. Recently, Amazon also released a Kindle app for the PC (Mac coming soon). You can download the free app here: http://www.amazon.com/gp/feature.html/ref=kcp_pc_mkt_lnd?docId=1000426311. I've tried it, and it works great, syncing the current page with my iPhone, so I can flip back and forth between devices. With a tablet PC, this would be a killer app. I do wish you could print pages directly from the application, but I understand why you cannot. On the other hand, armed with any screen capture utility, you can capture and print individual pages quite nicely (which I'm doing at this moment with the free "Cook's Illustrated How-To-Cook Library" that I have in my Kindle library.

Will I read books on my PC? Probably not. But I'm far more likely now to buy technical books from Kindle than I would have otherwise, and to be honest, I'm pretty tired of buying technical books in dead-tree format. On the other hand, you can resell a physical book when you're done with it, and you cannot with a kindle book.

 

Using a Solid Background in Windows 7 to Optimize Performance? Think Again!
18 Jan 2010 9:55 PM

I was floored to find this article online today. I always change the background to a solid color, assuming that not having to deal with a graphic on the desktop would save processing power. Boy, was I wrong!

http://lifehacker.com/5451159/solid+color-backgrounds-cause-30+second-login-delay-in-windows-7?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+lifehacker%2Ffull+%28Lifehacker%29

I haven't had time to test this out, but it's certainly worth knowing about. Who would'a thunk?

by KenG | with no comments
Karl Shifflett's XAML Power Tools
30 Dec 2009 9:31 AM

If you're developing in WPF or Silverlight, or even thinking about doing it, here's a MUST HAVE download: Karl's XAML Power Toys are an incredible set of useful tools. My favorite? The tool that extracts the style from an existing control and converts it into (you guessed it) a style, so you can reuse it on other controls. Visual Studio 2010 has a similar feature, but as far as I can tell, works only on a single property. That's not much help! The XAML Power Toys includes far more, as well, and you can try the beta version for Visual Studio 2010, as well. These tools are highly recommended, and highly regarded out there in the wild. Go for it!

by KenG | with no comments
I Love DropBox!
14 Oct 2009 3:49 PM

I may have mentioned this before, but I do love DropBox. It's free (for 2GB of offline storage) and it syncs a folder (your "dropbox") between as many computers as you care to install the product on. So you get synchronization between computers, and free offline storage for up to 2GB of data. I love it, because it also stores revisions of your documents! I do all my current project work in my dropbox (that is, I store current projects in this specific folder, or child folders of the main folder), and all the current work is automatically backed up every time a file changes, and it's also synced across all my computers.

Yes, I know there are other ways to get this behavior. Microsoft's Live Mesh does some of this, along with Microsoft's SkyDrive. For some reason, I've found the DropBox features fit my needs exactly.

And, if you sign up and install it, I get more free space! So please, if you're interested, follow this link to sign up:

https://www.getdropbox.com/referrals/NTU2MzQyNjk

 

by KenG | with no comments
More Posts Next page »