저는 Windows 전화 코드 작성에 새로운 것이므로 초보자 문제라고 생각합니다. :) 내 웹 브라우저는 보이지 않습니다. 나는 그것이 내 클래스의 생성자를 탐색한다고 말했기 때문에 그것이 처음이라고 생각했지만, 그것을 변경해도 아무 것도 해결하지 못했습니다.내 전화 페이지에 표시 할 웹 브라우저를 가져올 수 없습니다.
아무도 나에게 설명 할 수 있습니까? 여기
public partial class MainPage : PhoneApplicationPage
{
string site = "http://google.com/";
// Constructor
public MainPage()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(MainPage_Loaded);
}
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
wB.Navigate(new Uri(site, UriKind.Absolute));
wB.Navigating += new EventHandler<NavigatingEventArgs>(wB_Navigating);
}
void wB_Navigating(object sender, NavigatingEventArgs e)
{
System.Diagnostics.Debug.WriteLine(e.Uri);
if (e.Uri.ToString() != (site))
{
System.Diagnostics.Debug.WriteLine("lalala");
// NavigationService.Navigate(new Uri("/Panorama.xaml", UriKind.Relative));
}
}
}
}
내 XAML입니다 : 여기
뒤에 내 코드입니다
당신이, WebBrowser 컨트롤에 대한 VerticalAlignment = "최고"로 설정이 속성을 제거하기 때문에 것 같다
<phone:PhoneApplicationPage
x:Class="LaBanquePostale.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<phone:WebBrowser Name="wB" VerticalAlignment="Top" d:LayoutOverrides="Width"/>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top"/></Grid>
</Grid>
</phone:PhoneApplicationPage>
에서 제공하는 추론을 확인하십시오. WP7에서 UI 항목이 작동하는 방식을 여전히 유감스럽게 생각하지 않습니다. 그러나 나는 더 가까이 볼 것이다! Thx guys –
많은 사람들이 당신이 기대하는대로 행동하지 않는다는 것을 알게 될 것입니다. – Robaticus