-1

I currently have a program where you can load a text in it.

Now I created a button that Pops up a flyout/ContentDialog but Im not happy with it because Limits me of what Im trying to achieve.

When I click the button it opens a flyout, the flyout gets the full Focus. That means I cannot scroll to the text WHILE the flyout-box is open. And if I click outside the flyout-box the flyout-box disappears.

I have a similar Problem to the ContentDialog. When I click the button and the ContentDialog Pops up, everything behind the ContentDialog goes a bit into White/Grey Color. Also the ContentDialog does not allow any Focus outside the ContentDialog itself.

So what do I want to have?

I want that when I click on the button that a Window appears. I should be able to customize the window (writing text in it and it should have a button). While this Window is open I want to be able to do Actions outside that window without the window Closing. For example Scrolling through the text I loaded.

Is there something I can achieve this with?

axbeit
  • 853
  • 11
  • 35

2 Answers2

0

Take a look at the Popup class. This will let you display content on top of other content within your app's window. It's similar to the Flyout but without all of the built-in Flyout behavior that you don't want. The Popup class documentation has more details and commentary on when and how to use it.

Here's a really bland example with no styling.

<Grid>
    <Popup x:Name="popup">
        <StackPanel>
            <TextBlock Text="Poppity pop pop" />
            <Button Click="ClosePopup_Click">Close</Button>
        </StackPanel>
    </Popup>
    <Button Click="OpenPopup_Click">Open Popup</Button>
</Grid>

private void OpenPopup_Click(object sender, RoutedEventArgs e)
{
    popup.IsOpen = true;
}

private void ClosePopup_Click(object sender, RoutedEventArgs e)
{
    popup.IsOpen = false;
}

There is a slightly more complicated example in the Popup documentation

Rob Caplan - MSFT
  • 21,714
  • 3
  • 32
  • 54
0

I just hide and show grids with whatever I want inside.

Gary93730
  • 431
  • 4
  • 13