C# WPF在用户控件的中间或内部放置一个分组框
我得到了一个名为Palabok的用户控件:C# WPF在用户控件的中间或内部放置一个分组框,c#,wpf,xaml,C#,Wpf,Xaml,我得到了一个名为Palabok的用户控件: <UserControl x:Class="NeocClinic.WPFSystem.Templatas.Palabok" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xml
<UserControl x:Class="NeocClinic.WPFSystem.Templatas.Palabok"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0"></Button>
</Grid>
</UserControl>
然后我将其实现到我的WPF窗口:
<Window x:Class="NeocClinic.WPFSystem.IrritantDetailsForm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:windowsControls="clr-namespace:NeocClinic.WPFSystem.Templatas"
Title="IrritantDetailsForm" Height="300" Width="300">
<windowsControls:Palabok ></windowsControls:Palabok>
</Window>
我的问题是,我想将带有刺激物个性化组件/控件的组框添加到将在Palabok用户控件的网格中显示的窗口中。然后,我将对另一个WPF窗口使用相同的用户控件,但将图像控件放在网格中。Palabok用户控件的Column=2而不是Group Box,但我似乎无法将控件放在Palabok用户控件中。我认为您的控件应该继承自ItemsControl 请检查: