0
ManipulationDeltaHandler로 조작되는 요소는 사용자가 해당 특정 요소를 클릭하거나 터치 할 때만 조작되도록 만들 수 있습니까? 만질 때UWP 조작 델타
public void AddTextButton_Click(object sender, RoutedEventArgs e)
{
TextBox MyTextBox = new TextBox();
MyTextBox.Background = new SolidColorBrush(Colors.White);
MyTextBox.PlaceholderText = "Text";
MyTextBox.Width = 250;
MyTextBox.Height = 100;
ManipulationMode = ManipulationModes.All;
MyTextBox.RenderTransform = textBoxTransforms;
AddHandler(ManipulationDeltaEvent, new ManipulationDeltaEventHandler(TextBox_ManipulationDelta), true);
parentCanvas.Children.Add(MyTextBox);
}
void TextBox_ManipulationDelta(object sender,
ManipulationDeltaRoutedEventArgs e)
{
dragTextBox.X += e.Delta.Translation.X;
dragTextBox.Y += e.Delta.Translation.Y;
resizeTextBox.ScaleX *= e.Delta.Scale;
resizeTextBox.ScaleY *= e.Delta.Scale;
}
/캔버스의 아무 곳이나 곤란, 텍스트 상자가/크기 조정 이동합니다 :
는 지금까지 다음과 같은 코드가 있습니다. 사용자가 텍스트 상자의 경계 내에서 직접 만지면이 작업이 수행되기를 원합니다. 어떤 제안?
감사합니다.
기억이 안나지만 MyTextBox에서 AddHandler를 호출 할 수 없습니까? 이렇게 : MyTextBox.AddHandler (..); – rokkerboci
난 그냥 이것을 시도하고 이것은 텍스트 상자가 모든 드래그/크기 조정 기능을 잃게 만드는 몇 가지 이유 ... – kmash