Reputation: 37633
How to get Width or ActualWith of the StackPanel.Children item?
foreach (var item in stackPanel1.Children)
{
// item.Width ???
}
Thank you!
Upvotes: 0
Views: 70
Reputation: 81233
Use FrameworkElement
class since ActualWidth
and Width
belongs to this base class-
foreach (FrameworkElement item in stackPanel1.Children)
{
double width = item.ActualWidth;
}
Upvotes: 2