All Questions

Filter by
Sorted by
Tagged with
18 votes
2 answers
8k views

How do I print WebView content in a Windows Store App?

I have a Metro App and I am attempting to Print the Content of a WebView control. Using the MSDN Print Sample as my source reference. I simply change the XAML in the printableArea as follows: <...
c0D3l0g1c's user avatar
  • 3,122
15 votes
2 answers
16k views

Task.Run and Func<>

How can I run a Task that return value and takes a parameter? I see that there is an overloaded method Task.Run<TResult>(Func<TResult>) but how I can pass a parameter there?
zavolokas's user avatar
  • 707
14 votes
1 answer
10k views

HttpClient HttpResponseMessage Address / URI

I am developing a C# WinRT application that makes POST and GET requests to a webserver. Does anyone know if there is a way to get the Response URI / Address when using a HttpClient object?. If I ...
Michael Sabin's user avatar
13 votes
5 answers
6k views

How can I start a Windows App Background Task immediately after registering it?

I am writing a Metro App that will only run on PCs (so there is no, or at least less, worry about the battery life). I need it to register and run a background task when the user clicks a button. It ...
Garrett's user avatar
  • 5,620
13 votes
1 answer
511 views

Why do WinRT framework assemblies have the same fully qualified name as their (different) non-WinRT counterparts?

This is really just more of a curiosity type question. I deal with looking up types across assemblies and raw IL. Windows 8 really puts a kink in something I'm implementing though. I've found that ...
Earlz's user avatar
  • 62.9k
11 votes
2 answers
5k views

Can a Task have multiple awaiters?

I am toying around with an async service for a Windows 8 project and there are some async calls of this service, which should only be called once at a time. public async Task CallThisOnlyOnce() { ...
user avatar
8 votes
1 answer
6k views

WinRT - TCP clients?

I am building an IRC client in the new WinRT (.NET 4.5) framework for Windows 8 Metro applications. However, I have some issues. I've already figured out that I need to use a StreamSocket to read TCP ...
Mathias Lykkegaard Lorenzen's user avatar
7 votes
3 answers
3k views

How can I attach to a WinRT event dynamically?

I want to use MVVM in a WinRT (Windows 8) app, and one of my requirements is to be able to hook events up to commands (ICommand). This means I have to dynamically add a handler to a WinRT event. There ...
driis's user avatar
  • 163k
6 votes
4 answers
6k views

WinRT: App to enumerate files outside libraries and known folders

I am working on a Metro app that shows the content of a given folder in a ListView control. MS decided that developers don't need the System.IO.Directory class and removed it entirely from the ...
Zaid Amir's user avatar
  • 4,735
6 votes
1 answer
7k views

Using HttpClient Class with WinRT

I have a Piece of code which works perfect in .NET (4.0) Code# string URI = "http://www.indianrail.gov.in/cgi_bin/inet_pnrstat_cgi.cgi"; string Parameters = Uri....
Ankesh's user avatar
  • 4,865
6 votes
1 answer
3k views

Capture the stream from microphone in WAV formatting

I'm migrating an metro style application from windows phone 7.5 to windows 8. My application was used to capture the microphone input stream . I've found MediaCapture class in the win 8 api for metro ...
danyloid's user avatar
  • 1,677
5 votes
1 answer
752 views

Metro App FileIO.WriteTextAsync Multiple Threads

I have a method which is called frequently from multiple threads. It involves writing to disk using await FileIO.WriteTextAsync. This works fine when it is called from a single thread, but once I ...
c0D3l0g1c's user avatar
  • 3,122
4 votes
3 answers
7k views

Writing to a file using FileSavePicker

I'm having a little difficulty figuring out what the cause of this error is. I've added FilePicker capabilities in the Manifest, and it's not like I'm trying to do anything crazy; just trying to save ...
Jason's user avatar
  • 139
4 votes
2 answers
1k views

How to Interop with Windows Runtime in .NET 4.5

I see this namespace: System.Runtime.InteropServices.WindowsRuntime Which provides interop between .NET and WindowsRuntime. For instance, you can invoke a method in WindowsRuntime when you create a ...
user1343145's user avatar
4 votes
1 answer
566 views

WinRT API in .Net 4.5

I am trying to use Windows.Media.Capture.CameraCaptureUI() of Metro Style app in WPF application in VS11. Now I know there are others library for doing camera capture, but It is possible to use a ...
uncia's user avatar
  • 594
3 votes
2 answers
555 views

C# Testing method with StorageFile as parameter

First of all, this is a Microsoft Store winrt library and I am trying to test a public method with this signature: string GetStringFromFile(StorageFile storageFile); But StorageFile doesn't have a ...
ferpega's user avatar
  • 3,204
3 votes
1 answer
5k views

Copy file into install directory of metro-style-app

Is there a way to copy a file (selected with filepicker) to the installdir of the currently running metro style app? I tried to get the InstallationFolder with: Windows.ApplicationModel.Package ...
Jan K.'s user avatar
  • 2,582
2 votes
5 answers
3k views

Windows Metro loading data asynchronously

I have created a Windows 8 Metro App based on the Split Page sample app. However, in the sample app the data is loaded synchronously in the constructor. I'm accessing a text file and therefore need ...
Paul Michaels's user avatar
2 votes
1 answer
4k views

How to resolve a hostname to an IP address in Metro/WinRT?

I'm in the process of porting a WP7 app to Windows 8 Metro and one of the (many) conversion obstacles I've encountered is discovering an IP address based on a hostname or DNS name. The following is an ...
jokeefe's user avatar
  • 1,856
2 votes
1 answer
107 views

Object Initializer where property isn't assigned

I had a type-o in my windows-8 app store code. I got a strange result, so I went back to look and realized I missed a value, but it still compiled and ran without errors. Thinking this was strange, ...
N_A's user avatar
  • 19.8k
2 votes
5 answers
3k views

.NET 4.5 Metro Application DependencyProperty

I cant get DependencyProperty.Register to work. It requires (string, string, string, PropertyMetadata) instead of string, Type, Type, UIPropertyMeatdata)... I changed the UI-PropertyMetadata part ...
Aleksandar Toplek's user avatar
2 votes
1 answer
308 views

