uwp

Set the size of frame image

瘦欲@ 提交于 2019-12-14 03:06:00
问题 Question 1: I have a DataTemplate as below. And in my layout I need to put Image tipFrame below TextBlock tipText . tipText's text will change according to pulled server text, hence tipFrame's width should change accordingly to cover tipText. But the issue is that tipText's parent control, the RelativePanel's width is big, e.g. 1800. And due to tipText's Margin setting Margin="35,7,100,0" , so tipText's width is 1800 - 35 = 1765 , which does not match its content size. E.g. the content maybe

UWP Image overflow inside button

百般思念 提交于 2019-12-14 03:02:39
问题 I'm trying to stretch an image inside a Button which is inside a stackpanel and a grid but it doesn't works. On mobile size it works very well but when the app is for an Desktop it doesn't work anymore, we can see that the image overflows. And what it looks like on desktop My code: <StackPanel x:Name="g5" Grid.Column="1" Grid.Row="1" Padding="20" Orientation="Vertical" > <TextBlock Text="Site" FontSize="20"/> <Button x:Name="websiteButton" HorizontalAlignment="Stretch" VerticalAlignment=

Get distance of MapControl border in degrees

為{幸葍}努か 提交于 2019-12-14 02:47:12
问题 I have a MapControl and would like to know how many degrees are currently shown on the x and y axes. First example: 360 degrees are shown on the x axis (longitude) ~90 degrees are shown on the y axis (latitude) (The zoom level is 3.2 and it's max zoomed out) Second example: ~220 degrees on the x axis (longitude) 180 degrees on the y axis (latitude) (zoom level: 1.7; max zoomed out) I tried calculating the current degrees on the x axis using following code: double dist = 360 * Math.Pow(0.5,

Initialize a NDEF tag on Windows 10 Desktop

我与影子孤独终老i 提交于 2019-12-14 02:23:59
问题 I'm trying to initialize a new Mifare Classic Tag to the DNEF format, readable by the Proximity API. According to Microsoft, the proximity API is capable to initialize a mifare classic tag to a NDEF format if needed (as described here and here). But, using this line of code to publish the message: proximityDevice.PublishBinaryMessage("NDEF:WriteTag", ndef.ToByteArray().AsBuffer(), MessageTransmittedHandler); don't initialize the TAG and write anything, just works on a pre-formatted NDEF tag

How to detect that WP8.1 app launched on Windows 10 Mobile?

落花浮王杯 提交于 2019-12-14 01:04:23
问题 I need to check OS version (WP 8.1 or W10) in my code of WP8.1 application. What better way to do this? May be reflection or some special API for this purpose? 回答1: I didn't find any other way to do this, so here's my approach. The following property IsWindows10 detects if a Windows 8.1 or Windows Phone 8.1 app is running on a Windows 10 (including Windows 10 Mobile) device. #region IsWindows10 static bool? _isWindows10; public static bool IsWindows10 => (_isWindows10 ?? (_isWindows10 =

How to open TabTip keyboard in a UWP app in desktop mode on button click

情到浓时终转凉″ 提交于 2019-12-14 00:46:13
问题 I am currently working in a UWP application. I have a situation where I need to open the taptip keyboard. The device needs to be in desktop mode and the keyboard should open on a button click. Is there any way I can achieve this functionality? I know it works fine in tablet mode when a text box gets focus but I need to get it done in desktop mode and on a button click. I know it can be done from a console application using System.Diagnostics.Process but I need a way around for uwp app. 回答1:

Communicate between computers through Ethernet cable

倖福魔咒の 提交于 2019-12-13 23:58:21
问题 I want to connect two computers with an Ethernet cable without the user having to set up a LAN through the Control Panel and then transfer data between two instances of my app - one running on each computer. As soon as I have a connection with an IP address for each computer, I know I can easily transfer a file by using Sockets, Pipes(?), WCF... But both computers are also connected via wifi to a router, so how can I somehow tell the computer that for a specific IP address - please use the

Style.Setter with Binding in Universal Windows Applications

穿精又带淫゛_ 提交于 2019-12-13 21:34:41
问题 As stated in the question below, Setters cannot contain Bindings in Windows RT/Phone 8.1 => Binding SelectedItems in ListView to a ViewModel in Windows Phone 8.1 Has this changed in the new Universal Windows Applications? Still not Bindings in values? 回答1: OK, you can't bind to the DataContext using the normal ways, but you can do it using other (smart) methods: Please, look at this. It provides a "helper" that allows to bind to the DataContext with a Setter. http://dlaa.me/blog/post/10089023

UWP : How to create panel with rotation?

强颜欢笑 提交于 2019-12-13 20:35:39
问题 I like to implement a screen with 2 panel like this : Left one and right one is rotated. Their all children view will have measured width and height. I user a CompositeTransform and re-measure it in PageLoad but doesn't have any update. public sealed partial class TestRotate : Page { public TestRotate() { this.InitializeComponent(); this.Loaded += PageLoaded; this.SizeChanged += PageSizeChange; } private void PageSizeChange(object sender, SizeChangedEventArgs e) { Measure(new Size()); }

UWP app add an image (path) to SQLite Database

若如初见. 提交于 2019-12-13 19:54:44
问题 Hi I am creating a UWP app and have the following method to upload a picture. async void imageButton_Click(object sender, RoutedEventArgs e) { FileOpenPicker open = new FileOpenPicker(); open.SuggestedStartLocation = PickerLocationId.PicturesLibrary; open.ViewMode = PickerViewMode.Thumbnail; // Filter to include a sample subset of file types open.FileTypeFilter.Clear(); open.FileTypeFilter.Add(".bmp"); open.FileTypeFilter.Add(".png"); open.FileTypeFilter.Add(".jpeg"); open.FileTypeFilter.Add(