XAML

There are 8 entries for the tag XAML
Custom Controls Everywhere – In XAML

Earlier this year, I talked about how I hadn’t yet seen the need for using the Custom Controls Everywhere approach in XAML.  I said, “Just use the controls you have, apply styles, and attach properties and behaviors.  And if you find a case where this falls short, let me know!” Well, today, Rick Strahl had a tweet: What's the best way to provide cell padding in the Silverlight grid control? Apply margins to all cell child controls? To which I replied: Yeah, unfortunately, margins on all child controls. Or,...

posted @ Thursday, December 11, 2008 9:44 PM | Feedback (0)

Silverlight Control Template Doesn’t Get Applied

This is something that has bitten me several times, so I thought I’d write it down.  Maybe I’ll remember, and maybe I’ll help others when they hit this too. The scenario happens when you want to create a new control that can have a template applied to it.  Let’s start with this control definition: 1: using System; 2: using System.Windows.Controls; 3: using System.Windows.Markup; 4:  ...

posted @ Wednesday, October 29, 2008 6:15 PM | Feedback (6)

Silverlight 2 Gotcha - Tab Navigation in a Popup, Take 2

After I posted about how to regain tab navigation in a popup, Ian commented that the workaround had some flaws.  First, he lost intellisense inside the <UserControl> and second, which is more painful, he could not refer to any controls inside the child <UserControl> from the page's code-behind. Well, I found a more suitable workaround.  Instead of using a <UserControl> to set the TabNagation, you can use a <ContentControl> instead.  Here's the updated workaround code: 1: <UserControl x:Class="PopupTabbing.Page" 2: ...

posted @ Thursday, October 9, 2008 10:54 AM | Feedback (3)

Silverlight 2 Gotcha - Tab Navigation in a Popup

While building an app in Silverlight 2 RC0, I was trying to use a Popup to display a login form.  Pretty basic form: Username, Password, button.  But I immediately noticed that I could not hit Tab to move from one field to the next. Here's some XAML that demonstrates the problem: 1: <UserControl x:Class="PopupTabbing.Page" 2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 4:...

posted @ Tuesday, October 7, 2008 8:44 PM | Feedback (3)

Silverlight 2 Post Beta2 Gotcha - Layout Cycle Detected

Continuing my series of gotchas for Silverlight 2, I wanted to talk about a common error that people are seeing.  This error is something new that you might see when moving code from Beta 2 to the Release Candidate or later.  In Beta 2, if the layout engine detected a cycle, it didn't throw any errors; as I understand it, the layout was just aborted.  But with post Beta2 bits, an error is thrown. The error you'll get will specify "Layout Cycle Detected" as the message.  This error message is very accurate--the layout engine detected a cycle within your layout; or...

posted @ Friday, September 26, 2008 9:46 AM | Feedback (1)

Silverlight 2 Post Beta2 Gotcha - ContentPresenter

As I'm sure you already know, a Release Candidate for Silverlight 2 was published.  ScottGu does an amazing job of covering a lot of information in his blog posts, and others like Mike Snow have also provided some excellent detail.  As they repeatedly told you, go check out the breaking changes document that lists all breaking changes from Beta2 to this release candidate. If you have a Silverlight application that runs against Beta2, please take immediate action to get it moved (in a test environment) to the RC bits.  There were a bunch of breaking changes (all for the better) and...

posted @ Thursday, September 25, 2008 11:37 PM | Feedback (0)

Binding to Nullable Values in XAML

I stumbled upon some behavior awhile back that struck me as odd.  I had a nullable property in my ViewModel that I was binding to in Silverlight, but I found that whenever the value was cleared out by the user, the property setter was not called. I narrowed it down to a simple application that has properties for Name and Age, as follows: 1: public string Name 2: { 3: ...

posted @ Wednesday, July 9, 2008 2:07 PM | Feedback (15)

Custom Controls Everywhere – In XAML

You’ve heard me preach it before.  Custom Controls Everywhere, damn it!  It’s my mantra, my MO, one of my core beliefs for application development. As I started getting used to XAML, I kept thinking about how I’d implement custom controls everywhere and utilize the pattern in the same way I have before.  Since the concept applies equally well to ASP.NET and WinForms, I of course assumed that I would want to apply it to XAML (either Silverlight or WPF) too.  However, while actually doing my work in XAML, I restrained from creating custom controls right off the bat, instead...

posted @ Monday, July 7, 2008 5:05 PM | Feedback (1)