2016-08-24 1 views

답변

0

표준 대화 상자를 만들 수 없습니다. 원하는 것을 얻으려면 조작 이벤트를 사용하여 페이지 상단에 사용자 정의 패널을 사용해야합니다. 뒤에

<Grid x:Name="LayoutRoot"> 
    <!-- some other content --> 

    <Grid x:Name="Dialog" Background="Red" Width="200" Height="100" 
      ManipulationMode="All" ManipulationDelta="Dialog_OnManipulationDelta"> 

     <Grid.RenderTransform> 
      <CompositeTransform x:Name="DialogTransform" /> 
     </Grid.RenderTransform> 
    </Grid> 
</Grid> 

그리고 코드 : 예를 들어

private void Dialog_OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs args) 
{ 
    DialogTransform.TranslateX += args.Delta.Translation.X; 
    DialogTransform.TranslateY += args.Delta.Translation.Y; 
} 

그런 다음 당신은 등 훌륭한 작품을

+0

표시/숨기기 애니메이션, 닫기 버튼 같은 더 복잡한 논리를 구축 할 수 있습니다. 이제는 포함 된 TextBox에서 선택 기능을 다시 사용할 수있는 방법이 있습니까? 나는 텍스트를 선택하러 가서 그 상자가 대신 디스플레이 주위를 움직인다. OnManipulationDelta를 처음 사용합니다. – Rick

+0

신경 쓰지 마십시오. 나는 이것을 다음과 같이 고쳤다. – Rick

+0

private void OnTextBoxMainipulation (object sender, Windows.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs e) { DialogTransform.TranslateX- = e.Delta.Translation.X; DialogTransform.TranslateY- = e.Delta.Translation.Y; } – Rick

관련 문제