Alternative to CurrentManagedThreadId that is constant across await?

In my C# logging classes, I display CurrentManagedThreadId in the log output so that it's possible to follow a specific thread of execution. I also use the thread ID as a unique key to manage per-...
Scott Smith's user avatar
  • 3,938
2 votes
1 answer
300 views

How to deploy a file from Visual Studio to an accessible folder in XAML Metro App?

I have XAML Metro app. I need to deploy a static file to be read on every app launch. I have access to certain paths only (eg LocalStorage and InstalledLocation..is that right?) How do I make VS 2012 ...
Boppity Bop's user avatar
  • 9,985
2 votes
1 answer
418 views

Metro App StorageFile GetThumbnailAsync Background

In a Metro App, when retrieving the Thumbnail of a StorageFile using the GetThumbnailAsync() method, the Background Color is a Dark Blue/Navy Blue. Is it possible to override this Color? I would like ...
c0D3l0g1c's user avatar
  • 3,122
2 votes
1 answer
1k views

WebAuthenticationBroker authenticate with LiveID returns Success status but no Security Token

I am using ACS to authenticate in a Windows 8 application. I am observing exactly what I expect in that the UI displays the authentication dialog and on successfully entering my LiveID credentials I ...
Redeemed1's user avatar
  • 3,990
2 votes
1 answer
849 views

Multiple calls wait on the same async task

Basically I have a lot of places in my app where in order to do something I need to make sure a product image is downloaded. I want to centralize this call into one place so I make sure to only ...
Josh Santangelo's user avatar
2 votes
2 answers
1k views

DateTime parse bug in WinRT Windows 8 RTM?

Having upgraded to Windows 8 RTM, some date time parsing code that I had has stopped working. I've replicated this using a standard console app: CultureInfo provider; provider = new CultureInfo("en-...
Paul Michaels's user avatar
2 votes
0 answers
303 views

c# WinRT Updating ListView with DatePicker

I am using Visual Studio 2013, .net 4.5. I am having a problem with updating my ListView from my DatePicker. When changing a date it should update my ListView with the new dates via my DateChanged ...
Brian's user avatar
  • 124
2 votes
0 answers
601 views

windows 8 metro app converts text to image [duplicate]

Is there a way to convert text to an image with Windows store app API? The analogous code in a normal windows app would be: graphics.DrawString(txt, font, Brushes, 0, 0);
Colin C's user avatar
  • 21
2 votes
0 answers
333 views

How to implement CCAvenue payament gateway in Windows 8 App using C# and XAML

I am trying to implement CCAvenue payment gateway in Windows 8 App using C#. I am not able to find how to achieve this. Is there any article related to integrating payment gateway in Windows 8 App?
Balraj Singh's user avatar
  • 3,441
2 votes
0 answers
561 views

UDP Discovery with WinRT (Metro-style APIs)

I'm having a lot of trouble trying to implement WS-Discovery in Metro. There doesn't seem to be support for Discovering services: I'd like to do the following in Metro, but don't think I'm able to ...
LB.'s user avatar
  • 13.9k
1 vote
4 answers
10k views

Data Binding an observable collection of strings

