I have a user control will be populated with list of userControls by a button add in the TOP left (stackPanel in the left of parent UserControl),
after many UserControls inserted the screen will be scrolled and the button add will not be visible I want to move the button on top of stackPanel to be visible if the stack panel visible I found this IsUserVisible to check if the button visible and it work if I call from a another button, but I want to make it automatically I found this to fire when LayoutUpdated event firing but it will be firing a lot. Any help to make the button visible in stack panel when user scroll down ?
this is befor adding the 4th user control
after adding a 4th user control this will be visible on screen
the button add will not be visible, i want to be moved on top visible of the left stackPanel
edit :
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition MaxWidth="60" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Button x:Name="BtnAddNewUserControl" VerticalAlignment="Top"
Click="BtnAdd_OnClick"/>
</Grid>
<Grid Grid.Column="1">
<StackPanel Name="StackPanelListUserControl" Orientation="Vertical">
</StackPanel>
</Grid>
</Grid>
I don't want to make StackPanelListUserControl withScroll (the Height will be be change with the number of userControl inside) then after many user Control inserted the window will be with scroll to show the last userControls inserted, in this case the button BtnAddNewUserControl will not be visible in screen,
edit (after the comment):
in the comment BionicCode ask to make only the right part with scroll and fix the left Part, and this is my explanation :
just what I’m showing is itself in a user control that can be added, then my window has a stackPanelParent accept many userControlParent, each userControlParent contain what I’m showing this why I can’t make the scroll in this userControlParent to Show the userControlChild, the window will have 3-4 userControlParent each will have 6-7 userControlChild I have the button –adduserControlParent- fix in the left for the userControlParent but the button –adduserControlChild- is in userControlParent