win-universal-app

UWP Check If File Exists

Deadly 提交于 2020-12-30 04:54:23
问题 I am currently working on a Windows 10 UWP App. The App needs to Check if a certain PDF File exists called "01-introduction", and if so open it. I already have the code for if the file does not exist. The Code Below is what i currently have: try { var test = await DownloadsFolder.CreateFileAsync("01-Introduction.pdf", CreationCollisionOption.FailIfExists); } catch { } This code Does not work correctly because to check if the file exists here, I attempt to create the file. However if the file

Why UWP ApplicationPageBackgroundThemeBrush is always white?

元气小坏坏 提交于 2020-12-05 08:10:43
问题 I am beginner. I have below simplest code: <Page x:Class="ClientFramework.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:ClientFramework" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> </Grid> </Page> I test it in

How to get {x:DataType} for a DataTemplate in C# for custom DataTemplateSelector

十年热恋 提交于 2020-08-07 04:20:14
问题 I'm writing a custom DataTemplateSelector for a ComboBox control and I'll need to use it to display different DateTemplates for different kind of objects, in both the closed and open modes for the ComboBox . Here's the DataTemplateSelector I came up with: public class ComboBoxTypedDataTemplateSelector : DataTemplateSelector { public IEnumerable<DataTemplate> SelectedTemplates { get; set; } public IEnumerable<DataTemplate> DropDownTemplates { get; set; } protected override DataTemplate

How to get {x:DataType} for a DataTemplate in C# for custom DataTemplateSelector

。_饼干妹妹 提交于 2020-08-07 04:20:03
问题 I'm writing a custom DataTemplateSelector for a ComboBox control and I'll need to use it to display different DateTemplates for different kind of objects, in both the closed and open modes for the ComboBox . Here's the DataTemplateSelector I came up with: public class ComboBoxTypedDataTemplateSelector : DataTemplateSelector { public IEnumerable<DataTemplate> SelectedTemplates { get; set; } public IEnumerable<DataTemplate> DropDownTemplates { get; set; } protected override DataTemplate