uwp

Reference a class library from UWP and ASP.NET 5

坚强是说给别人听的谎言 提交于 2020-01-02 01:20:07
问题 I am trying to create a class library that'll contain common objects (mainly DTOs) of a WebAPI (using ASP.NET 5) and a consuming UWP App. However, I have not yet figured out how to create the class library such that it can be referenced from both other projects. What I have tried so far: First, I tried a Class Library (Package) , which can be found under Web . This type of library can be referenced from the ASP.NET project without problems, but when trying to reference it from the UWP project

Retrieve IP Address of the Default Printer Driver in UWP

笑着哭i 提交于 2020-01-01 19:59:32
问题 We have a requirement to get the printer IP Address configured in the default printer driver in Control Panel in our UWP app. I was able to retrieve the " System.DeviceInterface.PrinterPortName " by fetching interface class GUID and passing this above property for retrieval. But I couldn't get "System.Devices.IpAddress" similarly. Code pasted below for PortName. I badly need the IP address as the port name is user's choice and could be modified to any name removing the IP address. Kindly help

CLR cannot create .NET-based COM objects in UWP

a 夏天 提交于 2020-01-01 19:46:33
问题 I have created a Class Library (.NET Framework 4.7.1) that implements a Text Service ( ITfTextInputProcessorEx etc.) in TSF, using ComVisible attribute. I registered it using RegistrationServices and it can be successfully recognised by the system as an Input Method (IME) and can be used in most applications, except UWP apps. Using in Win32 app In a Win32 app (the 32-bit notepad.exe for example), here is what happens when I activate my .NET-based TextService (by switching to the IME in the

Binding command in UWP

ⅰ亾dé卋堺 提交于 2020-01-01 19:31:29
问题 I have a MenuFlyout in my App.xaml: <Application.Resources> <MenuFlyout x:Key="LessonFlyout"> <MenuFlyoutItem Text="Edit"/> <MenuFlyoutItem Text="Delete"/> </MenuFlyout> </Application.Resources> And I wanted to give MenuFlyoutItem click event but the compiler says I can't do this. But I need a click event so I searched and found out that I can bind command to MenuFlyoutItem. My MenuFlyout will be attached to a different objects in different pages. For example: StackPanel thisSender = sender

How to animate scale of TextBlock in UWP

笑着哭i 提交于 2020-01-01 19:00:14
问题 When I use Storyboard to zoom in TextBlock it pixelates while zooming and rerenders only on complete. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)"> <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1.5"/> Is there a way the TextBlock is rerendered each frame? 回答1: I found a solution though it's not about TextBlock anymore but for me it worked: private void CreateText(string text) { _compositor

uwp InkCanvas save stokes as svg

白昼怎懂夜的黑 提交于 2020-01-01 18:55:27
问题 I am trying to save InkCanvas , InkStorkes as a SVG. I found a previous question that works for Wpf,but I have been unable to get it to work with uwp. Wpf InkCanvas save stokes as svg . I made some changes to it, but I am running into issues with GetGrometry and XamlWriter. var svg = new SvgDocument(); var colorServer = new SvgColourServer(System.Drawing.Color.Black); var group = new SvgGroup { Fill = colorServer, Stroke = colorServer }; svg.Children.Add(group); foreach (var stroke in

uwp InkCanvas save stokes as svg

蹲街弑〆低调 提交于 2020-01-01 18:55:21
问题 I am trying to save InkCanvas , InkStorkes as a SVG. I found a previous question that works for Wpf,but I have been unable to get it to work with uwp. Wpf InkCanvas save stokes as svg . I made some changes to it, but I am running into issues with GetGrometry and XamlWriter. var svg = new SvgDocument(); var colorServer = new SvgColourServer(System.Drawing.Color.Black); var group = new SvgGroup { Fill = colorServer, Stroke = colorServer }; svg.Children.Add(group); foreach (var stroke in

C# Detect Accent Colour Changes WinRT XAML

孤人 提交于 2020-01-01 16:39:14
问题 I am trying to detect changes in the Application.Resources Resource dictionary, so I can automatically change the Titlebar to the Accent Colour when it updates. All of the XAML controls and elements change automatically, and when setting a solid colour brush to the address of the DSDFS brush, its internal value changes. This is the code I have tried to use to detect the change: public static DependencyProperty accent = DependencyProperty.Register("DictChange", typeof(ResourceDictionary),

C# Detect Accent Colour Changes WinRT XAML

旧街凉风 提交于 2020-01-01 16:38:28
问题 I am trying to detect changes in the Application.Resources Resource dictionary, so I can automatically change the Titlebar to the Accent Colour when it updates. All of the XAML controls and elements change automatically, and when setting a solid colour brush to the address of the DSDFS brush, its internal value changes. This is the code I have tried to use to detect the change: public static DependencyProperty accent = DependencyProperty.Register("DictChange", typeof(ResourceDictionary),

UWP Composition - Grid with rounded corners DropShadow

倾然丶 夕夏残阳落幕 提交于 2020-01-01 15:36:14
问题 I have a UWP app, which I should start by pointing out that it uses very little XAML. The views are built from JSON object recieved from an API. This means that the vast majority of everything is done in C#, and therefore adds a little complexity to my problem. I basically want to have a panel (e.g. Grid) that can have rounded corners and have a drop shadow applied to it. The drop shadow should also have the rounded corners, this can be seen in the sample below. I have looked at the