На своей странице xaml я использую панель ввода, всплывающую сетку и другие элементы c. Мне нужно вызвать эту панель из динамической вкладки c. Но когда я пытаюсь вызвать dockpanel, TabControl.ContentTemplate или Datatemplate, я не могу получить доступ к имени элементов из внутреннего конца (например, к имени док-панели или имени метки)
Так как я могу вызвать имя элемента из bakcend с помощью вкладки Dynami c?
<Grid>
<TabControl Name="tabDynamic" ItemsSource="{Binding}" SelectionChanged="tabDynamic_SelectionChanged">
<TabControl.Resources>
<DataTemplate x:Key="TabHeader" DataType="TabItem">
<DockPanel Name="dockPanel">
<Popup
Name="rdPopup"
AllowsTransparency="True"
IsOpen="True"
Placement="Relative"
PopupAnimation="Fade"
StaysOpen="True"
Width="250" Height="25" HorizontalAlignment="Center" VerticalAlignment="Top">
<i:Interaction.Behaviors>
<krtsc:MouseDragPopupBehavior />
</i:Interaction.Behaviors>
<Border
BorderBrush="DeepSkyBlue"
BorderThickness="2"
CornerRadius="0,0,5,5">
<Grid
Margin="0,0,0,0"
VerticalAlignment="Stretch"
Background="DeepSkyBlue">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="170" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<Label
Name="lblSer"
Grid.Column="0"
HorizontalAlignment="Left"
VerticalAlignment="Top" FontSize="12" Height="25"/>
<Button
Name="btnMi"
Grid.Column="2"
HorizontalAlignment="Right"
Click="btnMinimize_OnClick"
ToolTip="{DynamicResource PopupMinimize}">
<Button.Template>
<ControlTemplate>
<Image
Width="15"
Height="15"
Source="{DynamicResource IconWindowMinimize}" />
</ControlTemplate>
</Button.Template>
</Button>
<Button
Name="btnMenu"
Grid.Column="3"
HorizontalAlignment="Right"
Click="btnMenu_OnClick"
Visibility="Hidden"
ToolTip="{DynamicResource ToggleMenu}">
<Button.Template>
<ControlTemplate>
<Image
Width="15"
Height="15"
Source="{DynamicResource IconToggleMenu}" />
</ControlTemplate>
</Button.Template>
</Button>
<Button
Name="btnRestore"
Grid.Column="4"
HorizontalAlignment="Right"
Click="btnRestore_OnClick"
ToolTip="{DynamicResource PopupRestore}" >
<Button.Template>
<ControlTemplate>
<Image
Width="14"
Height="15"
Source="{DynamicResource IconWindowRestore}" />
</ControlTemplate>
</Button.Template>
</Button>
<Button
Name="btnClose"
Grid.Column="5"
HorizontalAlignment="Right"
Click="btnClose_OnClick"
ToolTip="{DynamicResource PopupClose}">
<Button.Template>
<ControlTemplate>
<Image
Width="15"
Height="15"
Source="{DynamicResource IconWindowClose}" />
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</Border>
</Popup>
<StatusBar
Name="statusBar"
DockPanel.Dock="Bottom" Height="50" VerticalAlignment="Bottom" HorizontalAlignment="Center">
<Label
Name="lblConnection"
Content="{DynamicResource Connecting}"
Foreground="#001934" />
<ProgressBar
Name="progressBar"
Width="200"
Height="15"
IsIndeterminate="True" />
</StatusBar>
</DockPanel>
</DataTemplate>
<Style TargetType="TextBox">
<Setter Property="VerticalAlignment" Value="Stretch"></Setter>
<Setter Property="HorizontalAlignment" Value="Stretch"></Setter>
<Setter Property="AcceptsReturn" Value="True"></Setter>
<Setter Property="TextWrapping" Value="WrapWithOverflow"></Setter>
<Setter Property="MaxLines" Value="5000"></Setter>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"></Setter>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"></Setter>
</Style>
</TabControl.Resources>
</TabControl>
</Grid>