windows-runtime

How to add items to XAML/WINRT Grid from Code

百般思念 提交于 2019-12-25 07:16:02
问题 So, I am trying to create a grid that can be dynamically populated by 0 to X items depending on when the Frame is open. I read the MSDN article on how to create a grid and add to it in code: http://msdn.microsoft.com/en-us/library/ms752271.aspx Howeverm I want to create the Grid in the XAML and add to it in the code. Something like this: XAML: <Grid x:Name="ManagePhotosContent" Grid.Row="1" Visibility="Visible"> <!-- to be filled in by code --> </Grid> In C# code i am doing something like

Qt WinRT App cannot access file permission denied

耗尽温柔 提交于 2019-12-25 07:11:37
问题 I need to develop WinRT App using Qt and FFMPEG, I build the ffmpeg for WinRT based on the instruction here and I am able to link the library with my project. Now I need to open a video file using avformat_open_input but it always giving me the output video decode error "Permission denied" Below is the relevant part of the code, int ret = avformat_open_input(&pFormatCtx, hls, NULL, NULL); if(ret != 0) { char errbuf[128]; av_strerror(ret, errbuf, 128); qDebug()<<"video decode error"<<QString:

Focusable WinRT UserControl with image background

你。 提交于 2019-12-25 06:36:50
问题 I'm having difficulty developing a WinRT control that can display an image as well as be focusable and receive keyboard input. The first part - displaying an image in a UserControl - is straightforward; using a child Rectangle whose background is an ImageBrush works fine. However, calling UserControl.Focus(FocusState.Programmatic) (or any other focus state) does not work - it returns false and focus is not set to the user control. Incidentally, this UserControl is currently being tested

Windows 8 Metro/Immersive App - Force Terminate

偶尔善良 提交于 2019-12-25 06:18:08
问题 I'm working on porting an app from iOS to WinRT/8 Metro/8 Immersive/Whatever the current name is. On iOS, we have the ability to set Application does not run in background to YES to cause the app to actually quit whenever the user leaves the app. I would like to figure out how to replicate this behavior in WinRT. Yes, I understand that this is abnormal behavior. Yes, I have thought this through. Yes, I have an extremely good reason for doing this. I'm assuming that during the userLeavingApp

Windows 8 Metro/Immersive App - Force Terminate

偶尔善良 提交于 2019-12-25 06:18:03
问题 I'm working on porting an app from iOS to WinRT/8 Metro/8 Immersive/Whatever the current name is. On iOS, we have the ability to set Application does not run in background to YES to cause the app to actually quit whenever the user leaves the app. I would like to figure out how to replicate this behavior in WinRT. Yes, I understand that this is abnormal behavior. Yes, I have thought this through. Yes, I have an extremely good reason for doing this. I'm assuming that during the userLeavingApp

Touch gestures in WinRT (using monogame)

谁都会走 提交于 2019-12-25 05:34:17
问题 I currently have the following code: internal void HandleTouch() { TouchPanel.EnabledGestures = GestureType.DragComplete | GestureType.FreeDrag; while (TouchPanel.IsGestureAvailable) { GestureSample gesture = TouchPanel.ReadGesture(); if (gesture.GestureType == GestureType.DragComplete) { MyAction(gesture.Delta.X, gesture.Delta.Y); } else if (gesture.GestureType == GestureType.FreeDrag) { OtherAction(); } } } The problem that I have is that the Delta is always 0. I read somewhere that

How to refresh the UI in a metro app?

对着背影说爱祢 提交于 2019-12-25 05:31:03
问题 I'm using this code in a XAML page: <TextBox ItemsSource="{Binding Posters, Converter={StaticResource collectionToFirstElementConverter}, Mode=TwoWay}" /> Posters is an ObsevableCollection and I'm using a converter where takes the collection and gets the first element of it. As I'm using async procedures, where the textbox receives the object, this one has no elements (Count=0), and calls the converter. I'm trying to update the textbox everytime the property add new elements, but not calls

How to control number of items appearing in GridView rows and columns in a Metro Style GridView App?

邮差的信 提交于 2019-12-25 05:08:05
问题 I create GridView app and in the itemspage after binding items with the grid, it appears with 4 rows and 5 columns, when I rotate ScrollViewer to Vertical. It appears with only one column. How can I control the number of rows and columns? 回答1: You can control it in many ways depending on your layout which you have not shared. If you want a fixed number - make sure the height/width of your GridView is the correct multiple of the number of columns/rows that you want displayed. For example for a

Possible solution to issue with multiple UI dispatchers in the same method?

别说谁变了你拦得住时间么 提交于 2019-12-25 04:30:12
问题 I'm having a problem with using multiple UI dispatchers to modify an list that is bound to the UI. The method with just exit when it hits the first dispatcher. If I wrap the entire method in the dispatcher it works, but I have another solution but I'm not sure it's appropriate: Basically, I have a socket listening in a never-ending loop for network commands from a media device. When it finds one, it calls ProcessCommand. That function calls one of 50+ methods to process the specific commands.

GridView displays first element different than all others - XAML, Win8.1, WinRT

让人想犯罪 __ 提交于 2019-12-25 04:28:14
问题 I'm using GridView in my Universal Apps project for display list of items. Each item is a User Control. First element always is rendered different than all others elements at the list! How to fix it? <GridView Grid.Row="1" x:Name="CategoriesGridView" Margin="120,20,0,20" SelectionMode="None" IsItemClickEnabled="False" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ItemsSource="{Binding CategoriesCollection}" ItemContainerStyle="{StaticResource GridViewItemStyle}"> <GridView.ItemTemplate>