Posted by andrewmyhre on March 30, 2008
Note: this post is quite old and probably doesn’t apply to the latest Silverlight 2 release.
I have a Silverlight user control with the following XAML:
<UserControl x:Class=”Continuator.SimpleControl”
xmlns=”http://schemas.microsoft.com/client/2007″
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
Width=”400″ Height=”300″> <Grid x:Name=”LayoutRoot” Background=”White”>
<TextBlock Text=”hello” />
</Grid></UserControl>I want to use it in a ListBox/StackPanel data template. To do so I first add a reference from my Page.xaml:
<UserControl x:Class=”Continuator.Page”
xmlns=http://schemas.microsoft.com/client/2007
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
xmlns:c=”clr-namespace:Continuator;assembly=Continuator”
xmlns:d=http://schemas.microsoft.com/expression/blend/2008
xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″ mc:Ignorable=”d”
Width=”800″ Height=”600″>
(My project namespace is called Continuator). The specifying the assembly is crucial – this won’t work without it and in my case actually caused a bad memory leak. Now add your ListBox to the page, with the control specified in the data template:
<ListBox x:Name=”ProjectsList”>
<ListBox.ItemTemplate>
<DataTemplate>
<c:SimpleControl />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>If you’ve tried this and have had problems, check that you’re including the assembly in the namespace reference. I found this tip in this thread.
Posted in silverlight | Tagged: silverlight | 1 Comment »
Posted by andrewmyhre on March 30, 2008
I was just reading Tim Sneath’s ‘live blog’ of the Ballmer/Kawasaki keynote at Mix, and noticed he blogged my question to Ballmer:
“1:46pm – Attendee: .NET is great and there’s been lots of innovation on this side of the developer platform; why did IE get left out for so long? Steve: partly because Internet Explorer was shipped as part of the operating system and there was a long gap between Windows XP and Windows Vista. You won’t see that kind of gap again – we now understand how to get things decoupled sufficiently to develop innovations separately from the OS and then bring them back later.”
I have to say, out of all the cool things that I was lucky enough to be a part of at Mix, actually talking to the man himself is what stands out in my memory. I’m a guy with absolutely no profile and yet I get the chance to ask him a somewhat impertinent question, and he took me seriously and gave his best answer. To me that’s just cool, and one of the reasons why I like the .Net community so much.
If you haven’t seen it, you can watch the keynote here. I’m at about 39 minutes in
.
Posted in .net, mix08 | Tagged: .net, mix08 | Leave a Comment »
Posted by andrewmyhre on March 28, 2008
Got this obscure error today when setting up a membership provider. I was setting up an ASP.Net Sql Membership Provider for Sharepoint 2007.
First I ran aspnet_regsql.exe for the SQL Express database behind the Sharepoint install, creating a new database in the process just for the ASPNet membership provider data. I then set up a connection string in the web.config for the sharepoint application, and added the <membership> and <roleManager> data to the web.config also. Trying to open the sharepoint site in a browser then yielded the error:
“An unexpected error has occurred. “
To properly diagnose the issue I created a new, blank ASP.Net website, and copied the connectionStrings, membership and roleManager config settings into the web.config for the new site. Then I opened the ASP.Net Administration Tool, and clicked the Security section link, which gave me a much more informative description of the error:
Default Membership Provider could not be found. (C:\TestWebsite\web.config line 17)
Nice! So I added the defaultProvider attribute to the membership element. Next, though, I got a weird error:
“A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 – No process is on the other end of the pipe.)”
Weird. Luckily though, my sixth, or perhaps seventh sense told me it was probably an authentication issue with the database. Sure enough, when I replaced the User ID and Password parts of the connection string with “Integrated Security=true”, the administration tool started working without problems. Copying the changes back into the Sharepoint web.config proved that I’d fixed the issue.
Posted in moss 2007 | Tagged: asp.net, moss 2007, sharepoint | 2 Comments »
Posted by andrewmyhre on March 26, 2008
Well, it’s the first thing I tried. And it’s much, much better. The truth is, I don’t actually care how accurate the estimates are, as long as I see SOMETHING happening.
Posted in Uncategorized | Tagged: vista | Leave a Comment »
Posted by andrewmyhre on March 13, 2008
When you create a TFS 2008 build, there are three build locations you need to be aware of.
First is the location that the build agent ‘gets’ the source to for compilation. You can specify this when creating the Build Agent – just set the Working directory to the location you want the source to be downloaded to. Normally this will be set to the windows temp folder for the account the build service is running under.
The second location is where the build is compiled. This is defined within the Build Definition as the Workspace for the build. TFS copies the source files from the ‘working directory’ to the ‘workspace’ before compilation. It is compiled into a new sub-folder with the same name as the build definition.
Thirdly, you have the option of specifying a build drop location. Your compiled build will be copied here into a new sub-folder, datestamped and versioned by the build number. I haven’t worked out yet how to instruct the build script to deploy a compiled website to a static location. Would love to know if anyone can shed any light!
Posted in CI, tfs | Tagged: Continuous Integration, team build, tfs | 1 Comment »
Posted by andrewmyhre on March 9, 2008
I was intending to write regularly about how things were going at Mix. I was even intending to keep a regular presence on Twitter and interact with the community (also to find out where good clubs were). I now regret opting out of adding the extended battery to my Dell laptop package. My laptop could just barely last a single session, and given we had 15 minutes between talks to do what we needed to do, I prioritised smoking (it’s a networking opportunity!) above charging my laptop. So for the second and third days of the conference I left my laptop in my hotel room and stuck with pen and paper.
It was actually a great decision too. I met dozens of people, simply because I was free to just wonder around, note things down, slip through crowds and get where I wanted to be. I wasn’t ruled by my Device and it’s need for the Mains. It was like leaving the kids with a babysitter. And I think took even better notes than I would have if I’d been typing.
On the whole I stuck with the Silverlight path during the conference – Building Rich Applications 1&2, User Controls, Data Applications etc etc. Also caught the Sharepoint talk on Friday (I was on company orders but it was actually pretty good), Silverlight & Analytics talk. I actually can’t remember what I attended last on friday, mainly because I was experiencing narcilepsy due to lack of sleep.
Right now I’m at the gate waiting to board my plane. I have a stack of cards from people who I need to contact, and notes to disseminate and blog about. I haven’t really had space in my head for the ‘business’ side of things so I need to get home and unwind before I can start making use of the information I’ve absorbed.
Needless to say I’ve had a friggin amazing time. I even saw Scott Guthrie walk past me at one stage and asked Steve Ballmer a question at the keynote. Pretty awesome.
More when I get back.
Posted in mix08 | Tagged: mix08 | Leave a Comment »
Posted by andrewmyhre on March 6, 2008
Absolutely fantastic day. There are loads of bloggers who are quicker and better than me, so I’ll leave it to them. Highlights of today were the two Silverlight 2 sessions, particularly Mike Harsh’s talk, where he demonstrated DeepZoom. Wicked.
Here’s one post about today’s keynote. I need to shower and get down to Tao for the party!
Posted in Uncategorized | Tagged: mix08 | Leave a Comment »
Posted by andrewmyhre on March 5, 2008
Just been reading this post about interview questions, and want to put together a quick list of tasks I want to ask developers to perform during interviews. I’ve been thinking about this a lot over the last couple of months as we’ve interviewed about a dozen developers and the selection process is definitely flawed. A couple of guys who convinced me they were competent developers were two finger typists. Nothing makes your heart sink more than when someone you’ve just hired starts their first day and takes 1 minute to stab out their user name and password when they login for the first time.
Anyway, here’s the list of tasks I’m going to flesh out and start asking interviewees to do:
- Reverse a string
- Swap two values
- Write the output from a program involving inheritance and scope
- Iterate through a linked list
- Write a Pig Latin translator
What I’d like to do is ask for a mixture of pen-and-paper answers and IDE-based answers. The last item on the list definitely lends itself to an IDE implementation.
The above link and others I’ve been reading this evening came from this page.
Posted in Uncategorized | Leave a Comment »
Posted by andrewmyhre on March 5, 2008
So I rocked up to the Venetian today at about 3.45 to register for MIX. There weren’t many there so I breezed through and had my tag and goodie bag by 4.15. Nice! So then it was on to the Pit…
When entering the Pit, immediately to your left is one of the biggest deals for Microsoft this year – Microsoft Surface. We were given a demonstration of the various sample applications we’ve seen before, as well as the opprtunity to try the surface out. It’s works essentially as advertised – multi-touch and very intuitive. I wasn’t massively impressed by the response times; even in the simple Paint application, you didn’t have to move your finger very quickly before the brush would lag behind. I suppose it’s having to do a lot of calculating behind the scenes (it’s running on top of Vista for god’s sake), but it definitely detracts from the illusion that you’re manipulating virtually-tactile screen objects. Sometimes it just plain can’t keep up and misses subtle actions. And when I go back and look at Jeff Han’s multi-touch display demonstration at TED 2006, I just hope the market doesn’t get flooded with Microsoft’s offering before he can get a foothold. His one is just sexier, isn’t it?
Also at the Pit are various labs, for Silverlight, Windows Live and ASP.Net AJAX. The Silverlight labs are Silverlight 1.0 unfortunately, but one of the helpers assured me that after tomorrow’s keynotes there will be Silverlight 2.0 labs available. Totally looking forward to it.
I had a quick lookie at the Rock Band stage, just in time to see three slightly confused guys ‘playing’ (inputting?) Weezer’s Say It Aint So. I haven’t played Rock Band or even Guitar Hero, and I have no intention to, ever. But it’s a pretty good game for spectators, I have to say.
In the goodie bag was a MIX t-shirt (I underestimated my shirt size…), program guides, trial versions of electric rain’s StandOut, ZAM32 and swift.3D software, Telerik RadControls for Silverlight, an Infragistics Resource DVD and a DVD of Visual Studio 2008 Standard Edition, which I’m installing right now. Nice.
Also had the pleasure of meeting Karl Shifflett and Chris Love, at Denny’s no less. Total coincidence – I sit down and order, and next to me are these two guys discussing their blogs and the .Net community; Chris was wearing a Silverlight t-shirt. I took a stab: “Uh, excuse me… are you guys here for the MIX conference by any chance?” Naturally they looked at me as if I was an idiot (or a lunatic!), and said yes. Had a nice chat with them and Karl mentioned he’ll be coming over for DDD in Glasgow in May. Really nice to meet you both – hopefully I’ll see you again over the next few days. Probably at the BlogZone?
Looking forward to tomorrow!
Posted in mix08 | Tagged: mix08 | Leave a Comment »
Posted by andrewmyhre on March 2, 2008
Posted in Uncategorized | Tagged: mix08 | 1 Comment »