windows-runtime

DateTime XAML WinRT

孤人 提交于 2019-12-11 08:47:58
问题 Passing a string to the DependencyProperty of a control that takes a DateTime does not seem to be allowed: Cannot assign text value '00:00:00' into property 'StartTime' of type 'DateTime' Is it just me or shouldn't this be possible? The workaround I suppose is to provide a IValueConverter to convert strings to DateTime objects. For Scheduler/Calender like controls this is a little annoying. Shed some light? 回答1: TypeConverter isn't available in WinRT and while the platform seems to have some

How to bind my ObservableCollection two way to a ListView Extension WinRT Xaml Toolkit

跟風遠走 提交于 2019-12-11 08:43:52
问题 I have a Windows 8.1 application with a ListView and I am using ListViewExtensions from WinRt Xaml Toolkit(Obtained latest from Nuget) to bind BindableSelection Here is my XAML <ListView ItemsSource="{Binding AllItems}" SelectionMode="Multiple" ext:ListViewExtensions.BindableSelection="{Binding SelectedItems, Mode=TwoWay}"> <ListView.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding}" /> </DataTemplate> </ListView.ItemTemplate> </ListView> In my ViewModel I have the following

Read Base64 image with C# in a Windows 8 app

浪子不回头ぞ 提交于 2019-12-11 08:42:10
问题 I'm trying to display an image on a Windows 8 app. The image data is gathered from a web service, and provided as a Base64 encoded string. I found the following on Stack Overflow: How do i read a base64 image in WPF? However, when I come to use the BitmapImage Class, I can't seem to access System.Windows.Media.Imaging, even though the following Microsoft documentation leads us to believe that it is available for use in .NET 4.5, and with Windows 8 apps: http://msdn.microsoft.com/en-us/library

Using IMFSourceReader to open a video file

≡放荡痞女 提交于 2019-12-11 07:56:30
问题 I want to open a video file using IMFSourceReader to access its Frames as IMFSample. In a WinRT C++ Class I send the RandomAccessStream of a video file and use the following code to create an IMFSourceReader object. HRESULT hr = S_OK; ComPtr<IMFSourceReader> pSourceReader; ComPtr<IMFByteStream> spByteStream; if (SUCCEEDED(hr)) { // Initialize the Media Foundation platform. hr = MFStartup(MF_VERSION); hr = MFCreateMFByteStreamOnStreamEx((IUnknown*)InputVideoStream, &spByteStream); ComPtr

Is it possible to use tile templates with secondary tiles in a Windows Store App?

百般思念 提交于 2019-12-11 07:50:03
问题 The title is the whole question: Is it possible to use tile templates with secondary tiles in a Windows Store App? Also can secondary tiles animate? It looks like the answer is no, even in Windows 8.1 but maybe I am just missing something. Here is a link to the Tile Template: http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.notifications.tiletemplatetype.aspx Here is a link to the SecondaryTile class: http://msdn.microsoft.com/library/windows/apps/br242183 It's weird because

How to Play Video File On D Drive In WinRT?

爱⌒轻易说出口 提交于 2019-12-11 07:34:40
问题 Using XAML C# in Windows "Metro" Apps how do I go about playing a certain video file. Examples: D:\video1.wmv \\MEDIAPC\video2.wmv The only way I managed to get this working so far is by using FilePicker, but I don't want to use this as I already have a list of files to play. I have tried to use GetFileFromPathAsync but I keep getting permission / access issues await StorageFile.GetFileFromPathAsync(@"D:\video1.wmv"); Apologies if this has been answered I just couldn't find an answer that

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

三世轮回 提交于 2019-12-11 07:28:35
问题 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 present in .net 4.5. So I tried to use ApplicationCatalog but I got the following error while calling SatisfyImportsOnce : Assembly.LoadFrom is not supported in AppX. . Here's me code: var catalog = new AssemblyCatalog(GetType().GetTypeInfo().Assembly); ApplicationCatalog catApp = new

For Win 8 Metro App, how to start background task immediately without Trigger?

限于喜欢 提交于 2019-12-11 07:25:00
问题 The MSDN sample showed how to use the built-in System Triggers to start background tasks. How do you start a task without Trigger? Or how do you implement a custom Trigger? Some code would be nice. I am using XAML/C#. 回答1: According to this thread. Seems that you can't just launch a Background Task or make your own Trigger. In this case, a Metro app may not be appropriate... 来源: https://stackoverflow.com/questions/8859139/for-win-8-metro-app-how-to-start-background-task-immediately-without

WebViewProcessControl initialization crash

[亡魂溺海] 提交于 2019-12-11 07:19:32
问题 The Problem I'm trying to use the "modern" web view API in my Win32 program, but when I initialize WebViewControlProcess , the program hangs for a couple of seconds, and then suddenly exits. Minimal Example // cl minimal.cpp /EHsc /std:c++17 /await windowsapp.lib #include <winrt/Windows.Foundation.h> #include <winrt/Windows.Web.UI.Interop.h> using namespace winrt; using namespace Windows::Foundation; using namespace Windows::Web::UI::Interop; int main(void) { winrt::init_apartment(); printf(

MediaEngine audio playback on WinRT

扶醉桌前 提交于 2019-12-11 07:18:58
问题 I'm trying to add music to my game that runs on WinRT. The music should be in an encoded format (mp3, ogg, etc.) and should be streamable and be decoded by the hardware (for performance reasons). I've looked through the samples, and found out that MediaEngine can do something like this (I hope). However, I'm having problems making it work. I keep getting ComExceptions everytime I try to create IMFByteStream from IRandomAccessStream via MFCreateMFByteStreamOnStreamEx() . It might be that I'm