Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I now have an xml as
XML
<Root>
	<Window Width="583" Height="617">
		<Group ID="Info1" Name="M1" >
			<Wrap ID="1" Visibility="1"> 
				<Parameter ID="txtName" Text="Name1" Visibility="1" />
				<Parameter ID="txtName1" Visibility="1"  Width="200"/>
			</Wrap>
		</Group>
		<Group ID="Info2" Name="M2" >
			<Wrap ID="1" Visibility="1"> 
				<Parameter ID="txtcName" Text="Name2" Visibility="1" />
				<Parameter ID="txtcName1" Visibility="1"  Width="200"/>
			</Wrap>
		</Group>
	</Window>
</Root>


My xaml is
XML
<Grid Name="gridCustomer">
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" >
            <GroupBox>
                <GroupBox.Header>
                    <Binding XPath="@Name"></Binding>  //I want to bind the Group ID for Info1 Name property
                </GroupBox.Header>
                <StackPanel>
                    <WrapPanel  Margin="0,10,0,0">
                        <TextBlock Margin="10,0,0,0" Text="Name1" /> //I want to bind the Group ID for Info1 txtName property
                        <TextBox Margin="20,0,0,0" x:Name="txtName"  Width="200"/>
                    </WrapPanel>
				</StackPanel>
			</GroupBox>
		    <GroupBox>
                <GroupBox.Header>
                    <Binding XPath="@Name"></Binding>
                </GroupBox.Header>
                <StackPanel>
                    <WrapPanel  Margin="0,10,0,0">
                        <TextBlock Margin="10,0,0,0" Text="Name2" />
                        <TextBox Margin="20,0,0,0" x:Name="txtName1"  Width="200"/>
                    </WrapPanel>
				</StackPanel>
			</GroupBox>
		</StackPanel>
</Grid>




My background code
C#
string path = "c://1.xml";
        provider.Source = new Uri(path);

        provider.XPath = @"/Root/Window/Group";
        gridCustomer.DataContext = provider;


I want to know how we can achieve these bindings? Specify the name of the binding to the specified node
Posted

1 solution

 
Share this answer
 
Comments
open3820000 25-Feb-14 22:47pm    
These I have read, does not solve my problem, they are bound for the last one, which one would I want what level

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900