Skip to content

How to reference Width of a button from another button (XAML window) #2706

Closed Answered by ElieTaillard
washburnit asked this question in Q&A
Discussion options

You must be logged in to vote
<Button x:Name="Button1" Style="{StaticResource MaterialDesignFlatLightBgButton}"
                            Margin="0,20"  Width="200" Height="45" Cursor="Hand">
</Button>

<Button x:Name="Button2" Style="{StaticResource MaterialDesignFlatLightBgButton}"
                            Margin="0,5"  Width="{Binding Path=ActualWidth, ElementName=Button1}" Height="45" Cursor="Hand">
</Button>

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ElieTaillard
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants