win-universal-app

Windows Store App drag and drop between ListViews

我是研究僧i 提交于 2019-12-06 07:50:52
I am building a Windows Store App / Universal App targeting Windows 8.1 and Windows 10 and I would like to be able to drag and drop items between ListViews and be able to position the item in a specific spot in the ListView. The main problem I'm having is that I can't find a good way to determine the list index of where the item was dropped. I found a sample ( XAML ListView reorder ) but an important difference is that the items in my list have variable heights so the simple calculation this sample project uses to infer the index won't work for me. I am able to get the x,y position of where

UWP 10 C#. Reading a text file into a List<>

╄→尐↘猪︶ㄣ 提交于 2019-12-06 07:29:17
Let me start by saying that I'm brand new to UWP and the closest I have come to this language would be C++ about 12 years ago! I'm writing an app for Windows Universal and in it I'll be reading different text files in line by line, split the contents of each line (Some files I won't need to split the line), add the data into a list and then show it on screen. I've tried many ways to do this but I haven't got it working correctly. I currently have two methods that are working, but not consistently. It will show the data but only sometimes. When I run the app (either in emulator or on local

Check platform on Windows 10 Universal App

青春壹個敷衍的年華 提交于 2019-12-06 07:21:45
How can I check which platform (Windows / Windows Phone) my app is running? VersionInfo | versionInfo property should helps to check the platform information. var str = Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily; if (str == "Windows.Desktop") { //... } else if (str == "Windows.Mobile") { //... } Yes, you can use the compiler directives #if WINDOWS_PHONE //some code #endif #if WINDOWS //some code #endif 来源: https://stackoverflow.com/questions/32404755/check-platform-on-windows-10-universal-app

Disable Scaling for UWP App

巧了我就是萌 提交于 2019-12-06 07:16:04
Windows 10 automatically applies a scale factor to UWP apps, to give a similar effective pixel size across multiple devices. I want my UWP UI to look the same across any screen of the same resolution, regardless of the scale factor. Is this possible? For instance, when running my app on the Hololens it applies a 150% scale factor. This means the UI looks squished when compare to a desktop screen of a similar resolution (1280x720). A suggestion ( How to disable auto-scaling on UWP mobile ) says to use TrySetDisableLayoutScaling on the ApplicationViewScaling Class . But this doesn't work. The

Access ResourceDictionary in Windows Phone project from Shared project in App.xaml of Universal 8.1 App

眉间皱痕 提交于 2019-12-06 06:37:59
问题 I am creating a Windows Universal 8.1 app. In the Windows Phone 8.1 project inside I have a certain Xaml file as ResourceDictionary. In the Shared Folder I have the common App.xaml of the 2 projects (Windows and Windows Phone). Path of ResourceDictionary is: "MyApp.WindowsPhone/Assets/Styles/JumpList.xaml" In App.xaml I add: <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="MyApp.WindowsPhone/Assets/Styles/JumpList.xaml"/> </ResourceDictionary

Windows10 script pin app to start menu

余生长醉 提交于 2019-12-06 06:33:29
I have a Universal App that I'm sideloading in Windows10. I would like to create a script (Powershell, VBS, batch, etc) to pin it to the Start Menu. I have found many examples of how to write a script that pins a desktop application (like this one: https://gallery.technet.microsoft.com/scriptcenter/Script-to-pin-items-to-51be533c ). I've tried using the script to pin the actual App .exe file located in C:\Program Files\WindowsApps... but that doesn't work. When I try and pin that way, I run DoIt(), which doesn't return anything. There are no error messages, but the tile is not pinned to the

Goto VisualState in Listivew item DateTemplate windows phone 8.1

一曲冷凌霜 提交于 2019-12-06 06:20:41
My requirement: when tapped on the border in ListViewItem(DataTemplate) an overlay should appear on top of it with animation. In my listview data template I defined a visual state at the root. I want to goto the visual state when user taps on the border. I have tried following xaml but it is not working <DataTemplate x:Key="MyTemplate"> <Grid Background="{Binding ItemBackground}" Margin="0,0,0,5" Height="auto"> <VisualStateManager.VisualStateGroups> <VisualStateGroup > <VisualState x:Name="OverlayState"> <Storyboard > <DoubleAnimation Storyboard.TargetName="checkedBorder" Storyboard

How to bulk insert into SQLITE database?

不打扰是莪最后的温柔 提交于 2019-12-06 06:10:21
I am developing UWP application. I have a database that should be initialized with about 20,000 records. The records, that are defined as follows: private static readonly ObservableCollection<TickRecord> TickRecords = new ObservableCollection<TickRecord>(); I tried to insert the records one at a time like this: private void CreateFakeTickRecords() { if ( Database.Database.CountTickRecords() > 0 ) { return; } foreach ( var tickRecord in TickRecords ) { Database.Database.AddOrUpdateTickRecord( tickRecord ); } } and public static void AddOrUpdateTickRecord( TickRecord tickRecord ) { // Create a

HttpClient is adding it's own cookie header

China☆狼群 提交于 2019-12-06 06:01:39
问题 I have rather strange problem. With all that questions over internet how to add and get cookies, I want the opposite ;) When I try to send request via HttpHandler it is adding it's own Cookie header. I have to get rid of it. Without digging into details - when it is added, server I am trying to request is giving me wrong answer. It works without this cookie (tried in fiddler). But back to the problem, code: string domain = "someMysteriousDomain"; var handler = new HttpClientHandler(); handler

Xamarin Form - TaskCanceledException thrown on ScanFilesToFolderAsync

老子叫甜甜 提交于 2019-12-06 04:52:22
in my UWP application i am working on scan functionality. in this application user can scan the document through scanner by selecting flatbed or auto feeder.Now problem is when i am trying to scan it gives the en exception a Task was canceled. please help.. thanks in advance. :) have a great day... :) private async void Btnscan_Click(object sender, RoutedEventArgs e) { FolderPicker folderPicker = new FolderPicker(); folderPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; folderPicker.FileTypeFilter.Add("*"); StorageFolder folder = await folderPicker.PickSingleFolderAsync(); /