There is the following structure

<Grid.RenderTransform> <CompositeTransform /> </Grid.RenderTransform> <Grid.RowDefinitions> <RowDefinition Height="2*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <Button Width="50" Height="50" Grid.Row="0" Grid.Column="1" Margin="0,-50,0,0" ManipulationMode="Rotate" ManipulationDelta="Button_ManipulationDelta" Visibility="{Binding Value, Source={StaticResource ShowBorder}, Converter={StaticResource VisibilityInvertConverter}}" > <Button.Background> <ImageBrush Stretch="Fill" ImageSource="ms-appx:///Assets/Rotate.png" /> </Button.Background> <Button.RenderTransform> <CompositeTransform /> </Button.RenderTransform> </Button> <Border Width="670" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" ManipulationDelta="Border_ManipulationDelta" ManipulationMode="TranslateX, TranslateY,Rotate,Scale"> <Border.RenderTransform> <CompositeTransform /> </Border.RenderTransform> </Border> <Image Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Margin="{x:Bind Position}" Width="650" Source="{x:Bind Image, Converter= {StaticResource UriToImageConverter}}" RenderTransformOrigin="0.5,0.5"> <interactivity:Interaction.Behaviors> <core:EventTriggerBehavior EventName="Tapped"> <core:ChangePropertyAction PropertyName="Value" TargetObject="{StaticResource ShowBorder}" Value="{Binding Value ,Source={StaticResource ShowBorder}, Converter={StaticResource VisibilityInvertConverter}}" /> </core:EventTriggerBehavior> </interactivity:Interaction.Behaviors> <Image.RenderTransform> <CompositeTransform /> </Image.RenderTransform> </Image> </Grid> 

The point is that when you drag Border resize its parent Grid

I can not access it from the code

Tried so

 var container = sender as Border; container = (FrameworkElement)VisualTreeHelper.GetParent(container); var ct = (CompositeTransform)(container as Grid).RenderTransform;// получаю Null Reference //Или так var ct = (CompositeTransform)container.RenderTransform;// получаю Не может преобразовать MatrixTransform to RenderTransform 

    1 answer 1

    I made it so that I had to drag the Grid, but only when the cursor was on the border. For this, I used the events Poiner_Entered and _Exited . It turns out that we are dragging a Grid, but due to the fact that it is in the same place as Border, it visually seems that Border is dragging all the same. The only nuance is the picture flickering.

    To determine what Border can be seen used:

      var grid = sender as Grid; var child = (FrameworkElement)VisualTreeHelper.GetChild(grid,3); 

    3 is an index of control from top to bottom, as on the mark