Skip to content

Commit e9802e7

Browse files
committed
Successfully injected XamlDisplayerPanel into GroupBoxes.xaml
1 parent 80b0df0 commit e9802e7

File tree

2 files changed

+30
-35
lines changed

2 files changed

+30
-35
lines changed

MainDemo.Wpf/GroupBoxes.xaml

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
77
xmlns:local="clr-namespace:MaterialDesignDemo"
8+
xmlns:codeDisplayer="clr-namespace:CodeDisplayer;assembly=CodeDisplayer"
89
mc:Ignorable="d"
910
d:DesignHeight="300" d:DesignWidth="300">
1011
<UserControl.Resources>
@@ -16,44 +17,36 @@
1617
</ResourceDictionary>
1718

1819
</UserControl.Resources>
19-
<Grid>
20-
<Grid.ColumnDefinitions>
21-
<ColumnDefinition/>
22-
<ColumnDefinition/>
23-
<ColumnDefinition/>
24-
</Grid.ColumnDefinitions>
25-
<Grid.RowDefinitions>
26-
<RowDefinition/>
27-
<RowDefinition/>
28-
</Grid.RowDefinitions>
29-
30-
<GroupBox Grid.Column="0" Grid.Row="0" Header="Default Look" Margin="16">
31-
<TextBlock>My Content</TextBlock>
32-
</GroupBox>
20+
<ScrollViewer>
21+
<codeDisplayer:XamlDisplayerPanel x:Name="XamlDisplayerPanel">
22+
<GroupBox Width="200" Height="100" Header="Default Look" Margin="16">
23+
<TextBlock>My Content</TextBlock>
24+
</GroupBox>
3325

34-
<GroupBox Grid.Column="1" Grid.Row="0" Header="Shadow Header" Style="{DynamicResource MaterialDesignGroupBox}" Margin="16" materialDesign:ShadowAssist.ShadowDepth="Depth3" BorderThickness="0">
35-
<TextBlock Margin="6,6,6,6" TextWrapping="Wrap">Short loin picanha boudin pork belly. Ground round porchetta biltong, cow t-bone tri-tip strip steak chuck filet mignon jowl turducken. Landjaeger strip steak pork chop, jowl sirloin pork capicola andouille. Kevin ribeye tongue, drumstick hamburger frankfurter t-bone corned beef beef biltong cow venison. Biltong picanha bresaola pork belly, filet mignon spare ribs doner pork chop kielbasa. Swine flank drumstick pork belly pancetta spare ribs rump filet mignon.</TextBlock>
36-
</GroupBox>
26+
<GroupBox Header="Shadow Header" Style="{DynamicResource MaterialDesignGroupBox}" Margin="16" materialDesign:ShadowAssist.ShadowDepth="Depth3" BorderThickness="0">
27+
<TextBlock Margin="6,6,6,6" MaxWidth="300" TextWrapping="Wrap">Short loin picanha boudin pork belly. Ground round porchetta biltong, cow t-bone tri-tip strip steak chuck filet mignon jowl turducken. Landjaeger strip steak pork chop, jowl sirloin pork capicola andouille. Kevin ribeye tongue, drumstick hamburger frankfurter t-bone corned beef beef biltong cow venison. Biltong picanha bresaola pork belly, filet mignon spare ribs doner pork chop kielbasa. Swine flank drumstick pork belly pancetta spare ribs rump filet mignon.</TextBlock>
28+
</GroupBox>
3729

38-
<Border Grid.Column="2" Grid.Row="0" Background="{DynamicResource MaterialDesignBackground}">
39-
<GroupBox Header="Transparent Background" Style="{DynamicResource MaterialDesignGroupBox}" Margin="16" UseLayoutRounding="True" SnapsToDevicePixels="True">
30+
<Border Background="{DynamicResource MaterialDesignBackground}">
31+
<GroupBox Header="Transparent Background" Style="{DynamicResource MaterialDesignGroupBox}" Margin="16" UseLayoutRounding="True" SnapsToDevicePixels="True">
32+
<TextBlock>My Content</TextBlock>
33+
</GroupBox>
34+
</Border>
35+
<GroupBox Header="Accent Header" Style="{DynamicResource MaterialDesignGroupBox}" Margin="16" materialDesign:ColorZoneAssist.Mode="Accent">
4036
<TextBlock>My Content</TextBlock>
4137
</GroupBox>
42-
</Border>
43-
<GroupBox Grid.Column="0" Grid.Row="1" Header="Accent Header" Style="{DynamicResource MaterialDesignGroupBox}" Margin="16" materialDesign:ColorZoneAssist.Mode="Accent">
44-
<TextBlock>My Content</TextBlock>
45-
</GroupBox>
4638

47-
<GroupBox Grid.Column="1" Grid.Row="1" Header="Card Group Box" Style="{DynamicResource MaterialDesignCardGroupBox}" Margin="16">
48-
<GroupBox.HeaderTemplate>
49-
<DataTemplate>
50-
<StackPanel Orientation="Horizontal">
51-
<materialDesign:PackIcon Kind="ImageArea" Height="32" Width="32" VerticalAlignment="Center" />
52-
<TextBlock Margin="8,0,0,0" VerticalAlignment="Center" Style="{StaticResource MaterialDesignSubheadingTextBlock}" Text="{Binding}"/>
53-
</StackPanel>
54-
</DataTemplate>
55-
</GroupBox.HeaderTemplate>
56-
<Image Source="Resources/Contact.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
57-
</GroupBox>
58-
</Grid>
39+
<GroupBox Header="Card Group Box" Style="{DynamicResource MaterialDesignCardGroupBox}" Margin="16">
40+
<GroupBox.HeaderTemplate>
41+
<DataTemplate>
42+
<StackPanel Orientation="Horizontal">
43+
<materialDesign:PackIcon Kind="ImageArea" Height="32" Width="32" VerticalAlignment="Center" />
44+
<TextBlock Margin="8,0,0,0" VerticalAlignment="Center" Style="{StaticResource MaterialDesignSubheadingTextBlock}" Text="{Binding}"/>
45+
</StackPanel>
46+
</DataTemplate>
47+
</GroupBox.HeaderTemplate>
48+
<Image Source="Resources/Contact.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
49+
</GroupBox>
50+
</codeDisplayer:XamlDisplayerPanel>
51+
</ScrollViewer>
5952
</UserControl>

MainDemo.Wpf/GroupBoxes.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Windows.Media.Imaging;
1313
using System.Windows.Navigation;
1414
using System.Windows.Shapes;
15+
using MaterialDesignDemo.Helper;
1516

1617
namespace MaterialDesignColors.WpfExample
1718
{
@@ -23,6 +24,7 @@ public partial class GroupBoxes : UserControl
2324
public GroupBoxes()
2425
{
2526
InitializeComponent();
27+
XamlDisplayerPanel.Initialize(new SourceRouter(this.GetType().Name).GetSource());
2628
}
2729
}
2830
}

0 commit comments

Comments
 (0)