Inheritance: System.EventArgs
Ejemplo n.º 1
0
 private static void Renderer_SendMessage(object sender, ContentViewEventArgs e)
 {
     _cv?._SendMessageSource.Raise(sender, e);
 }
Ejemplo n.º 2
0
 public void SendMessageThru(object source, ContentViewEventArgs ea)
 {
     this.SendMessage?.Invoke(source, ea);
 }
Ejemplo n.º 3
0
 public void SendMessageThru(object source, ContentViewEventArgs ea)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 private static void Renderer_SendMessage(object sender, ContentViewEventArgs e)
 {
     _cv?._SendMessageSource.Raise(sender, e);
 }
Ejemplo n.º 5
0
 public void SendMessageThru(object source, ContentViewEventArgs ea)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
 public void SendMessageThru(object source, ContentViewEventArgs ea)
 {
     this.SendMessage?.Invoke(source, ea);
 }
Ejemplo n.º 7
0
Archivo: Tab.cs Proyecto: liquidboy/X
        private async void _cvMain_SendMessage(object sender, ContentViewEventArgs e)
        {
            var cv = (ContentViewEventArgs)e;
            if (cv.Type == "LoadCompleted")
            {
                if (cv.Source == null || cv.Source.OriginalString.Length == 0) return;

                _LoadCompletedSource?.Raise(this, new LoadCompletedEventArgs() { ActualHeight = _cvMain.ActualHeight, ActualWidth = _cvMain.ActualWidth, SearchQuery = cv.Source.OriginalString } );
                
                var uriHash = FlickrNet.UtilityMethods.MD5Hash(cv.Source.OriginalString); //   e.Uri.OriginalString);

                await Task.Delay(1000);

                //capture screenshot
                using (InMemoryRandomAccessStream ms = new InMemoryRandomAccessStream())
                {

                    await _cvMain.Renderer?.CaptureThumbnail(ms);

                    //img: Banner 400 width
                    //ms.Seek(0);
                    await X.Services.Image.Service.Instance.GenerateResizedImageAsync(400, _cvMain.ActualWidth, _cvMain.ActualHeight, ms, uriHash + ".png", X.Services.Image.Service.location.MediumFolder);
                    
                    //img: Thumbnail
                    ms.Seek(0);
                    await X.Services.Image.Service.Instance.GenerateResizedImageAsync(180, _cvMain.ActualWidth, _cvMain.ActualHeight, ms, uriHash + ".png", X.Services.Image.Service.location.ThumbFolder);

                    //img: Tile
                    ms.Seek(0);
                    await X.Services.Image.Service.Instance.GenerateResizedImageAsync(71, _cvMain.ActualWidth, _cvMain.ActualHeight, ms, uriHash + ".png", X.Services.Image.Service.location.TileFolder, 71);

                    ms.Seek(0);
                    await X.Services.Image.Service.Instance.GenerateResizedImageAsync(150, _cvMain.ActualWidth, _cvMain.ActualHeight, ms, uriHash + "-150x150.png", X.Services.Image.Service.location.TileFolder, 150);

                    ms.Seek(0);
                    await X.Services.Image.Service.Instance.GenerateResizedImageAsync(310, _cvMain.ActualWidth, _cvMain.ActualHeight, ms, uriHash + "-310x150.png", X.Services.Image.Service.location.TileFolder, 150);

                    ms.Seek(0);
                    await X.Services.Image.Service.Instance.GenerateResizedImageAsync(310, _cvMain.ActualWidth, _cvMain.ActualHeight, ms, uriHash + "-310x310.png", X.Services.Image.Service.location.TileFolder, 310);

                    //update tile
                    X.Services.Tile.Service.UpdatePrimaryTile("X.Browser", 
                        "ms-appdata:///local/tile/" + uriHash + "-150x150.png",
                        "ms-appdata:///local/tile/" + uriHash + "-310x150.png",
                        "ms-appdata:///local/tile/" + uriHash + "-310x310.png",
                        "ms-appdata:///local/tile/" + uriHash + ".png"
                        );

                    
                }
            }
            else if (cv.Type == "NavigationFailed")
            {
                _prLoading.IsActive = false;
                _prLoading.Visibility = Visibility.Collapsed;
            }
            else if (cv.Type == "NavigationCompleted")
            {
                _prLoading.IsActive = false;
                _prLoading.Visibility = Visibility.Collapsed;
            }
            else if (cv.Type == "NavigationStarting")
            {
                _prLoading.IsActive = true;
                _prLoading.Visibility = Visibility.Visible;
            }
        }