I have the following class: public class MyClass { public ObservableCollection<string> MyList { get; set; } public string MyListTitle { get; set; } ... I'm populating it as follows: ...
Paul Michaels's user avatar
1 vote
1 answer
2k views

Metro App ListView SelectedItem Selected VisualState

I have a Metro App with a ListView that contains this definition: <ListView Grid.Row="0" x:Name="lv" CanDragItems="True" CanReorderItems="True" IsTabStop="True" SelectionMode="Extended" ...
c0D3l0g1c's user avatar
  • 3,122
1 vote
2 answers
1k views

How to load/import dll with MEF out of metro app?

I've trying to write a extendable metro app using MEF. I got it working with a local extension (inside of the current assembly). Now I want to load a external dll. The DirectoryCatalog seems to be not ...
Jan K.'s user avatar
  • 2,582
1 vote
1 answer
913 views

Windows 8 Metro style App installation

I have x86 tablet running Windows 8 Pro and i am trying to install appx package created in RTM on it , i ran as administrator everything but application is not getting installed and I am getting ...
user1831591's user avatar
1 vote
1 answer
1k views

Action delegate in winrt api

Hi i an developing an app on windows rt.I tried to use Action but it says it is not a valid winrt type.I was not able to find any source about it which could elaborate further. my code public void ...
rakesh's user avatar
  • 602
1 vote
1 answer
887 views

How to search the Windows 8 contacts from .Net?

I'm doing estimates for a Windows 8 app, and I would like to programatically search the Windows 8 contacts store for a person's name based on their phone number or email address. Is this possible in ...
Jippers's user avatar
  • 2,665
1 vote
3 answers
402 views

Custom accept header not working on Windows Phone 8

I have a class in a Portable Class Library (targeting .NET 4.5 and Windows Phone 8.1) that uses the HttpClient (System.Net.Http.HttpClient) class to post a string to a web service. The service ...
Tom Faltesek's user avatar
  • 2,778
1 vote
1 answer
320 views

Metro App ListView Binding Item Issue

I am experiencing a unique problem with my Metro App. The problem is as follows: I have a Custom Serializable ObservableCollection which is capable of Sorting and Filtering. This object is then bound ...
c0D3l0g1c's user avatar
  • 3,122
1 vote
1 answer
233 views

Metro App Permissions Settings Charm

My Metro App, uses Notifications and requires Lock Screen Access. All working great! Now, I notice that a Permissions settings charm is automatically created, with an option to turn On and Off these ...
c0D3l0g1c's user avatar
  • 3,122
0 votes
2 answers
3k views

Create sub folders in My Pictures from Windows Store application

I'm trying to create a folder structure within My Pictures folder from a Windows store app. But I can't seem to get pass the first level. I create my first level folder using the following code: ...
Sun's user avatar
  • 4,578
0 votes
2 answers
1k views

generic methods with observablecollections

This is for a Windows 8.1 Store app using .Net 4.5 I found myself replicating the same code for each "object" that I have. So I'm trying to create a more generic method to get all the data the way I ...
webdad3's user avatar
  • 8,991
0 votes
2 answers
558 views

Web References (ASMX) on WinRT

I'm working on a Windows Store App for Windows 8.1, trying to connect to a Web Service. This Web Service has client implementations for both Web References and Service References. But I'm having ...
Pablo's user avatar
  • 3
0 votes
1 answer
902 views

Reflection issue in WinRT

I am having an issue porting a WP7 app to a win8 store app... I run this code to populate fields from elements inside XML file: Venue lv = new Venue(); foreach (var t in Fields) ...
Dan Sewell's user avatar
  • 1,278
0 votes
2 answers
139 views

Notify main thread when button is clicked

I am trying to create a Popup like this // Create a Popup var Pop = new Popup() { IsOpen = true }; // Create a StackPanel for the Buttons var SPanel = new StackPanel() { Background = MainGrid....
The87Boy's user avatar
  • 877
0 votes
1 answer
655 views

PInvoke in WinRT results in Error _NO_TOKEN(1008)

I am trying to access Battery device information (On the lines of Enumerating Battery Devices) using PInvoke and .Net4.5. I have one WPF application working fine, and able to get all sort of low level ...
Adarsha's user avatar
  • 2,317
0 votes
1 answer
450 views

Windows.Storage.FileIO - How to save objects

So I was using Isolated Storage to save my objects locally as XML. It worked, but now Microsoft has changed how it works. According to this site: http://msdn.microsoft.com/en-us/library/3ak841sy....
webdad3's user avatar
  • 8,991
0 votes
1 answer
118 views

Windows 8 XAML C# implement Page_Error?

I am trying to create a base page for my Windows 8 application. I am trying to create a page Error method so that any error that occur in the entire application can be bubbled up to base page and ...
Balraj Singh's user avatar
  • 3,441
0 votes
2 answers
2k views

C# JavasScriptSerializer in Windows 8

In this thread: How to convert XML to JSON using C#/LINQ? i found the code for Converting XML to Json. I tried to implement this to Windows 8 but i have a Problem that the: JavaScriptSerializer ...
MrTouch's user avatar
  • 654
0 votes
1 answer
777 views

Metro App HtmlAgilityPack construct well formatted Html

I have a Metro App that formats html from various sources and as such there isn't any consistency in the html structure. Fortunately, there's an HtmlAgilityPack build for Metro Apps which I think can ...
c0D3l0g1c's user avatar
  • 3,122