Is is possible to create a modless Window/Pop up that can be opened with a button click in XAML. I need to be able to see the Parent Window and the child modless window side by side. The modless window needs to fit into my Grid initially and needs to expand to parent level when clicked on it.
The popup control has multiple bugs with it. The height of the popup control when expanded does not go for 100% screen height, it only goes for 75% screen height. Also the popup control takes too much time to load data.
Here is how i styled my expander control that has the Popup.
<Style TargetType="Expander" x:Key="NotesSlider">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Expander" >
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Grid}} ,Path=ActualWidth}"
Height="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Grid}} ,Path=ActualHeight}"
x:Name="GridMain">
<Border x:Name="popupBorder" BorderBrush="White">
<!--<Popup IsOpen="True" PopupAnimation="Slide" x:Name="SlideOut" StaysOpen="True"
Placement="Relative" AllowsTransparency="True" Grid.Column="0" Width="Auto" Height="Auto">-->
<controls:PopupNonTopmost IsOpen="True" PopupAnimation="None" Placement="Relative" AllowsTransparency="True" StaysOpen="True"
Topmost="False" x:Name="SlideOut" Panel.ZIndex="10000" >
<Grid Margin="0 0 0 10" x:Name="gridContainer">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" x:Name="NoteHeaderRow"/>
<RowDefinition Name="NotesContentRow" Height="0"/>
</Grid.RowDefinitions>
<Border
Name="NoteBorder"
Grid.Row="0"
Background="{StaticResource NormalBrush}"
BorderBrush="{StaticResource NormalBorderBrush}"
BorderThickness="1"
CornerRadius="0" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<ContentPresenter
Grid.Column="0"
Margin="4"
ContentSource="Header"
RecognizesAccessKey="True" />
<ToggleButton
IsChecked="{Binding Path=IsExpanded,Mode=TwoWay,
RelativeSource={RelativeSource TemplatedParent}}"
OverridesDefaultStyle="True"
Grid.Column="1"
Template="{StaticResource VerticalExpanderToggleButton}"
Background="{StaticResource NormalBrush}" />
<ToggleButton x:Name="toggleMax"
OverridesDefaultStyle="True"
Grid.Column="2"
Template="{StaticResource SliderToggleButton}"
Background="{StaticResource NormalBrush}" />
</Grid>
</Border>
<Border
Name="NoteContent"
Grid.Row="1"
Background="{StaticResource WindowBackgroundBrush}"
BorderBrush="{StaticResource SolidBorderBrush}"
BorderThickness="1,0,1,1"
CornerRadius="0" >
<ContentPresenter Margin="4" x:Name="content"/>
</Border>
</Grid>
</controls:PopupNonTopmost>
<!--</Popup>-->
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True" SourceName="toggleMax">
<Setter TargetName="SlideOut" Property="PlacementTarget" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}"/>
<Setter TargetName="SlideOut" Property="Width" Value="{Binding Source={x:Static SystemParameters.WorkArea}, Path=Width,Converter={StaticResource PopupWidthConverter}}"/>
<Setter TargetName="SlideOut" Property="Height" Value="{Binding Source={x:Static SystemParameters.WorkArea}, Path=Height,Converter={StaticResource PopupHeightConverter}}"/>
<Setter TargetName="popupBorder" Property="BorderBrush" Value="Black"/>
<!--<Setter TargetName="SlideOut" Property="Width" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}},Path=Width}"/>
<Setter TargetName="SlideOut" Property="Height" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}},Path=ActualHeight}"/>-->
</Trigger>
<Trigger Property="IsChecked" Value="False" SourceName="toggleMax">
<Setter TargetName="SlideOut" Property="PlacementTarget" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Grid}}}"/>
<Setter TargetName="SlideOut" Property="Width" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Grid}},Path=Width}"/>
<Setter TargetName="SlideOut" Property="Height" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Grid}},Path=Height}"/>
</Trigger>
<Trigger Property="IsExpanded" Value="True">
<Setter TargetName="NotesContentRow" Property="Height" Value="{Binding ElementName=Content,Path=DesiredHeight}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="NoteBorder" Property="Background"
Value="{StaticResource DisabledBackgroundBrush}" />
<Setter TargetName="NoteBorder" Property="BorderBrush"
Value="{StaticResource DisabledBorderBrush}" />
<Setter Property="Foreground"
Value="{StaticResource DisabledForegroundBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>