microsoft-metro

Design time data in Windows Store app

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 04:28:03
问题 In WP7 I am used to generating sample data (XML) from my ViewModels in Blend and seeing them in Visual Studio. In Blend 2012 I cannot find the option to generate design time data. The tempales in Visual Studio use design time data genarated in code. Is it the only way? No more XML design time data? 回答1: I don't think generating design time data in Blend for VS2012 is possible, but it's still possible to use design time data created in code, but even this is more complicated than in WP7.

How to create ControlTemplate from code behind in Windows Store App?

只谈情不闲聊 提交于 2019-12-13 04:14:38
问题 UPDATE 1 If ControlTemplate has binding, will XamlReader.Load(...) work ? <ControlTemplate TargetType="charting:LineDataPoint"> <Grid> <ToolTipService.ToolTip> <ContentControl Content="{Binding Value,Converter={StaticResource DateToString},ConverterParameter=TEST}"/> </ToolTipService.ToolTip> <Ellipse Fill="Lime" Stroke="Lime" StrokeThickness="3" /> </Grid> </ControlTemplate> I want to achieve this from code behind. <ControlTemplate> <Ellipse Fill="Green" Stroke="Red" StrokeThickness="3" /> <

WASAPI + windows store app initialization

大兔子大兔子 提交于 2019-12-13 02:32:52
问题 I am trying to write a program which captures your speech applies my effect on the captured audio and play it back immediately. I am writing this app to the windows store in c++. After suffering with MediaCapture I decided to use WASAPI to do that. I am using an example from the msdn to set up WASAPI. As I expected I ran into a problem very soon. So the problem is with the following two lines: const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator); const IID IID

How to create a file from System.IO.Stream in metro apps?

喜你入骨 提交于 2019-12-13 02:23:02
问题 Stream stream = await new HttpClient().GetStreamAsync( url ); How can i create a file in app's local folder having data downloaded through this stream as file content? 回答1: You could probably do some kind of stream to stream copy. However, I happen to just use the response object in my code: var client = new HttpClient(); var response = await client.GetAsync(uri); if (response.IsSuccessStatusCode) { Stream stream = null; StorageFolder localFolder = ApplicationData.Current.TemporaryFolder;

Removing the BackStack Entry in MetroStyle Application

三世轮回 提交于 2019-12-13 00:29:16
问题 How can I implement removing the backStack Entry in Metro style applications? 回答1: frame.SetNavigationState("1,0"); will clear the navigation history for you. 回答2: I found this answer useful: How to clear Backstack of the frame and start afresh Write your own NavigationService and store the navigationstate in the constructor. string state; public NavigationService(Frame mainFrame) { state = mainFrame.GetNavigationState(); _mainFrame = mainFrame; _mainFrame.Navigating += _mainFrame_Navigating;

DriveInfo equivalent in WinRT/Metro App

徘徊边缘 提交于 2019-12-12 19:12:35
问题 I need to scan all the local drives (and the directories) in a Metro App that I'm working on. I've searched everywhere I could, but without any success. Basically, I need something similar to what is shown as an example here: http://msdn.microsoft.com/en-us/library/system.io.driveinfo.aspx 回答1: Remember that metro style applications are severely restricted in the parts of the operating system they can access. I don't believe that it is possible for a metro style app to scan arbitrary

Disable Application from sleeping in Windows 8 Metro

落花浮王杯 提交于 2019-12-12 18:29:08
问题 I am working on an app which displays videos and am running into an issue where the machine goes to sleep after hitting the sleep time limit while a video is playing. Is there a way to disable this behavior in a Windows 8 Metro application? 回答1: You should use the DisplayRequest class, specifically DisplayRequest.RequestActive for this purpose. You must also remember to call DisplayRequest.RequestRelease once you are done to allow the display to sleep, for example, if you are not actively

How to navigate between different html pages in Windows 8 Metro application using javascript?

纵饮孤独 提交于 2019-12-12 18:14:40
问题 How can i navigate between different html pages using javascript? I tried to use the below statement but it's not working. I have added a breakpoint and found that the below statement is executed.But still It doesn't display the page2.html . WinJS.Navigation.navigate("page2.html", null); Can anyone tell me why in what all scenarios it won't work ? One option I found was iframe which I haven't tried yet. 回答1: This API isn't a specific page navigator; it's about loading the location as defined

How to change the item template of list box depending upon the Current Orientation in metro app?

不打扰是莪最后的温柔 提交于 2019-12-12 17:09:57
问题 Hi I am developing an metro app , my app works perfectly fine in landscape mode but now i want to make it compatible to Portrait mode also. This is how i have defined students listbox :- <ListBox x:Name="lstbxbStudents" Background="Transparent" Height="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionChanged="lstbxbStudents_SelectionChanged_1" HorizontalAlignment="Left" Width="Auto" Margin="4,50,0,122" Style="{StaticResource ListBoxStyle1}"> <ListBox.ItemTemplate> <DataTemplate>

Parse JSON ISO8601 date in C++/CX

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 16:36:04
问题 I have a date string coming from JSON "2012-08-01T15:42:06Z" and want to parse that in Windows Runtime. As far as I know, only COleDateTime is available to handle this. I can only get it to correctly parse the string when I take out the 'T' & 'Z' characters, but that adds an extra parsing step on my end. WORKS: COleDateTime dateTime; dateTime.ParseDateTime(L"2012-08-01 15:42:06", 0UL, 1033UL); FAILS: COleDateTime dateTime; dateTime.ParseDateTime(L"2012-08-01T15:42:06Z", 0UL, 1033UL); Anyone