I just downloaded the application styles from here and try to use, but thrown the unexpected error: “The tag 'Expander' does not exist in XML namespace 'clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls”
According to Ensuring That Your Silverlight 2 Applications Work with Silverlight 3, in the entry 3.1:
3.1 DockPanel, WrapPanel, Expander, HeaderedContentControl, Viewbox, DataForm moved to the Silverlight Toolkit
The following controls and types have been removed from the Silverlight SDK:
-
DockPanel
-
WrapPanel
-
Expander
-
HeaderedContentControl
-
Viewbox
-
DataForm
-
ExpandDirection
-
ExpanderAutomationPeer
-
LengthConverter
-
StretchDirection
These controls are now in the Silverlight Toolkit, which is available at http://www.codeplex.com/Silverlight.
Then i have change from this…
1: <controls:ChildWindow x:Class="UIOne.ErrorWindow"
2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4: xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
5: DataContext="{Binding RelativeSource={RelativeSource Self}}"
6: Title="Error" >
7:
8: <Grid x:Name="LayoutRoot" Width="400" Margin="2">
9:
10: <Grid.RowDefinitions>
11: <RowDefinition Height="Auto" />
12: <RowDefinition Height="Auto"/>
13: <RowDefinition />
14: <RowDefinition Height="Auto"/>
15: </Grid.RowDefinitions>
16:
17: <TextBlock Grid.Row="0" Text="Sorry, an unknown error occurred in this application." />
18:
19: <TextBlock Grid.Row="1" Text="Please contact your administrator for more information." />
20:
21: <controls:Expander Grid.Row="2" Header="Details" Margin="0, 10, 0, 0" >
22:
23: <TextBox Text="{Binding ErrorDetails}"
24: Height="100"
25: TextWrapping="Wrap" IsReadOnly="True"
26: VerticalScrollBarVisibility="Auto" />
27:
28: </controls:Expander>
29:
30: <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="3" TabIndex="0" />
31:
32: </Grid>
33:
34: </controls:ChildWindow>
….to this
1: <controls:ChildWindow
2: x:Class="UIOne.ErrorWindow"
3: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5: xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
6: xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
7: DataContext="{Binding RelativeSource={RelativeSource Self}}"
8: Title="Error" >
9:
10: <Grid x:Name="LayoutRoot" Width="400" Margin="2">
11:
12: <Grid.RowDefinitions>
13: <RowDefinition Height="Auto" />
14: <RowDefinition Height="Auto"/>
15: <RowDefinition />
16: <RowDefinition Height="Auto"/>
17: </Grid.RowDefinitions>
18:
19: <TextBlock Grid.Row="0" Text="Sorry, an unknown error occurred in this application." />
20:
21: <TextBlock Grid.Row="1" Text="Please contact your administrator for more information." />
22:
23: <controlsToolkit:Expander Grid.Row="2" Header="Details" Margin="0, 10, 0, 0" >
24:
25: <TextBox Text="{Binding ErrorDetails}"
26: Height="100"
27: TextWrapping="Wrap" IsReadOnly="True"
28: VerticalScrollBarVisibility="Auto" />
29:
30: </controlsToolkit:Expander>
31:
32: <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="3" TabIndex="0" />
33:
34: </Grid>
35:
36: </controls:ChildWindow>
Now this works fine :)
See you