Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: ChildWindow changes

$
0
0
Hi,
I you want to have the ChilWindow in front of the other controls AND want to be able to edit the other controls, put the ChildWindow.IsModal to False. This way, the ChildWindow won't block the other controls...IsModal = true will block the other controls.

I try your code, with some small changes to simplify it, and putting the WindowContainer after the grid, make it worked as expected ;
The modalWindow blocks the other controls, until it is closed.

Here's the code I tried :
<Grid x:Name="MainGrid">

      <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="35"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <Grid Grid.Row="0" HorizontalAlignment="Stretch">
                <Border BorderBrush="Gray" BorderThickness="0,0,0,0.1">
                    <ContentControl Background="#FFF5F5F5">
                        <ToolBar Height="35" 
                                 Background="Transparent" 
                                 IsTabStop="False" 
                                 ToolBarTray.IsLocked="True" 
                                 Name="DionysusToolbar" 
                                 HorizontalAlignment="Stretch" 
                                 VerticalAlignment="Stretch">
                            <ToolBar.Items>

                            </ToolBar.Items>
                        </ToolBar>

                    </ContentControl>
                </Border>
            </Grid>
            <Grid Grid.Row="1">
                <DockPanel LastChildFill="True">
                    <!--<odc:OutlookBar IsTabStop="False" NavigationPaneText="Expand navigationbar to view" DockPanel.Dock="Left" x:Name="OutlookBar" Width="300" 
                                    AllowDrop="False" HorizontalContentAlignment="Left" IsButtonSplitterVisible="False" IsCloseButtonVisible="False" 
                                    IsManipulationEnabled="False" IsMaximized="True" IsOverflowVisible="False" ShowButtons="True" ShowSideButtons="True" Loaded="OutlookBar_Loaded" VerticalContentAlignment="Stretch" />-->
                     <xctk:Calculator DockPanel.Dock="Left"/>
                     <!--<ContentControl Content="{Binding MainContent}" Grid.Column="1"  Margin="0,0,2,0" Grid.Row="1"></ContentControl>-->
                  <TextBox Text="My text" Margin="0,0,2,0" Width="200" Height="300"/>
               </DockPanel>
            </Grid>
            <Border Grid.Row="2" BorderThickness="0,0.1,0,0" BorderBrush="Gray">
                <Grid Grid.Row="2">
                </Grid>
            </Border>
            <ContentControl Grid.RowSpan="3"
                            Grid.ColumnSpan="2"
                            HorizontalAlignment="Stretch" 
                            VerticalAlignment="Stretch" 
                            HorizontalContentAlignment="Stretch" 
                            VerticalContentAlignment="Stretch">
            </ContentControl>

        </Grid>
      
      <xctk:WindowContainer Name="xWindowContainer">
            <xctk:ChildWindow Name="ChildWindow" 
                              WindowState="Open" 
                              Caption="ChildWindowCaption" 
                              WindowStartupLocation="Center" 
                              IsModal="True">
                <ContentControl HorizontalAlignment="Stretch" 
                                VerticalAlignment="Stretch" 
                                Content="ChildContent"/>
            </xctk:ChildWindow>

            <xctk:ChildWindow Name="ChildWindowError" 
                              WindowState="Closed" 
                              Caption="ErrorWindowCaption" 
                              WindowStartupLocation="Center" 
                              IsModal="True" >
                <ContentControl HorizontalAlignment="Stretch" 
                                VerticalAlignment="Stretch" 
                                Content="ErrorContent"/>
            </xctk:ChildWindow>
        </xctk:WindowContainer>

    </Grid>

Viewing all articles
Browse latest Browse all 2157

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>