Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is Canvas covering peer controls in Dockpanel?
    primarykey
    data
    text
    <p>Why is the Canvas covering the other Children of the Dock Panel? I'm setting up a menu bar at the top of the client area and a status bar at the bottom of the client area of the window as per standard convention in xaml as follows:</p> <pre><code>&lt;Window x:Class="RichCoreW.ScenEditWnd" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="ScenEditWnd" Height="490" Width="776" HorizontalAlignment="Right"&gt; &lt;DockPanel Name="mapDockP"&gt; &lt;Menu IsMainMenu="True" DockPanel.Dock="Top"&gt; &lt;MenuItem Header="File"&gt; &lt;MenuItem Header="Save" Name="menuISave" Click="menuISave_Click"/&gt; &lt;MenuItem Header="Make Playable" Click="MakePlayable" /&gt; &lt;/MenuItem&gt; &lt;MenuItem Command="ApplicationCommands.Help" /&gt; &lt;/Menu&gt; &lt;StackPanel DockPanel.Dock="Bottom" Name="stackPanel1" Orientation="Horizontal" background="Yellow"&gt; &lt;Label Content="Playable:" Name="label1" /&gt; &lt;Label Name="labPlayable" /&gt; &lt;/StackPanel&gt; &lt;/DockPanel&gt; &lt;/Window&gt; </code></pre> <p>Then I add a an instance of the MapCanvEdit Class which inherits from Canvas in C# code as follows. As its the last child to be added to the Dockpanel it should take the remaining space in the Dockpanel. But it covers the menu and status bars as well covering the whole of the client area. To be precise it is the children of the Canvas that cover over the other two Stack Panels. Where the Canvas(MapCanvEdit) is empty you can see the Menu and Status bars:</p> <pre><code>public partial class ScenEditWnd : Window { ScenC scenC; MapCanvEdit mapCanvE; public ScenEditWnd(ScenC scenCI) { InitializeComponent(); scenC = scenCI; mapCanvE = new MapCanvEdit(scenC); mapDockP.Children.Add(mapCanvE); MouseWheel += mapCanvE.Zoom; mapCanvE.SizeChanged += delegate { mapCanvE.DrawHexs(); }; ContentRendered += delegate { mapCanvE.DrawHexs(); }; labPlayable.Content = scenC.playable.ToString(); } } </code></pre> <p>I've left out the other methods for simplicity. Any help appreciated!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload