<Page
xmlns:local="clr-namespace:FinancialInstrumentSearcher"
xmlns="http://schemas.microsoft.com/winfx/2...l/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:t="clr-namespace:NinjaTrader.Gui.Tools;assembly=NinjaTrad er.Gui"
xmlns:editors="http://infragistics.com/Editors"
Title="LoadXAMLPage" MinHeight="700" MinWidth="900" MaxHeight="700" MaxWidth="900"
>
<Grid>
<TreeView x:Name="myTreeView">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Path=instrumentsGroups}">
<StackPanel Orientation="Horizontal">
<CheckBox
Focusable="False"
IsChecked="{Binding IsChecked}"
VerticalAlignment="Center"
/>
<TextBox x:Name="myTextBox" Text="{Binding Name}" />
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</Grid>
</Page>
I have cs:
public class FISWindowTabPage : NTTabPage
{
private Button exampleButton;
TextBox myTextBox;
TreeViewItem treeViewItem;
IList<InstrumentList> instrumentsGroups;
public FISWindowTabPage()
{
// the content of the page will go here.
Content = LoadXaml();
instrumentsGroups = InstrumentList.All;
//myTextBox = LogicalTreeHelper.FindLogicalNode(Content as DependencyObject, "myTextBox") as TextBox;
//myTextBox.Text = "b!";
//myTextBox.SetBinding(TextBlock.TextProperty, new Binding { Source = nodes, Path = new PropertyPath("Text") });
}
...
I have learned to change myTextBox.Text.
How can I use Binding in <HierarchicalDataTemplate ItemsSource="{Binding Path=instrumentsGroups}"> to deploy instrumentsGroups in TreeView with Checkboxes?
Thank You!
Comment