windows-8

How to append array of bytes to the existed StorageFile?

喜你入骨 提交于 2019-12-06 01:49:13
问题 I need to write to a file data by chunks of bytes consequentially (in my Metro app) and there is a class FileIO with methods AppendTextAsync and WriteBytesAsync but without needed AppendBytesAsync so how can I append an array of bytes to a StorageFile ? 回答1: This code seems to work for me: String s = "hello"; Byte[] bytes = Encoding.UTF8.GetBytes(s); using (Stream f = await ApplicationData.Current.LocalFolder.OpenStreamForWriteAsync ("hello.txt", CreationCollisionOption.OpenIfExists)) { f

How to check if file exists in StorageFolder in WinRT [duplicate]

可紊 提交于 2019-12-06 01:32:49
Possible Duplicate: Check if a file exists in the project in WinRT I'm using the StorageFolder and need to check if a file exists befor I read it to avoid a exception. my code looks like this: StorageFolder storageFolder = ApplicationData.Current.LocalFolder; StorageFile sampleFile = await storageFolder.GetFileAsync(myPath); the problem is, I can't find a method which checks if a file exist Last time I checked you had to catch an exception: (might have changed) Edit: this is one way to do it :) Like so: static async Task<bool> DoesFileExistAsync(string fileName) { try { await ApplicationData

How to get feedback from MediaCapture API in Windows 8

偶尔善良 提交于 2019-12-06 01:28:33
问题 I'm trying to do face tracking apps in Windows 8 app. And I aware that in order to access the camera stream, I have to use MediaCapture.AddEffectAsync() which has to be done incorporate with C++ as shown in this sample. Now I'm able to access the stream and track the face, but I'm not able to pass/return the tracking face coordinate to C# for further processing. One way I've tried is to invoke C# method in C++ to pass back the tracking coordinate. But no avail, because Visual Studio doesn't

Why did my XAML suddenly crash?

雨燕双飞 提交于 2019-12-06 01:27:14
I added a "Basic Page" to my project in a folder ("View") that I created within the project. At first all was well, but "all of a sudden" the design view failed and displayed: System.ObjectDisposedException Safe handle has been closed This is the XAML (I hadn't changed a thing in the default XAML generated yet): <common:LayoutAwarePage x:Name="pageRoot" x:Class="TimeAndSpaceLines.View.SectionPage" DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Is FluidMoveBehavior available?

你。 提交于 2019-12-06 01:23:43
I have calls to Grid.SetRow and Grid.SetColumn in my code which I'm trying to animate. According to the answer at http://social.msdn.microsoft.com/Forums/en-CA/wpf/thread/257779f7-b459-43fc-a4a1-f24641c50e09 , it is recommended to make use of FluidMoveBehavior, but it doesn't look like this is available for Windows 8. What are my options for animating the children of a Grid when their positions change? I'm basically looking for a way to achieve linear transition. There is a new built-in feature called Transitions that can be used, here is an intro . Try adding a RepositionThemeTransition to

How to give a “Empty ListView Message” when there is no data source

只愿长相守 提交于 2019-12-06 01:23:13
问题 My application have a ListView with GridLayout. I am now trying to introduce ListView groups into my application. Say, the data source would usually have Group1, Group2 and Group3. I would like to display all 3 groups all the time regardless there is element in it or not. When there is no element in a group, I want to display a "empty group" message under the group title. I think the default way that WinRT handles it is not to display the empty group and it makes a lot of sense in many

windows 8 android usb driver

流过昼夜 提交于 2019-12-06 01:14:43
问题 I have installed Windows 8 release preview and I cant install android USB drivers, it says this: and "the third party INF does not contain digital signature information" what to do? 回答1: I had the same issue a while ago. Seeing that the USB driver hasn't been updated since, the simple (and probably unsatifying) answer is revert back to windows 7. I've seen some scetchy drivers around but not for your device. Windows 8 is still in preview/developer stage and I doubt we'll see proper drivers

How to have user prompt dialogs in Windows 8 metro apps?

北城余情 提交于 2019-12-06 01:12:54
I would like to get some user inputs for my app like Name, DOB, etc from a modal window for this I need a dialog to be displayed which would contain the textboxes and other controls. Normally in WinForms/WPF I would create a class inherited from the Form/Window class and use the Show/ShowDialog method to present the form to the user How do I achieve this behavior in Windows 8 metro apps using XAML/C# ? I have looked at the MessageDialog class under the Windows.UI.Popups namespace but its for showing only message like the classic MessageBox. I have looked at another CoreWindowFlyout class and

Why can I not reference Bing Maps in my app?

Deadly 提交于 2019-12-06 01:11:04
I tried to add a Reference to Bing Maps in my app by right-clicking on References | Add References | Windows | Extensions | Bing Maps for C#... , but selecting "OK" does nothing - the Reference is not added. I then tried adding it via Tools | Extensions and Updates , but when I installed the latest version (with today's date - 11/5/2012), I then got: Successfully installed 'BingMapAppSDK 1.0.1011.1716'. Successfully uninstalled 'BingMapAppSDK 1.0.1011.1716'. Install failed. Rolling back... Could not install package 'BingMapAppSDK 1.0.1011.1716'. You are trying to install this package into a

Sending multiple parameters to WinJS.Binding.converter() function

半腔热情 提交于 2019-12-06 00:50:39
Is there a way to send more than one parameter to a WinJS.Binding.converter() function? Consider the following data and output: { contactName: "Tara Miller", mainNumber: "555-405-6190", alternateNumber: "555-209-1927" }, { contactName: "Bryan Bond", alternateNumber: "555-574-4270" }, { contactName: "Jenna Siever", mainNumber: "555-843-8823", alternateNumber: "555-799-5424" }, Here is the HTML. The MyData.chooseBestNumber converter function is used to display either a person's main phone number or the words "no main number" if they don't have a main number: <div id="listViewTemplate" data-win