When I was using the ItemsPanelTemplate of ItemsControl, I found that I couldn't access the component in the backend code. #17597
Unanswered
tangxiaoqi-tangxiao
asked this question in
Q&A
Replies: 1 comment
-
Get it indirectly from the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
back-end code:
private void OnSizeChanged(object? sender, SizeChangedEventArgs e)
{
var newWidth = e.NewSize.Width;
if (GridContentColumn==null)
return;
if (newWidth <= ScreenSize.Md)
{
GridContentColumn.Columns = 3;
}
else if (newWidth <= ScreenSize.Lg)
{
GridContentColumn.Columns = 4;
}
else if (newWidth <= ScreenSize.Xl)
{
GridContentColumn.Columns = 6;
}
else
{
GridContentColumn.Columns = 8;
}
}
The GridContentColumn is always null.
I roughly understand that the components generated by ItemsControl do not include UniformGrid, so how should I obtain the UniformGrid component?
Beta Was this translation helpful? Give feedback.
All reactions