uwp

Set Clipboard content in Cortana background task

北城余情 提交于 2019-12-06 13:51:53
问题 I am trying to add content to the Clipboard in a background task but I can't get it to work. here is my Code: var dataPackage = new DataPackage { RequestedOperation = DataPackageOperation.Copy }; dataPackage.SetText("EUREKA!"); Clipboard.Flush(); Clipboard.SetContent(dataPackage); I get the error Message: Activating a single-threaded class from MTA is not supported (Exception from HRESULT: 0x8000001D) System.Exception {System.Runtime.InteropServices.COMException} I found a similar question

UWP - Frame Navigate only crashes when passing a parameter

吃可爱长大的小学妹 提交于 2019-12-06 13:38:07
I'm trying to pass the id of the clicked element as a string to a new page, however the app always crashes. I'm not entirely sure how to find out the cause of the problem as every example I've found uses the same method and it works just fine for them. The sender event: private void MovieBox_OnTapped(object sender, TappedRoutedEventArgs e) { var id = (sender as StackPanel).Tag as string; Debug.WriteLine(id); //the correct id in string Frame.Navigate(typeof(MovieDetailsPage),id); } The OnNavigatedTo event protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e)

How to replicate the window transparency effect found in the new DropBox UWP app

牧云@^-^@ 提交于 2019-12-06 13:29:30
问题 Apparently the effect is a feature introduced in the Creator's Update. Has anyone figured out the exact APIs used to pull this off? Even better would be some example code to at least help get me started. Any help would be greatly appreciated. :] 回答1: You should target Windows Creators Update for it to work using Windows.UI.Xaml.Hosting; //'this' is MainPage, but can be any UIElement var visual = ElementCompositionPreview.GetElementVisual(this); var brush = visual.Compositor

ListView is not scrolling with grouping

泪湿孤枕 提交于 2019-12-06 13:27:43
I simply changed my ListView to use grouping, but now I can't use ScrollTo anymore. I have create a simple app, so you can see the problem. The XAML-page looks like (I am not using XAML in my app at the moment, but I will in an upcoming version). <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:ScrollListExample" x:Class="ScrollListExample.ProjectPage"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions>

Relative width for UI Elements with RelativePanel in XAML with UWP Apps

╄→гoц情女王★ 提交于 2019-12-06 13:26:45
I want to realize something like |Image (40% Width)|Text(60% Width)| that adapts to small screens like |Image (100%)| |Text(100%| I've got the following solution with AdaptiveTrigger and an Grid. <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="VisualStateGroup"> <VisualState x:Name="NarrowView"> <VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth="0" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="Image.(Grid.ColumnSpan)" Value="2" /> <Setter Target="Text.(Grid.Row)" Value="1"

Is there any way to fetch Mobile Number of windows phone 10 using c#

烈酒焚心 提交于 2019-12-06 13:22:28
I have created my application in UWP. I need to search current sim and sim Mobile number. Please help me for find the mobile number using windows phone 10 in c# Yes, it is possible. You can use SmsDevice2.AccountPhoneNumber to get the phone number. From this article,Pay attention of This functionality is only available to mobile operator apps and Windows Store apps given privileged access by mobile network operators, mobile broadband adapter IHV, or OEM. Hence it requires the cellularMessaging capability, a special-use capability, to be declared in the package manifest, so this kind of app can

uwp NavigationView control Titlebar

隐身守侯 提交于 2019-12-06 12:59:40
问题 I have a problem with the NavigationView Control and the titlebar. I have tried to extend the view into the titlebar to play with the acrylic effects of the standard NavigationView. But then I´ve noticed that the back and menu buttons are underneath the titlebar, so you´re not able to click them properly. In the attached image, you can see that everything under the red line is clickable but when you go over it, you are targeting the titlebar. Is there anything I can do to fix this behavior?

How to use WriteableBitmap.setpixel() efficiently in windows 10 uwp?

佐手、 提交于 2019-12-06 12:43:30
问题 I have a scenario where choosing a image file and then using BitmapDecoder converting the source to a WriteableBitmap and setting an image.source to the WriteableBitmap. Now when a user taps on the image I get the co-ordinates and then want to color the entire region surrounding that pixel with a particular color.(Like the fill option in paint). The code I've used is private void setPixelColors(int xCord, int yCord, int newColor) { Color color = bit.GetPixel(xCord, yCord); if (color.R <= 5 &&

(UWP) Drawing on image and saving as image/byte array again

半世苍凉 提交于 2019-12-06 12:42:01
问题 I've tried a lot of different solutions in the last two days, but can't seem to find the best way. What I want is: 1. Show image 2. Enable drawing red lines on image 3. Save image with lines I've tried Win2D, WriteableBitmapEx, InkCanvas, normal Canvas and the Lumia Imaging SDK, but haven't had luck with at working solution. There is big chance that I'm doing it all wrong, since all those solutions don't work for me. I can't seem to find any good examples that work with UWP though. Anyone

Is the Windows.ApplicationModel.LockScreen namespace available for non-kiosk use?

爷,独闯天下 提交于 2019-12-06 12:22:17
The MSDN documentation for the Windows.ApplicationModel.LockScreen namespace claims that "You can create an app that acts as the lock screen, allowing greater user personalization". I'm interested in creating a custom lock screen for Windows 10 Mobile. However, my quest for further documentation yielded only an article about creating a Windows 10 desktop kiosk app . So, my question is simple--is it actually possible to create a custom Windows 10 Mobile lock screen with these classes? There are a few different things here that are probably confusing things. unfortunately they are not very