C# UWP Windows 10 CustomDialog: How do you show as Modeless? I can't let it freeze the info behind.

408 Views Asked by At

If there is no Modeless option(?) is there another way to make a small movable informational Dialog/Window/Page on top of my page. I need to keep this up as a reference but have it be movable so the underlying information can be revealed. Visual Studio 2015, Future Store App. Thanks.

1

There are 1 best solutions below

3
Andrei Ashikhmin On

You can't make the standard dialog modeless. To achieve what you want you should use a custom panel on top of your page with manipulation events hooked up to it. For example:

<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>

And code behind:

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

Then you can build more complicated logic like show/hide animations, close buttons, etc.