Skip to content

Commit 7418cdf

Browse files
authored
Merge pull request #576 from spiegelp/FixDemo
put the content of the demo into ScrollViewer
2 parents 1b98d53 + 8a06b1d commit 7418cdf

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

MainDemo.Wpf/Domain/DocumentationLinks.xaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,24 @@
4646
</ResourceDictionary>
4747
</UserControl.Resources>
4848
<Grid>
49-
<StackPanel Margin="16" Orientation="Horizontal">
50-
<materialDesign:PackIcon Kind="Information" VerticalAlignment="Center" />
51-
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Information Links:</TextBlock>
52-
<ItemsControl Margin="16 0 0 0" ItemsSource="{Binding Documentation}">
53-
<ItemsControl.ItemsPanel>
54-
<ItemsPanelTemplate>
55-
<StackPanel Orientation="Horizontal" />
56-
</ItemsPanelTemplate>
57-
</ItemsControl.ItemsPanel>
58-
<ItemsControl.ItemContainerStyle>
59-
<Style TargetType="ContentPresenter">
60-
<Setter Property="Margin" Value="0 0 32 0"></Setter>
61-
</Style>
62-
</ItemsControl.ItemContainerStyle>
63-
</ItemsControl>
64-
</StackPanel>
49+
<ScrollViewer HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
50+
<StackPanel Margin="16" Orientation="Horizontal">
51+
<materialDesign:PackIcon Kind="Information" VerticalAlignment="Center" />
52+
<TextBlock Margin="8 0 0 0" VerticalAlignment="Center">Information Links:</TextBlock>
53+
<ItemsControl Margin="16 0 0 0" ItemsSource="{Binding Documentation}">
54+
<ItemsControl.ItemsPanel>
55+
<ItemsPanelTemplate>
56+
<StackPanel Orientation="Horizontal" />
57+
</ItemsPanelTemplate>
58+
</ItemsControl.ItemsPanel>
59+
<ItemsControl.ItemContainerStyle>
60+
<Style TargetType="ContentPresenter">
61+
<Setter Property="Margin" Value="0 0 32 0"></Setter>
62+
</Style>
63+
</ItemsControl.ItemContainerStyle>
64+
</ItemsControl>
65+
</StackPanel>
66+
</ScrollViewer>
6567
<Border BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="0 0 0 1" />
6668
</Grid>
6769
</UserControl>

MainDemo.Wpf/MainWindow.xaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@
8080
<domain1:DocumentationLinks DataContext="{Binding ElementName=DemoItemsListBox, Path=SelectedItem}"
8181
Margin="0 0 0 16"
8282
/>
83-
<ContentControl Margin="16" Content="{Binding ElementName=DemoItemsListBox, Path=SelectedItem.Content}"
84-
Grid.Row="1" />
83+
<ScrollViewer Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="16"
84+
HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
85+
<ContentControl Content="{Binding ElementName=DemoItemsListBox, Path=SelectedItem.Content}" />
86+
</ScrollViewer>
8587
<materialDesign:Snackbar MessageQueue="{materialDesign:MessageQueue}" x:Name="MainSnackbar"
8688
Grid.Row="1" />
8789
</Grid>

0 commit comments

Comments
 (0)