Setting UserControl to stretch/fill on an ItemsControl

3

One quick tip for those using the ItemsControl element on a xaml page. When adding a UserControl as a child, there is no way to force it to occupy the entire region occupied by the ItemsControl. The workaround for this is setting the ItemsPanel template property of the ItemsControl so that it internally uses a DockPanel or Grid.

The following code shows a ResourceDictionary file that does this (reference it in your App.xaml file in order for its elements to be referenced):

<Style TargetType="{x:Type ItemsControl}">
 <Setter Property="ItemsPanel">
  <Setter.Value>
   <ItemsPanelTemplate>
    <Grid/>
   <ItemsPanelTemplate>
  </Setter.Value>
 <Setter>
<Style>

Hope this helps.

Technorati Tags: ,

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

VS 2008 Sp1 Silent Crash Of Death

19

Well, I’ve heard of this bug before, but never had the unfortunate displeasure of experiencing it. Two days ago I started having problems when opening my Shell.xaml file, on a CWPF-based solution (hence the name, by the way). When I dbl clicked the xaml file, the split designer/xaml tab showed up, started loading the designer part (the usual message appears – “Press ESC to cancel”) and suddenly, VS closed silently, discarding any changes I’ve made that far… Pretty neat huh? This has never happened to me before, and this xaml file had no special code written on it. In fact, as the name implies, it is just a shell for other views to use as canvas:

<Window x:Class="Client.Shell"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:cal="http://www.codeplex.com/CompositeWPF"
	xmlns:infra="clr-namespace:Client.Infrastructure;assembly=Client.Infrastructure" Title=Test Height="600" Width="1024" WindowState="Maximized">
	<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="LemonChiffon">
		<ItemsControl VerticalAlignment="Stretch" HorizontalAlignment="Stretch" cal:RegionManager.RegionName="{x:Static infra:RegionNames.AppRegion}" Background="Azure" />
	<Grid>
<Window>

I’ve read one workaround to this, wich was to create a new control or window. Well… The results were disapointing. Creating a new usercontrol or window also infamously crashed my Visual Studio. I started to get really pissed at this. It is really frustrating to work in these conditions.. One thing I’ve tried was to create a user control in another project in the solution, and in this test, everything went normally. Testing this again on the original project, problem remained. So, this is a local project symptom.

I started to wonder what this file had that was so special (or hated) to VS, for it to close so desperately! So I noticed the App.xaml, just sitting there so confortably for so long, and wondered what would happen if I opened it, since it isn’t a visual file and only has Xaml. After clicking it, the xaml appeared in a hurry, no problem there. Then I immediately tested opening my Shell.xaml file again, hoping some internal refresh was made, and, to my surprise, it worked! From that point on, I had no more problems whatsoever.

Let this be a lesson to everyone who experienced this. Still haven’t come up with a reasonable diagnostic to this, but I’ll keep you posted af anything new comes up.

Technorati Tags: , , ,

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

New version of DeepZoom Composer released

0

One of the biggest changes made to the Composer is the new Export UI, witch provides the option of exporting a composition as a Seadragon Ajax project. This will allow you to use the Deep Zoom functionality through javascript.

This version of Deep Zoom Composer is now using a managed DLL instead of the command line tools SparseImageTools.exe and ImageTool.exe. A new project template is also available and numerous bug fixes made.

You can download this new version here.

Technorati Tags:

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Silverlight 2 RC released

0

Today, the Silverlight team released the first public Silverlight 2 Release Candidate. Althogh there are some bugs to be fixed before final release, this earlier release will enable developers to start updating their existing Silverlight applications in order to be ready for the final version, and the green light for their websites to go live.

You can download today’s Silverlight Release Candidate and accompanying VS and Blend support for it here.

Technorati Tags:

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

WPF Toolkit – DataGrid

3

There’s a community project going on at Codeplex called WPF Toolkit that gives you a free themed DataGrid for WPF projects with 7 themes available.

“The WPF Toolkit is a collection of WPF features and components that are being made available outside of the normal .NET Framework ship cycle. The WPF Toolkit not only allows users to get new functionality more quickly, but allows an efficient means for giving feedback to the product team. Many of the features will be released with full source code as well. Over time, some of these features may be moved into the .NET Framework, based on readiness and customer feedback. This is a Community Tech Preview (CTP) Release of the DataGrid control. The download links on this page include a binaries only and a binaries & sources release package…”

Please note that you need to have .NET Framework SP1 installed for the toolkit to function properly.

Technorati Tags: ,

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Page 3 of 3« Previous123

Note: Silverlight, C#, in fact any .NET web development projects is best used with windows hosting than Linux based hosting.