private void Query(object tags) { Flickr.Flickr flickr = new Flickr.Flickr(); string path = new Uri(flickr.Url).GetComponents(UriComponents.Path, UriFormat.Unescaped).Replace("Flickr.asmx", ""); if (ApplicationDeployment.IsNetworkDeployed && ApplicationDeployment.CurrentDeployment != null && ApplicationDeployment.CurrentDeployment.ActivationUri != null) { Uri activationUri = ApplicationDeployment.CurrentDeployment.ActivationUri; path = ""; // string.Join( "", activationUri.Segments, 1, activationUri.Segments.Length - 2 ); flickr.Url = activationUri.GetLeftPart(UriPartial.Authority) + "/Chris/Flickr.asmx"; } Flickr.Photo[] photos = flickr.GetPhotos("bb8dbf9c10530f2e9c9ea67a589474b0", (string)tags); string uriFormat = string.Format("pack://siteoforigin:,,,/{0}{{0}}/Image.ashx", path); Facts facts = PrepareFacts(photos, uriFormat); Dispatcher.Invoke(DispatcherPriority.Normal, (BindDataDelegate) delegate() { factCube.DataContext = facts; searchButton.IsEnabled = true; search.IsEnabled = true; }); }
private void Query( object tags ) { Flickr.Flickr flickr = new Flickr.Flickr(); string path = new Uri( flickr.Url ).GetComponents( UriComponents.Path, UriFormat.Unescaped ).Replace( "Flickr.asmx", "" ); if ( ApplicationDeployment.IsNetworkDeployed && ApplicationDeployment.CurrentDeployment != null && ApplicationDeployment.CurrentDeployment.ActivationUri != null ) { Uri activationUri = ApplicationDeployment.CurrentDeployment.ActivationUri; path = ""; // string.Join( "", activationUri.Segments, 1, activationUri.Segments.Length - 2 ); flickr.Url = activationUri.GetLeftPart( UriPartial.Authority ) + "/Chris/Flickr.asmx"; } Flickr.Photo[] photos = flickr.GetPhotos( "bb8dbf9c10530f2e9c9ea67a589474b0", (string)tags ); string uriFormat = string.Format( "pack://siteoforigin:,,,/{0}{{0}}/Image.ashx", path ); Facts facts = PrepareFacts( photos, uriFormat ); Dispatcher.Invoke( DispatcherPriority.Normal, (BindDataDelegate)delegate() { factCube.DataContext = facts; searchButton.IsEnabled = true; search.IsEnabled = true; } ); }