uwp

UWP change NavigationViewItem height

余生颓废 提交于 2019-12-11 18:04:57
问题 On the image above, you can see my app (left) and Groove Player (right). I want to make NavigationViewItem height big like Groove Player, but I don't know how. I tried playing with Padding and MinHeight but it doesn't look the same. I want to do the same for the AutoSuggestBox and the Settings button, that are part of NavigationView. <NavigationView x:Name="navView" IsSettingsVisible="True"> <NavigationView.AutoSuggestBox> <AutoSuggestBox QueryIcon="Find" PlaceholderText="Search"><

I want to protect the users' API public and secret keys in my UWP app

瘦欲@ 提交于 2019-12-11 17:58:45
问题 I'm working on a UWP app where users will be asked for their API public/secret keys for a service the app will access. Normally, I'd store preferences in ApplicationData.Current.RoamingSettings , but with the API keys, I would like to encrypt them first. If you see below, I am not sure how to proceed with serializing an IBuffer object as I am hit with "Data of this type is not supported" when I test how to store it. Most of the code below is a copy-pasta from https://docs.microsoft.com/en-us

ComboBox(Previous DataContext) SelectedItem property set as null value in UWP?

夙愿已清 提交于 2019-12-11 17:54:42
问题 Initially, ComboBox DataContext is set with Profession1 and SelectedValue as Politician. At Runtime, i changed the Datacontext to Profession2 . Doing this is changing the Profession1 to null. Please refer the below code: <Page.Resources> <local:MainPageViewModel x:Key="datacontent"></local:MainPageViewModel> </Page.Resources> <ComboBox x:Name="comboBox" ItemsSource="{Binding Professions,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding Profession, Mode=TwoWay

How to pass objects through multiple pages in UWP

微笑、不失礼 提交于 2019-12-11 17:49:37
问题 I am tasked with creating a multi-page UWP app that needs to pass a student object through multiple pages. The app starts on the main page where there are two buttons, one to add a new student and then and the other to then view the students details. I am currently struggling trying to figure out how to pass the student object from the "new student page" to the "student details" page. I'm not allowed to store the students information in a file or database. When a new student has been added

Setting BitmapImage as ImageSource in UWP not working

六月ゝ 毕业季﹏ 提交于 2019-12-11 17:46:54
问题 I am trying set the source of an Image in code with a BitmapImage but nothing shows up here is my code: xaml: <Image x:Name="img" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" /> Code behind: var image = new BitmapImage(new Uri(@"C:\Users\XXX\Pictures\image.jpg", UriKind.Absolute)); image.DecodePixelWidth = 100; this.img.Source = image; 回答1: It's a permissions issue. Your app doesn't have direct access to read c:\users\XXX and so it fails to load the BitmapImage from

UWP / MVVMlight : Replacing Obsolete ServiceLocator and SimpleIoc Register

只谈情不闲聊 提交于 2019-12-11 17:45:31
问题 I open this topic again. I face a probelm when I update my UWP app: I'm gonna give more detail: Here is my old code before update running perfectly on UWP/Win10 10240 in my app.xaml <Application.Resources> <vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /> </Application.Resources> in my App.xaml.cs public class ViewModelLocator { public const string MainMenuPageKey = "MainMenuPage"; public const string QuestionPageKey = "QuestionPage"; static ViewModelLocator() { ServiceLocator

How to show specific control in fullscreen mode UWP

拥有回忆 提交于 2019-12-11 17:34:55
问题 I write an YouTube client for UWP platform and now I'm stuck on fullscreen mode. I've written own video player based on MediaElement with . And when I go to fullscreen I get this . So in that case I need to show in fullscreen mode the whole video player control. But I don't know how exactly I supposed to do this. I've already tried this: private async void fullscreen_Click(object sender, RoutedEventArgs e) { if (!fullScreen) { ApplicationView.GetForCurrentView().TryEnterFullScreenMode();

How Can I Disable Pointer Mode For Xbox One (C#, UWP)

帅比萌擦擦* 提交于 2019-12-11 17:19:57
问题 I was wondering how I could disable pointer mode on a UWP application. I already have XYFocusKeyboardNavigation set up and everything works perfectly when I plug my xbox one controller into my PC. Whenever I debug to my console I have a pointer instead of typical xbox controls. I have tried to disable it by adding the following commands but nothing worked, please help: RequiresPointer="Never" //At Page Level this.RequiresPointer = RequiresPointer.Never; //On Load RequiresPointerMode =

Using UWP monitor live audio and detect gun-fire/clap sound

淺唱寂寞╮ 提交于 2019-12-11 17:15:54
问题 I am developing a new UWP app which should monitor sound and fire a event for each sudden sound blow ( something like gun fire or clap ). It needs to enable default Audio Input and monitor live audio. Set audio sensitivity for identifying environment noise and recognizing clap/gun-fire When there is a high frequency sound like a clap/gun-fire sound ( Ideally it should be like configured frequency like +/-40 then it is a gun-fire/clap ) then it should call a event. No need to save Audio I

Problem Using user32.dll in C# (Error 1008 An attempt was made to reference a token that does not exist.)

余生长醉 提交于 2019-12-11 17:15:20
问题 Hello legendary coders. Flowing by my previous question I tried to use user32.dll in windows universal application (UWP) in C# language but I encountered an error while trying to use the method I imported from that .dll here is my code: [DllImport("user32.dll")] public static extern bool LockWorkStation(); private async void btnLock_Click(object sender, RoutedEventArgs e) { string path; if (Images.TryGetValue(selectedRadioButton.Name, out path)) { StorageFile file = await StorageFile