2016-01-17 51 views
0

我使用xaml並試圖弄清楚如何修復框架錯誤。我看到對話框並不完全符合窗框。請看下面的鏈接。框架和對話框之間的空白空間

代碼如下:

Full Code: <Page x:Class="ccf_envcheck.Pages.HomePage" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:local="clr-namespace:ccf_envcheck" 
    mc:Ignorable="d" 
    d:DesignHeight="380" 
    Title="HomePage" Width="340.976" > 
     <StackPanel> 
      <TextBlock Text = ". . . " Height="50" Width="300" Margin = "10" TextWrapping="Wrap" FontWeight="Bold" Foreground="White" VerticalAlignment="Stretch"/> 
      <TextBlock Text = ". . . " Height="50" Width="300" Margin = "0" TextWrapping="Wrap" FontWeight="Bold" Foreground="White" VerticalAlignment="Stretch" /> 
      <Button Click="FirstDevice" Content="First Device" Margin="10,15,14,1"/> 
      <Button Click="SecondDevice" Content="Second Device" Margin="10,15,14,1"/> 
     </StackPanel> 
    </Page> 

enter image description here

+0

你能添加完整的代碼嗎? – CodeNoob

+0

已發佈代碼@CodeNoob –

回答

0

如果你看到你在頁面initalizing碼屬性你硬編碼的寬度,以340.986,我認爲之所以框架和對話框沒有相同的寬度。你可以嘗試刪除它,並檢查它是否工作。希望這可以幫助!

+0

我嘗試了沒有「寬度」參數的構建代碼,但我仍然遇到同樣的問題。提前致謝。 –

+0

試過運行代碼。在我的機器上正常工作。你可以檢查是否沒有從代碼背後設置保證金?除此之外,我在這段代碼中看不到任何問題。 – CodeNoob

+0

好的。我會着眼於它。不過謝謝。 –