async void ItemListView_ItemClick( object sender, ItemClickEventArgs e) { ModelInfo item = e.ClickedItem as ModelInfo; StorageFolder localFolder = ApplicationData.Current.LocalFolder; StorageFolder folder = await localFolder.CreateFolderAsync( "LocalModels", CreationCollisionOption.OpenIfExists); StorageFile file = await folder.GetFileAsync( item.ModelName); string jsonMsgZipped = await FileIO.ReadTextAsync(file); string jsonMsg = AdnDataUtils.Decompress( jsonMsgZipped); var meshData = JsonConvert.DeserializeObject <List<AdnMeshData>>(jsonMsg); var mainPage = new ViewerPage(meshData); Window.Current.Content = mainPage; }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used when the application is launched to open a specific file, to display /// search results, and so forth. /// </summary> /// <param name="args">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs args) { if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Load state from previously suspended application } LoadAssets(); var mainPage = new ViewerPage(); Window.Current.Content = mainPage; Window.Current.Activate(); }
private async void Commit_Click(object sender, RoutedEventArgs e) { string _hostAddress = "23.23.212.64:80"; string url = "http://" + _hostAddress + "/AdnViewerSrv/rest/UpdateMetaData"; string jsonMsg = JsonConvert.SerializeObject(_metaData, Formatting.None, new JsonSerializerSettings { }); byte[] uploadData = GetBytes(jsonMsg); HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; request.Method = "POST"; request.ContentType = "application/json"; using (Stream stream = await request.GetRequestStreamAsync()) { stream.Write(uploadData, 0, uploadData.Length); var response = request.GetResponseAsync(); } var page = new ViewerPage(_data); Window.Current.Content = page; }
private void GoBack(object sender, RoutedEventArgs e) { var page = new ViewerPage(_data); Window.Current.Content = page; }
private void ItemListView_SelectionChanged( object sender, SelectionChangedEventArgs e) { AdnDbModelData item = ItemListView.SelectedItem as AdnDbModelData; var page = new ViewerPage(item); Window.Current.Content = page; }