public DetailPage2( ) { InitializeComponent( ); this. browser. NavigateToString( ControlHelper. ConvertExtendedASCII( string. Format( "<div style='font-size:100px;text-align:center;'>正在加载 . . .</div>" ) ) ); //点击网页链接的处理 this. browser. Navigating += new EventHandler<NavigatingEventArgs>( (s, e) => { if ( e.Uri.AbsoluteUri.StartsWith("http://www.oschina.net/search?scope=bbs&q=", StringComparison.CurrentCulture) ) { return; } switch ( e. Uri. AbsoluteUri ) { case "http://www.wangjuntom.com/": if ( this. NavigationService. BackStack. Select( b => b. Source. OriginalString. Contains( "DetailPage2.xaml" ) ).Count() > 1 ) { Tool. To( "/MainPage.xaml" ); } else { if ( this. NavigationService. CanGoBack ) { this. NavigationService. GoBack( ); } else { Tool. To( "/MainPage.xaml" ); } } e. Cancel = true; break; //大图展示 case "http://www.wangjuntomtweetimg.com/": //查看大图 this. pop = new PopUpImage( ); this. pop. Create( this. tweetDetail. imBig, 730 ); this. IsEnabled = false; this. pop. pop. Closed += (s1, e1) => { this. IsEnabled = true; }; e. Cancel = true; break; default: Tool. ProcessAppLink( e. Uri. AbsoluteUri ); break; } } ); }
/// <summary> /// 点击动弹图片 打开大图进行查看 /// </summary> private void imgTweet_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { TweetUnit t = (sender as Image).DataContext as TweetUnit; if (t != null) { e.Handled = true; //查看大图 this.pop = new PopUpImage( ); this.pop.Create(t.imgBig); this.IsEnabled = false; this.pop.pop.Closed += (s, e1) => { this.IsEnabled = true; }; } }