Thursday, November 26. 2009
SharedSize Grid with Silverlight
Since there is no SharedSizeGroup property for the Silverlight Grid I decided to code that myself. It is really helpful if you design a page with multiple Grids on it.
To give you an overview of the usage here is a Silverlight 3.0 XAML file
<UserControl x:Class="SLTestApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ext="clr-namespace:System.Windows.Controls.Extensions;assembly=System.Windows.Controls.Extensions"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
<Grid x:Name="LayoutRoot" Background="White" ext:SharedSize.IsSharedSizeScope="True">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid x:Name="firstfirstGrid" Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" ext:SharedSize.SharedSizeGroup="A"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" ext:SharedSize.SharedSizeGroup="A"/>
</Grid.ColumnDefinitions>
<Border BorderBrush="Green" BorderThickness="2">
<TextBlock x:Name="txtFirstFirst" >
<Run>aa</Run>
<LineBreak />
<Run>aa</Run>
</TextBlock>
</Border>
</Grid>
<Grid x:Name="firstsecondGrid" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" ext:SharedSize.SharedSizeGroup="A"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" ext:SharedSize.SharedSizeGroup="A"/>
</Grid.ColumnDefinitions>
<Border BorderBrush="Blue" BorderThickness="2">
<TextBlock Text="aaaaaaaaaaaaaaaa" />
</Border>
</Grid>
</Grid>
</UserControl>
The current version only works in XAML and does not support adding a Grid or a SharedSize property in code and during runtime. If you need the code, let me know.
Download the release DLL
To give you an overview of the usage here is a Silverlight 3.0 XAML file
<UserControl x:Class="SLTestApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ext="clr-namespace:System.Windows.Controls.Extensions;assembly=System.Windows.Controls.Extensions"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
<Grid x:Name="LayoutRoot" Background="White" ext:SharedSize.IsSharedSizeScope="True">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid x:Name="firstfirstGrid" Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" ext:SharedSize.SharedSizeGroup="A"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" ext:SharedSize.SharedSizeGroup="A"/>
</Grid.ColumnDefinitions>
<Border BorderBrush="Green" BorderThickness="2">
<TextBlock x:Name="txtFirstFirst" >
<Run>aa</Run>
<LineBreak />
<Run>aa</Run>
</TextBlock>
</Border>
</Grid>
<Grid x:Name="firstsecondGrid" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" ext:SharedSize.SharedSizeGroup="A"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" ext:SharedSize.SharedSizeGroup="A"/>
</Grid.ColumnDefinitions>
<Border BorderBrush="Blue" BorderThickness="2">
<TextBlock Text="aaaaaaaaaaaaaaaa" />
</Border>
</Grid>
</Grid>
</UserControl>
The current version only works in XAML and does not support adding a Grid or a SharedSize property in code and during runtime. If you need the code, let me know.
Download the release DLL
Saturday, October 31. 2009
Windows 7 freeze after sleep
Today I tried to install Windows 7 RTM on my media pc. The mainboard is a Gigybyte EG45M-DS2H.
Everything worked fine except the sleep mode. Everytime I set my pc to sleep an wake it up after a while it freezed after a few seconds. To fix this problem, I installed the Intel Inf Chipset drivers and updated the BIOS to the current version (F4).
Now it works like a charm
Everything worked fine except the sleep mode. Everytime I set my pc to sleep an wake it up after a while it freezed after a few seconds. To fix this problem, I installed the Intel Inf Chipset drivers and updated the BIOS to the current version (F4).
Now it works like a charm
Monday, February 23. 2009
Zune installation failure
I just tried to install the zune software in my Vista x64 (German version) machine. Unfortunatelly it fails with an error message:
Installation media not found. The media for installation package 'Watson' couldn't be found. It might be incomplete of corrupted.
The system cannot find the file.
Error Code: 0x80070002
I coudn't figure out the reason for te failure. I think that the Watson package is actually missing
Try to download the full installation package from the Microsoft Download Page
It worked in my case.
I found this solution on this page (Geman)
Installation media not found. The media for installation package 'Watson' couldn't be found. It might be incomplete of corrupted.
The system cannot find the file.
Error Code: 0x80070002
I coudn't figure out the reason for te failure. I think that the Watson package is actually missing
Try to download the full installation package from the Microsoft Download Page
It worked in my case.
I found this solution on this page (Geman)
Thursday, February 19. 2009
Silverlight DataGrid 1.1
I recently stumbled over a bug in the Silverlight 2.0 DataGrid.
If you try to edit a row in the DataGrid and change the ItemSource while in editing mode, you will see a blank line in the area of the edited row (like the first 'row' in the image below).

This also happens when the User has clicked e.g. a button or a CheckBox inside the DataGrid before you change the ItemsSource.
Do fix this issue, simply download a new version of the Silverlight DataGrid at the Microsoft Download Site
If you try to edit a row in the DataGrid and change the ItemSource while in editing mode, you will see a blank line in the area of the edited row (like the first 'row' in the image below).

This also happens when the User has clicked e.g. a button or a CheckBox inside the DataGrid before you change the ItemsSource.
Do fix this issue, simply download a new version of the Silverlight DataGrid at the Microsoft Download Site


/* Comments */