windows-runtime

Virtualizing/Paging Data in ObservableCollection bound to ItemsControl in WinRT

邮差的信 提交于 2019-12-12 06:13:00
问题 How can we Visualize data in an ObservableCollection or List which is set as ItemSource of ItemsControl? We are using ItemsControl within a ScrollViewer to make a custom collections control, due to some technical reasons(Design Constraints), we can not use ListView, or GridView controls which supports VirtualizingStackPanel and Data Virtualization through ISupportIncremental, so we must use ItemsControl within a ScrollViewer. So how can our ScrollViewer control notify the bound observable

How to programmatically click a button in WinRT?

一笑奈何 提交于 2019-12-12 06:07:42
问题 How is this possible for WinRT? I have read the answer for WPF How to programmatically click a button in WPF?, but does not really help me. Anyone solved such an issue? 回答1: First, I'd like to say if you want the button to "appear to have been pressed (in terms of animation/highlight effects) this won't help you but otherwise it should. My Advice to you would be to follow the Model-View-ViewModel (MVVM) design pattern when designing your application if you haven't already. That way instead of

Debug Media Foundation

ぐ巨炮叔叔 提交于 2019-12-12 06:04:27
问题 I'm currently trying to write a ByteStreamHandler and an audio decoder to add support for an unsupported codec in a windows store app. I followed this MPEG1 sample and adjusted it for my needs. However I'm not sure if it is loaded correctly since I always get the error MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED with the HRESULT E_FAIL . I've added values to all E_FAIL results I use in my code to figure out where it happens unfortunately it doesnt seem to happen in my code. Now I'd like to know if

convert arabic date string to datetime object in c#

天涯浪子 提交于 2019-12-12 05:58:11
问题 I have date time in string format coming from server which I can't change. DateTime is coming in this format and is in Arabic : 14-يوليه-2015 04:44:51 م and I am unable to convert it in datetime object in c#. I have tried these so far. DateTime latest = Convert.ToDateTime(latestTables.Result.StaticTable[i].dtUpdTime, new CultureInfo("en-US")); DateTime latest = DateTime.ParseExact(latestTables.Result.StaticTable[i].dtUpdTime, "dd-t hh:mm:ss yyyy-MMM", CultureInfo.InvariantCulture); DateTime

Windows Metadata Exporter Crashes when Compiling Windows Runtime Component

▼魔方 西西 提交于 2019-12-12 05:57:36
问题 I'm attempting to create a Windows Runtime Component for use in a Windows 8 app. This is essentially a helloworld level application and so has nothing complex. The only thing that I need to do to replicate the issue is to include a pair of methods such as the following: public IAsyncOperation<string[]> GetThings() { return GetThingsAsync().AsAsyncOperation(); } private async Task<string[]> GetThingsAsync() { return new List<string>().ToArray(); } Whenever I compile the project, the Windows

CreateFile2 error in WinRT project (ERROR_NOT_SUPPORTED_IN_APPCONTAINER)

和自甴很熟 提交于 2019-12-12 05:38:25
问题 I just working on some file management api in WinRT. I successfully created folder in ../Packages/myApp/LocalState/ but when I try to create new file ( CreateFile2 ) in that folder I get this error 4252: ERROR_NOT_SUPPORTED_IN_APPCONTAINER This functionality is not supported in the context of an app container. code: localFolder = L"C:\\Users\\Tomas\\AppData\\Local\\Packages\\myApp\\LocalState\\my"; CreateDirectory(localFolder.c_str(),NULL); localFolder += L"\\MyFile.txt"; CREATEFILE2_EXTENDED

XAML: Limiting size of control nested in ScrollViewer (to scroll nested within the ScrollViewer)

家住魔仙堡 提交于 2019-12-12 05:34:04
问题 I am trying to nest a user control within a ScrollViewer making its height the same as height of the ScrollViewer, which may vary based on screen size (i.e. not fixed). The ScrollViewer is responsible for horizontal scrolling and has vertical scrolling disabled. The nested user control has a grid with two rows - "header" (another user control) and a ListView. This ListView should be vertically scrollable. The objective here is that the "header" stays in place and large content of the ListView

How to set property isEnabled in each subitem button of listview in windows phone winrt?

耗尽温柔 提交于 2019-12-12 05:29:12
问题 I have listview. In this listview I have listview.item that contains button. I bind my listview to some datasource, so I have many buttons. How to disable all of this buttons? http://pastebin.com/6MFDfX9S 回答1: Looking at your code, besides binding to "Title", "Date", "DownloadedOrNot" and "Info" you can add another property and bind that to the IsEnable property of the buttons, like "IsEnable. If you need to change the value of this property you can always traverse your ListView Items like

Can a C++/CX interface inherit from IClosable?

六月ゝ 毕业季﹏ 提交于 2019-12-12 05:25:07
问题 How does one declare a runtime interface that inherits from Windows.Foundation.IClosable in C++/CX? Both of these attempts produce compiler errors: public interface class MyInterface : Windows::Foundation::IClosable { /* bla bla */ }; ==> error C2039: 'IClosable' : is not a member of 'Windows::Foundation' and public interface class MyInterface { /* bla bla */ ~MyInterface(); }; ==> error C2849: 'MyInterface' : an interface cannot have a destructor Yet it cannot be that such inheritance is

Overwrite Accent Color in App

瘦欲@ 提交于 2019-12-12 04:48:34
问题 I try to create a own design for my app. One of the main things is, that I want to replace the accent color with my own color. Now I can overwrite the brush with this: <Color x:Key="AppAccentColor">#ff6b53</Color> <SolidColorBrush x:Key="PhoneAccentBrush" Color="{StaticResource AppAccentColor}"/> Now if I assign the PhoneAccentBrush somewhere it displays the correct color. But if I click on a TextBox the Border is still the Color of the Color set in the system settings. I tried to overwrite