Click here to Skip to main content
15,884,921 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i have window with a collection of user control , these user control can drag in the window. my scenario is
add 2 user control
maximize window
one of the user control drag into bottom right position
minimize the window
then the only one user control is showing and there is no scroll bar



window XAML
HTML
<Grid  Grid.Row="0" >
            <ScrollViewer HorizontalScrollBarVisibility="Visible">
                <ItemsControl ItemsSource="{Binding  UsercontrolCollectionDetails,
                       UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel  
                                 ScrollViewer.HorizontalScrollBarVisibility="Visible" 
                                 ScrollViewer.VerticalScrollBarVisibility="Visible" 
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
        </Grid>
user control .cs file
private void root_MouseMove(object sender, MouseEventArgs e)
        {
            var element = sender as UcNetworkLayoutGraphicalView;
            if (isInDrag && element != null && e.LeftButton == MouseButtonState.Pressed)
            {
                currentPoint = e.GetPosition(null);
                var window = Window.GetWindow(this);
                if (currentPoint.X > 10 && currentPoint.X < window.ActualWidth - 25
                    && currentPoint.Y > 10 && currentPoint.Y < window.ActualHeight - 85)
                {
                    transform.X += currentPoint.X - anchorPoint.X;
                    transform.Y += (currentPoint.Y - anchorPoint.Y);
                    this.RenderTransform = transform;
                    anchorPoint = currentPoint;
                }
               
            }
        }


What I have tried:

i googled but didn't get any solution .
Posted
Updated 20-Apr-17 1:43am
v6

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900