uwp

Does the new SvgImageSource class designed for UWP can be used in WPF project

守給你的承諾、 提交于 2020-02-26 01:00:04
问题 It seems that a relatively new class: SvgImageSource can only be used in UWP. Is there any way to use it in a WPF project and how? 回答1: It will be possible to use any UWP XAML UI in WPF using XAML Islands. This is currently available as a preview using the WindowsXamlHost control which is part of the Windows Community Toolkit . Also note, that when using UWP controls in WPF apps, the app will then work only on Windows 10 client PCs. 回答2: Please take a look at this framework: SharpVectors The

Does the new SvgImageSource class designed for UWP can be used in WPF project

让人想犯罪 __ 提交于 2020-02-26 00:56:52
问题 It seems that a relatively new class: SvgImageSource can only be used in UWP. Is there any way to use it in a WPF project and how? 回答1: It will be possible to use any UWP XAML UI in WPF using XAML Islands. This is currently available as a preview using the WindowsXamlHost control which is part of the Windows Community Toolkit . Also note, that when using UWP controls in WPF apps, the app will then work only on Windows 10 client PCs. 回答2: Please take a look at this framework: SharpVectors The

depth and infrared frame on a surface pro

烈酒焚心 提交于 2020-02-23 06:43:25
问题 I ran the sample UWP application CameraFrames found in https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/CameraFrames which is supposed to grab the infra red and depth frames. However I have never got those frames. I can see the rgb frame fine. I am running the application on a surface pro that has does have an infra camera. Is there something I am missing? I also tried the sample on another machine with an Intel RealSense camera and still no luck. Though I wasn't

UWP: how to prevent page-level scroll bounce effect when scrolling inside a list?

生来就可爱ヽ(ⅴ<●) 提交于 2020-02-21 06:28:09
问题 I've got the following simple XAML page setup: <Page ...> <ScrollViewer> <StackPanel> <Border Height="100"> <TextBlock Text="Block 1" /> </Border> <ListView Height="200"> <ListViewItem Content="Lorem" /> <ListViewItem Content="Ipsum" /> <ListViewItem Content="Lorem" /> <ListViewItem Content="Ipsum" /> <ListViewItem Content="Lorem" /> <ListViewItem Content="Ipsum" /> </ListView> <Border Height="800"> <TextBlock Text="Block 2" /> </Border> </StackPanel> </ScrollViewer> </Page> Typically I'm

UWP : PRI277: 0xdef00532 - Conflicting values for resource ''

别说谁变了你拦得住时间么 提交于 2020-02-20 08:38:25
问题 As a part of the Visual Studio 2017 UWP build process, an app called MakePri.exe is run. It is throwing an error in my project but I have no idea why. The command line call is: C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\MakePri.exe New -ProjectRoot C:\AdaptSource\src\Xivic\Adapt.Presentation.XamarinForms\Adapt.Presentation.Xivic.UWP\ -ConfigXml obj\x86\Debug\priconfig.xml -OutputFile C:\AdaptSource\src\Xivic\Adapt.Presentation.XamarinForms\Adapt.Presentation.Xivic.UWP\bin\x86

UWP 创建动画的极简方式 — LottieUWP

本秂侑毒 提交于 2020-02-17 18:52:04
提到 UWP 中创建动画,第一个想到的大多都是 StoryBoard。因为 UWP 和 WPF 的界面都是基于 XAML 语言的,所以实现 StoryBoard 会非常方便。 来看一个简单的 StoryBoard 例子: <Page...> <Grid x:Name="grid"> <Grid.Resources> <Storyboard x:Key="demoStoryBoard" AutoReverse="True" RepeatBehavior="Forever"> <DoubleAnimation Duration="0:0:1" To="500" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/> <DoubleAnimation Duration="0:0:1" To="500" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="ellipse" d

Win10 UWP开发系列:开发一个自定义控件——带数字徽章的AppBarButton

自古美人都是妖i 提交于 2020-02-16 13:00:27
最近有个项目有一个这样的需求,在文章浏览页底部有几个AppBarButton,其中有一个是评论按钮,需要在评论按钮上显示一个红色数字,类似微信的新消息提醒: 这种设计在iOS和Android平台都是很常见的,但UWP上并没有提供现成的控件。所以只能自己实现一个了。 做出来效果是这样的: 分析一下实现的思路。首先这还是一个AppBarButton,只是其中增加了一个数字徽章的显示,这个属性应该是可以绑定到其他属性的,如果绑定的值不为0,则显示数字,如果为0则隐藏数字。因此我们可以通过继承AppBarButton,并修改其模板来实现这个控件。 下面动手实践一下吧。我已经安装了最新的VS2017,不过使用VS2015的话也是差不多的。首先创建一个名为AppBarBadgeButtonSample的UWP项目: 选择在Blend中打开: 在页面上添加一个AppBar: 添加后是这样的结构: 然后需要将默认AppBarButton的模板导出来,给我们自定义的控件用。在按钮上右键选择编辑模板,编辑副本: 输入一个名字,为了简单起见我们就在当前文件中创建这个样式好了,点击确定。 切换到XAML模式,可以看到页面的XAML代码中添加了这样的资源: 这个就是AppBarButton的控件模板了。我们需要在这个默认模板的基础上,实现自定义的AppBarBadgeButton。 现在返回到VS2017

[UWP]创建一个进度按钮

放肆的年华 提交于 2020-02-16 09:03:52
1. 前言 最近想要一个进度按钮。 传统上UWP上处理进度可以这样实现,首先是XAML,包括一个ProgressBar和一个按钮: <StackPanel Orientation="Horizontal" Margin="0,30" > <ProgressBar x:Name="ProgressBar" Maximum="1" Width="230"/> <Button x:Name="Button" Content="Download" Click="OnStartProgress" Margin="20,0,0,0"/> </StackPanel> 然后是服务端,假设我有这样一个服务: public class TestService { public event EventHandler<double> ProgressChanged; public async Task Start(bool throwException = false) { IsStarted = true; try { ProgressChanged?.Invoke(this, _progress); await Task.Delay(1000); while (_progress < 1) { await Task.Delay(100); _progress += 0.03;

ListView ManipulationCompleted event doesn't work on phone

元气小坏坏 提交于 2020-02-14 02:48:30
问题 I have this code in a Windows 10 UWP application: MyListView.ManipulationMode = ManipulationModes.TranslateX; MyListView.ManipulationStarted += (s, e) => x1 = (int)e.Position.X; MyListView.ManipulationCompleted += (s, e) => { x2 = (int)e.Position.X; if (x1 > x2) { DataController.PaneOpen(false); }; if (x1 < x2) { DataController.PaneOpen(true); }; }; The ManipulationCompleted event doesn't work on phone in ListView . The code inside the handler never gets called. It's working fine on PC, but

First Visible Group in the ListView UWP

妖精的绣舞 提交于 2020-02-08 03:15:38
问题 I have this sample application where I am trying to get the first visible group in the list view whenever I scroll through it. The problem occurs when I scroll up to view the initial items in the list view. It updates the top visible group but it only updates it correct when the list is done scrolling. So suppose if I do flick scrolling (tap,scroll and remove the finger from screen and let it scroll with the inertia given), sometimes, it will be lagging while updating the top visible group