Skip to content

Commit

Permalink
chore: add test for ItemsControl
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelMendesRosa committed Sep 5, 2023
1 parent ceb5e0a commit 0eb9f8a
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,66 @@
<ScrollViewer HorizontalScrollMode="Disabled">
<StackPanel Spacing="24">

<StackPanel>
<ItemsControl x:Name="ShadowsItemsControlTest" Background="Yellow">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" Spacing="10" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid ColumnSpacing="5" RowSpacing="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70" />
<ColumnDefinition Width="70" />
<ColumnDefinition Width="60" />
<ColumnDefinition Width="80" />
</Grid.ColumnDefinitions>

<TextBox Grid.ColumnSpan="2"
PlaceholderText="Color"
Text="{Binding Color, Mode=TwoWay, Converter={StaticResource HexToColor}}">
<TextBox.Foreground>
<SolidColorBrush Color="{Binding Color}" />
</TextBox.Foreground>
</TextBox>
<TextBox Grid.Column="2"
PlaceholderText="Opacity"
Text="{Binding Opacity, Mode=TwoWay}" />
<CheckBox Grid.Column="3"
Padding="5,0"
Content="Inner"
IsChecked="{Binding IsInner, Mode=TwoWay}" />

<TextBox Grid.Row="1"
PlaceholderText="X"
Text="{Binding OffsetX, Mode=TwoWay}" />
<TextBox Grid.Row="1"
Grid.Column="1"
PlaceholderText="Y"
Text="{Binding OffsetY, Mode=TwoWay}" />
<TextBox Grid.Row="1"
Grid.Column="2"
PlaceholderText="Blur"
Text="{Binding BlurRadius, Mode=TwoWay}" />
<TextBox Grid.Row="1"
Grid.Column="3"
PlaceholderText="Spread"
Text="{Binding Spread, Mode=TwoWay}" />

</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

</StackPanel>


<!-- Calculator -->
<StackPanel>
<TextBlock Text="Many colored shadows" Style="{StaticResource TitleTextBlockStyle}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public ShadowContainerSamplePage()
var shadowsItemsControl = SamplePageLayout.GetSampleChild<ItemsControl>(Design.Agnostic, "ShadowsItemsControl");
shadowsItemsControl.ItemsSource = _shadows;
var shadowsItemsControlTest = SamplePageLayout.GetSampleChild<ItemsControl>(Design.Agnostic, "ShadowsItemsControlTest");
shadowsItemsControlTest.ItemsSource = _shadows;
}
};
}
Expand Down

0 comments on commit 0eb9f8a

Please sign in to comment.