windows-store-apps

ListView ItemTemplate 100% width

流过昼夜 提交于 2019-12-18 10:48:26
问题 How can I make content of each ListView item expands to 100% width when using a DataTemplate ? I have tried HorizontalContentAlignment="Stretch" in the ListView and HorizontalAlignment="Stretch" in the DataTemplate , but nothing seems to work, content is still aligned to the left. I have something like this: <ListView x:Name="questionsView" Background="{StaticResource ApplicationPageBackgroundThemeBrush}" HorizontalContentAlignment="Stretch"> <ListView.ItemTemplate> <DataTemplate> <Border

What header to include for an NTSTATUS when building for ARM platforms?

半世苍凉 提交于 2019-12-18 09:23:58
问题 I'm working under the VS2013 ARM Developer Prompt. I'm trying to use Microsoft's Cryptography Next Generation (CNG), but I'm experiencing some non-trivial problems. I'm trying to compile a simple test program: #include <windows.h> #include <bcrypt.h> int main(int argc, char* argv[]) { BCRYPT_ALG_HANDLE hProvider = NULL; NTSTATUS ret = BCryptOpenAlgorithmProvider(&hProvider, BCRYPT_RNG_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0); if (!(BCRYPT_SUCCESS(ret))) { return -1; } unsigned char buffer[20];

Go to visual states inside a Grid in code behind in Windows Store apps

吃可爱长大的小学妹 提交于 2019-12-18 09:16:34
问题 So my xaml code looks like this - <Grid x:Name="LayoutRoot"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> I can't use the GoToVisualState behavior because I need to do some checks before running this animation. So I guess I will have to call something like GoToState or GoToElementState in code behind. However, ExtendedVisualStateManager doesn't seem to exist in WinRT . I tried using VisualStateManager.GetCustomVisualStateManager(this.LayoutRoot) but it

URI schemes supported in Windows 8 apps

烂漫一生 提交于 2019-12-18 06:54:51
问题 What are the URI schemes supported in Windows 8 apps? I have seen references to ms-appx: and ms-appdata: and some rare mentions of ms-resource: but I could not find any document that would be a list of the schemes (although I thought I have seen one in the past). I am wondering if URL.createObjectURL returns some other schemes, but I can't see a version of it for XAML apps. http://msdn.microsoft.com/en-us/library/windows/apps/Hh781215.aspx. Are there any other URI schemes supported in WinRT?

Is dispatchEvent a sync or an async function

核能气质少年 提交于 2019-12-18 04:37:11
问题 I am trying to write an event handler for a custom event in WinJS. I am not too sure how this works in IE - I am creating a custom event and dispatching it - var eventObject = document.createEvent("CustomEvent"); eventObject.initCustomEvent("dropbomb", true, true, null); this._element.dispatchEvent(eventObject); My handler is - this._element.addEventListener("logtelemetry", function () { console.log("boom"); }); Can I be certain that the handler will be called in sync and not at a later time?

Windows 8 theme color - accessing it programmatically

无人久伴 提交于 2019-12-18 03:33:18
问题 In windows 8 consumer preview you can personalize your experience, including setting a 'background color' which is then also used as the background for selected tiles, app bar etc. So selecting orange will mean that orange accents are visible in the Windows 8 Metro UI. I am currently authoring some custom controls, and I would like to have access to this color in my styling, so as the user changes color so my applications accents are re-colored accordingly. I cannot find a way of getting at

Is it possible to await async tasks during a button click?

折月煮酒 提交于 2019-12-18 03:09:12
问题 I have a refresh button in my app that uses some async methods to update the list of items displayed. The problem is that I can't have a return type of Task for the event handler for the button click so I'm left with an async void method. Thus, the user can hit the refresh button, then select an item while the list is being repopulated which will result in an error. start of code that handles button click: private async void Button_Click_1(object sender, RoutedEventArgs e) { await ViewModel

Load more items on grid view scroll end

我与影子孤独终老i 提交于 2019-12-17 19:31:03
问题 I am developing a Windows Store Application in XAML/C# and I have a GridView displaying 12 items at a time (3 x 4). What I need to do is once the user scrolls to the end, more items are added to the GridView. How do I catch the event for scrolling at end?? I tried many approaches, but nothing worked... UPDATE: It took me a LOOOONG time and lots of examples to figure what I was doing wrong. ListView worked, but GridView didn't... Finally I noticed that the GridView items must have a width

HTTPClient every time returns the same string

烈酒焚心 提交于 2019-12-17 19:25:18
问题 Could some one make me clear why my code returns the same string every time? public MainPage() { this.InitializeComponent(); DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(5); timer.Tick += OnTimerTick; timer.Start(); } private void OnTimerTick(object sender, object e) { getData(); HubText.Text = dumpstr; } private async void getData() { // Create an HttpClient instance HttpClient client = new HttpClient(); var uri = new Uri("http://192.168.4.160:8081/v")

Can Windows Store applications be built with Mingw?

眉间皱痕 提交于 2019-12-17 18:54:51
问题 Is there a way to build Windows Store applications with the Mingw toolchain? (And ultimately cross compile them from mingw on Linux, since if it works in one Mingw toolchain it should work in another.) I guess one requirement is to stick to the API:s allowed in the Windows Store app sandbox, but what other things are there to consider before distribution to the store? XAML? 32 or 64 bit code? Since Mingw C++ is not link compatible with MSVC++, I assume plain C programs without WRL would be