uwp

Uri syntax in ResourceDictionary Source (Universal Windows Platform)

折月煮酒 提交于 2019-12-07 11:06:59
问题 I'm migrating my Windows 8.1 projects to Windows 10 (Universal Windows Platform). At this moment I was stopped by ResourceDictionary changes in UWP . For simplicity: I have Windows 8.1 solution with 2 projects: App project (FooApp)+ Styles (FooStyles) project. FooApp has reference to FooStyles, and in App.xaml I have: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="ms-appx:///FooStyles/Brushes.xaml"/> </ResourceDictionary

Check if UWP-Application is in Foreground/Focused [duplicate]

二次信任 提交于 2019-12-07 10:40:54
问题 This question already has answers here : UWP: Detect app gaining/losing focus (4 answers) Closed 3 years ago . I want to check if the current application is in the foreground/focused. The application is a windows-10 UWP application. What i already got is, to check if the current application is minimized. For that i use the VisibilityChanged event of Window.Current . But i don´t find a solution, to detect if the application is in foreground or not. 回答1: I can't be 100% sure but it seems that

(Windows Phone 10) Is possible to edit, add new contact programmatically in windows phone 10?

瘦欲@ 提交于 2019-12-07 10:29:44
问题 I want to implement function edit and add contact programatically in windows phone 10. Is it possible? Has any sample about it ? 回答1: Here is a code snippet for creating the contact: public async Task AddContact(String FirstName, String LastName) { var contact = new Windows.ApplicationModel.Contacts.Contact(); contact.FirstName = FirstName; contact.LastName = LastName; //Here you can set other properties... //Get he contact store for the app (so no lists from outlook and other stuff will be

Single Row Horizontally Scrolling/Swipeable GridView

妖精的绣舞 提交于 2019-12-07 10:23:20
问题 I wanted a single-row GridView that can be scrolled horizontally both with mouse and touch swipe. The GridView is to present images through binding so that a single image will be selected from an array of images. Everything works fine (binding, image selection, etc.) except that the horizontal scroll doesn't work. The XAML code is shown below. What am I missing? <GridView x:Name="IconGridView" Grid.Row="0" Margin="8,12" DataContext="{x:Bind IconManagerObj}" DoubleTapped="{x:Bind IconGridView

Windows 10 Mobile (10.0.14393) Background Task for Geofence (LocationTrigger)

别说谁变了你拦得住时间么 提交于 2019-12-07 10:06:02
问题 Ever since 10.0.14393 (Anniversery Update), LocationTrigger does not seem to work. I have: A Windows Phone 8.1 application (also applies to a UWP application). A portable library that ouputs to a Windows Runtime Component library ( .winmd ) A declaration of Background Task with Location capabilities (set to the library as entry). Access with BackgroundExecutionManager.RequestAccessAsync() A LocationTrigger of type Geofence . The background task is never triggered. Registration/task code after

UWP use skype to call number

老子叫甜甜 提交于 2019-12-07 10:01:15
问题 I want my c# UWP App to support calling numbers. When I'm on W10 mobile I want it to use W10 PhoneCall API normal (this is working) Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI(number, name); but on W10 Desktop/PC I won't have a GSM provider, so I thought, maybe use skype to call the number, the user pressed. Is that possible via UWP? Maybe similar like opening websites: await Windows.System.Launcher.LaunchUriAsync(new Uri(website)); 回答1: Yes, it's possible and you're right

Universal Windows 10 WebView - how to clear/disable cache?

我怕爱的太早我们不能终老 提交于 2019-12-07 09:44:23
问题 I am having a lot of trouble clearing the WebView cache in my UWP app. If I edit the content of a JS file linked from my HTML page, I can't get the change into my app unless I re-install the app. The static WebView.ClearTemporaryWebDataAsync() method doesn't seem to work. I have also tried adding headers to the request to disable caching: private void reloadPage() { string url = getUrl(); HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, new Uri(url)); request.Headers.Add(

how to set AppBarButton Icon using svg file resource in UWP/C#

牧云@^-^@ 提交于 2019-12-07 09:36:48
问题 Microsoft documentation states that you can set icons using SVG vector graphics files: https://docs.microsoft.com/en-us/windows/uwp/design/style/icons However, when I try to use an svg file to set the icon, it just shows blank: <AppBarButton Label="BitmapIcon"> <AppBarButton.Icon> <BitmapIcon UriSource="ms-appx:///Svg/MyButton.svg"/> </AppBarButton.Icon> </AppBarButton> This is how I added Svg file to my project: Under project I created a Directory "Svg", and inside of Svg folder I added the

How to set a binding inside a style?

拈花ヽ惹草 提交于 2019-12-07 09:14:45
问题 I am fairly new to Xaml. I am learning UWP(Universal Windows Platform) and I have more buttons and I want to bind their Background property to a property of a ViewModel that will change during some events. I implemented the INotifyPropertyChanged and everything works ok (the color of the buttons change) when I bind the Background property in the Buttons' declaration in XAML: <Button Content="0" Grid.Column="0" Grid.Row="5" Background="{Binding ButtonColor, Source={StaticResource AppViewModel}

Calling LoadLibrary using pinvoke from UWP C# application

梦想的初衷 提交于 2019-12-07 09:11:54
问题 I'm trying to call methods from an unmanaged dll from a C# UWP application. I do this, but pinvoking "LoadLibrary()" on the unmanaged dll so that I can use it. This all works fine in Debug mode, however in Release mode, I get a curious error: Message: Class Initialization method Tests.UnitTests.InitializeClient threw exception. System.TypeLoadException: System.TypeLoadException: Unresolved P/Invoke method 'LoadLibrary!kernel32' in assembly 'Client, Version=1.0.0.0, Culture=neutral,