所以我使用VS13(http://apps.microsoft.com/windows/app/headphone-burn-in/09be1874-04ea-4dc8-90c3-c8a164369e7b)在c#中创建了这个应用程序它是用于“学校”“竞争”,在我的笔记本电脑上使用1366x768并且分辨率较低但是我的朋友测试了这个没有错误在1920x1080p显示屏上显示此错误http://prntscr.com/3pxhlt。
我有较低分辨率的问题,然后我使用了viewbox,viewbox似乎解决了问题,但更高分辨率的问题仍然存在。 我的xaml代码:
<Viewbox HorizontalAlignment="Left" Height="auto" Width="auto" VerticalAlignment="Stretch" >
<Grid x:Name="Main_Grid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Width="1366" Height="768" HorizontalAlignment="Center">
<Grid.ChildrenTransitions>
<TransitionCollection>
<EntranceThemeTransition/>
</TransitionCollection>
</Grid.ChildrenTransitions>
<Grid.RowDefinitions>
<RowDefinition Height="140"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Back button and page title -->
<Viewbox HorizontalAlignment="Left" Height="auto" Width="auto" VerticalAlignment="Stretch" Grid.RowSpan="2" >
<Grid RenderTransformOrigin="0.501,0.529" Margin="0,5,0,623" Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="121"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button x:Name="backButton" Margin="8,59,0,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=pageRoot}"
Style="{StaticResource NavigationBackButtonNormalStyle}"
VerticalAlignment="Top"
AutomationProperties.Name="Back"
AutomationProperties.AutomationId="BackButton"
AutomationProperties.ItemType="Navigation Button" Grid.Column="1" Height="41" Width="46"/>
<TextBlock x:Name="pageTitle" Text="Headphone Burn In" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1"
IsHitTestVisible="false" TextWrapping="NoWrap" Margin="223,0,423,41" SelectionChanged="pageTitle_SelectionChanged" FontFamily="Razer Header Regular" FontWeight="Normal" Height="40" HorizontalAlignment="Center" VerticalAlignment="Bottom">
<TextBlock.Foreground>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="#FF04DDFF" Offset="1"/>
</LinearGradientBrush>
</TextBlock.Foreground>
</TextBlock>
</Grid>
</Viewbox>
<TextBlock HorizontalAlignment="Left" Height="263" Margin="352,0,0,0" TextWrapping="Wrap" FontSize="12" Width="575" VerticalAlignment="Top" Grid.Row="1" Grid.Column="1">
<Run Text="This application is made to optimize your headphones, the term "Burn-in" is used by Audiophiles and Sound "geeks" around the globe."/>
<LineBreak/>
<Run Foreground="#FF04DDFF" FontWeight="Bold" FontStyle="Italic" Text="How it works:"/>
<LineBreak/>
<Run Text="The application will play a variety of sounds including: White noise, Pink noise, Brown noise, High frequency sweeps, Low frequency sweeps."/>
<LineBreak/>
<Run Text="The Theory is that headphones from factory need some "Playtime" till they start sound as best as they are supposed to, the optimal play time is rumored to be around 40~50 hours of sound output."/>
<LineBreak/>
<Run Text="We choose to use "/>
<Run FontFamily="Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode" Text="White noise, Pink noise, Brown noise, High frequency sweeps, Low frequency sweeps for better results."/>
<LineBreak/>
<Run Foreground="#FF04DDFF" FontWeight="Bold" FontStyle="Italic" FontFamily="Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode" Text="How to use:"/>
<LineBreak/>
<Run FontFamily="Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode" Text="Insert your headphones to your device headphone jack, adjust your PC volume to 50% or just tune it so your headphones are not too loud, it's your preference."/>
<LineBreak/>
<Run Foreground="#FFE22F1D" FontWeight="Bold" FontStyle="Italic" FontFamily="Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode" Text="Much loudness can hurt your Headphones/IEMs."/>
<LineBreak/>
<Run FontFamily="Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode" Text="Press the Start button and insert your preferred runtime duration in the textbox between 1 minute to 999 minutes, then press the start button, the application will run the burn-in process for the selected amount of time, to force stop the test press the stop button or simply exit this application. "/>
<LineBreak/>
<Run Foreground="#FFE22F1D" FontWeight="Bold" FontStyle="Italic" FontFamily="Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode" Text="This application won't run while minimized due to some policy matter."/>
<LineBreak/>
<Run Foreground="#FF04DDFF" FontWeight="Bold" FontStyle="Italic" FontFamily="Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode"/>
<LineBreak/>
<Run Foreground="#FF04DDFF" FontWeight="Bold" FontStyle="Italic" FontFamily="Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode" Text=""/>
<LineBreak/>
<Run Foreground="#FF04DDFF" FontWeight="Bold" FontStyle="Italic" FontFamily="Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode"/>
<LineBreak/>
<Run Foreground="#FF04DDFF" FontWeight="Bold" FontStyle="Italic" FontFamily="Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode"/>
<LineBreak/>
<Run Foreground="#FF04DDFF" FontWeight="Bold" FontStyle="Italic" FontFamily="Segoe UI, Tahoma, Arial, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode"/>
</TextBlock>
<Button Content="Start" HorizontalAlignment="Left" Margin="349,261,0,0" VerticalAlignment="Top" BorderBrush="#FF04DDFF" Click="Button_Click" Height="48" Width="76" Grid.Row="1"/>
<Button Content="About" HorizontalAlignment="Left" Margin="756,261,0,0" VerticalAlignment="Top" BorderBrush="#FFE2A31D" Height="48" Click="Button_Click_2" Grid.Row="1"/>
<Button Content="Exit" HorizontalAlignment="Left" Margin="854,261,0,0" VerticalAlignment="Top" BorderBrush="#FFE22F1D" Click="Button_Click_1" Height="48" Width="76" Grid.Row="1"/>
</Grid>
</Viewbox>