One: {Binding elementname=grid0, path=height}
elementname=grid0: Find the name of the GRID0 control.
A path=height: gets The Height property value of the control named grid0 .
namely: the the Lb1 property value is set to sets the value of the Grid0 control's height property.
<GridName= "GRID0"> <Grid> <StackPanelBackground= "AliceBlue"> <BorderHorizontalAlignment= "Left"Height= "+"Cursor= "Hand"Panel.zindex= "2"> <LabelContent= "Back"HorizontalAlignment= "Left"MouseLeftButtonUp= "Label_mouseleftbuttonup"></Label> </Border> <BorderVerticalAlignment= "Top"Margin= "0,-30,0,0"> <Label name= "LB1"Content= "123"horizontalcontentalignment= "Center"verticalcontentalignment= "Center"Height="{Binding elementname=grid0, path=height}"FontSize= "+"FontFamily= "Microsoft Jas Black"></Label> </Border> </StackPanel> </Grid> </Grid>
II: {StaticResource Labelpanelstyle}
Loads a style with the x:key property value equal to labelpanelstyle and a type of lable loaded into the current style (lable)
<usercontrol.resources> <Stylex:key= "Labelpanelstyle"TargetType="{x:type Label}"> <Setter Property= "Foreground"Value= "White"/> </Style></usercontrol.resources><Grid> <Labelx:name= "Bordercontrol"FontFamily= "Microsoft Jas Black"FontSize= " the"Background= "#FF62A0CA"Content= "123"Style="{StaticResource Labelpanelstyle}"></Label></Grid>
WPF Bind binding ElementName Path