win-universal-app

How to “set” a selected camera with combobox in Windows 10 Universal App

天涯浪子 提交于 2020-01-07 03:02:34
问题 I am developing windows application.I want to switch from Front Camera to Back Camera with a Combobox in Windows Universal App or in WPF . I have coded something but I don't get where I made a mistake. Here is my code: <ComboBox x:Name="SettingsCamera" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0" Margin="0,5" SelectionChanged="SettingsCamera_SelectionChanged"/> private async void InitializeCameraAsync() {DeviceInformation device = FindCameraDeviceByPanelAsync(Windows.Devices

Win2D library: CanvasImageBrush paints using the Canvas coordinates?

孤人 提交于 2020-01-07 02:39:09
问题 G'day Folks, I've started to explore the Win2D library for a Windows 10 UAP app. I am drawing an ellipse and filling it using a previously defined CanvasImageBrush. It appears the coordinates being used as fill are based on the screen coordinates where the ellipse is drawn. In other words, an ellipse in the top left corner looks fine, but elsewhere on the page, the ellipse is filled with black. I set the ExtendX and ExtendY properties "Wrap" to test my hypothesis, and the ellipse is drawn as

Regular expression to match everything, except HTML tags

懵懂的女人 提交于 2020-01-07 01:53:28
问题 <tr><td>Di, 12.04.16</td><td>1</td><td>D</td><td>D</td><td>255</td><td>ABC</td><tr> I want to only match ABC or anything else that stand between <td> </td> (before and after ABC) This Patter doesnt work for me: ((?!<tr><td>[D-M][i-r],[' ][0-3][0-9]\\.[0-1][0-9]\\.[0-9][0-9]</td><td>[1-9][0-2]?</td><td>[A-Z]?[A-Z]?[A-Z]?[A-Z]?[1-5]?</td><td>(---|[A-Z]?[A-Z]?[A-Z]?[A-Z]?[1-5]?)</td><td>).*(?!</td></tr>)) Do you have any idea? Thx for help 回答1: As Amy said, don't use regex to parse HTML. You can

Access music files UWP -KnownFolders.MusicLibrary.GetItemsAsync() doesnt return anything

醉酒当歌 提交于 2020-01-07 01:23:11
问题 Hey i have the following : var fileList = await KnownFolders.MusicLibrary.GetItemsAsync(); It doesn't return any files and i have files in the Music folder. I also have : <Capabilities> <Capability Name="internetClient" /> <Capability Name="removableStorage" /> <Capability Name="documentsLibrary" /> <Capability Name="MusicLibrary" /> <Capability Name="HomeGroup" /> <Capability Name="RemovableDevices" /> I dont know why it doesnt return any files/ exception ? Any suggestions ? I also tried

Canvas Image Shuffle

◇◆丶佛笑我妖孽 提交于 2020-01-06 21:06:22
问题 So I have a Canvas and a set of 18 Images in it and I want to shuffle the Images foreach (var myImg in GameCanvas.Children.OfType<Image>()) { GetTop.Add(Canvas.GetTop(myImg)); GetLeft.Add(Canvas.GetLeft(myImg)); listNum++; myImg.IsTapEnabled = false; } I have this part to add the Top and Left of each image in a separate list BUT when I try this foreach (var myImg in GameCanvas.Children.OfType<Image>()) { int ran = rand.Next(GetTop.Count); double Top = GetTop[ran]; double Left = GetLeft[ran];

Detect Universal App at Runtime in PCL

旧时模样 提交于 2020-01-06 16:53:13
问题 Is there any way to detect that a main application is a Universal App (W10) from a Portable Class Library? Thanks 回答1: Out-of-the-box I do not think the functionality you are asking for is available in PCL, but here is a suggestion involving reflection that you might want to try. It is adapted to the PCL Profile (328) you are using, involving .NET 4 and Silverlight 5. The GetPlatformName method needs to be somewhat adjusted if you want to for example switch to PCL profiles 111 and 259, since

How to perform View navigation using MVVM? Win RT

随声附和 提交于 2020-01-06 13:04:35
问题 I've started a Windows Universal project following the MVVM pattern, and came to the situation where I need to navigate to another page with a button click. Normally I would do this in code behind using the button's click event like the below: private void AppBarButton_Click(object sender, RoutedEventArgs e) { // Navigation Without parameters this.Frame.Navigate(typeof(SecondPage)); } But since I need to follow the MVVM pattern with this app, I'm wondering how should I set up the navigation

UWP Get Children from Templated TabViewItem

穿精又带淫゛_ 提交于 2020-01-06 09:56:57
问题 I have got the TabViewItem using: var tab = PlaylistTabView.ContainerFromIndex(PlaylistTabView.SelectedIndex); However, it doesn't seem that I am accessing the correct children. This is the xaml of TabView.ItemTemplate , where PlaylistControl is my custom control and basically just a ListView : <controls:TabView.ItemTemplate> <DataTemplate x:DataType="data:Playlist"> <local:PlaylistControl AllowReorder="False" AlternatingRowColor="True" ItemsSource="{x:Bind Songs, Mode=OneWay}"> <local

UWP Get Children from Templated TabViewItem

99封情书 提交于 2020-01-06 09:56:09
问题 I have got the TabViewItem using: var tab = PlaylistTabView.ContainerFromIndex(PlaylistTabView.SelectedIndex); However, it doesn't seem that I am accessing the correct children. This is the xaml of TabView.ItemTemplate , where PlaylistControl is my custom control and basically just a ListView : <controls:TabView.ItemTemplate> <DataTemplate x:DataType="data:Playlist"> <local:PlaylistControl AllowReorder="False" AlternatingRowColor="True" ItemsSource="{x:Bind Songs, Mode=OneWay}"> <local

Extracting specific File from archive in UWP

房东的猫 提交于 2020-01-06 08:15:25
问题 To save space I have zipped my books(in xml format) in my UWP Project. I want to Extract a file to my Local Folder based upon it's name. Till Now what I have done(This extracts all files) : ZipFile.ExtractToDirectory(sourceCompressedFile.Path, destinationFolder.Path); However this extracts all the files from my archive to my destination folder. I know this could be a trivial task using SharpZipLib but this is an inbuilt method and would help me reduce my app size . I simply want to extract a