uwp

【译】Visual Studio 2019 中 WPF & UWP 的 XAML 开发工具新特性

大憨熊 提交于 2019-12-14 09:30:50
原文 | Dmitry 翻译 | 郑子铭 自Visual Studio 2019推出以来,我们为使用WPF或UWP桌面应用程序的XAML开发人员发布了许多新功能。在 本周的 Visual Studio 2019 版本 16.4 和 16.5 Preview 1 中,我们希望借此机会回顾一下全年的新变化。如果您错过了我们以前的版本,或者只是没有机会赶上,那么此博客文章将是您可以看到我们在整个2019年所做的每项重大改进的地方。 XAML实时调试工具: XAML C# Edit & Continue 现在被称为 XAML Hot Reload (v16.2): 现在将 WPF / UWP 的 XAML C# Edit & Continue 称为 XAML Hot Reload ,此新名称旨在更好地与该功能的实际工作方式保持一致(因为进行XAML编辑后无需暂停)并与 Xamarin.Forms 中的相似功能 匹配。 XAML Hot Reload 可用/不可用 (v16.2): 应用内工具栏已更新,以指示 XAML Hot Reload 是否可用,并链接到相关文档。在此改进之前,如果不先尝试使用该功能,客户将无法知道 XAML Hot Reload 是否正在工作,这会引起混乱。 应用内工具栏现已主题化 (v16.2): 现在,根据Visual

UWP Bluetooth ConnectAsync error to Raspberry Pi. Element not found

守給你的承諾、 提交于 2019-12-14 04:12:09
问题 I'm making a Windows UWP app that uses RFCOMM to communicate to a Raspberry Pi. Both my Windows laptop and Raspberry Pi are already connected and paired (manually). I know the bluetooth address of the Raspberry Pi and the channel it's using and these values are hardcoded into the parameters for ConnectAsync(...). When ConnectAsync(...) is called, the Raspberry Pi does receive a connection and it prints the line "accepted connection from ('Windows bluetooth address', 1). However, the exception

C++/CX CreateTask pass value

浪子不回头ぞ 提交于 2019-12-14 04:10:57
问题 I pass value to property of class in CreateTask, use the property value outside the AsyncTask class, the property value is not change, but the property value change in button click event. the CreateTask in the AsyncTask class, AsyncTask class have a N property namespace CreateTask { public ref class AsyncTask sealed : INotifyPropertyChanged { public: AsyncTask(); void InitTask(); void ShowN(); IAsyncOperation<float64>^ GetPrimesAsync(float64 x, float64 y); private: float64 _n; bool

Access denied exception using C# / UWP

爱⌒轻易说出口 提交于 2019-12-14 04:09:33
问题 The execute() function is linked to a button press. The first time it is pressed - everything runs the way it should/ The second time is is pressed (within the same execution of the app; if I close and re-open it works fine) - on the DeleteAsync line I get this exception: An exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.ni.dll but was not handled in user code Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) I think

ComboBox does not select binding value initially

自古美人都是妖i 提交于 2019-12-14 03:56:05
问题 First of all, not a duplicate. TextBox and CheckBox work correctly, just not ComboBox. Model internal class Word : _Model { public enum Categories { Noun, Verb, } private Categories category; public Categories Category { get { return this.category; } set { this.SetProperty(ref this.category, value); } } } Notify (safe to skip reading this part) internal abstract class _Model : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected bool SetProperty<T>(ref

UWP/C#: ObservableCollection sort in-place (w/o scrolling)

感情迁移 提交于 2019-12-14 03:54:24
问题 In an UWP app I'm trying to sort an ObservableCollection that is bound to a ListView - therefore collection.OrderBy(..) (which creates a new collection) is not an option. Until now I used this extension-method: public static void Sort<TSource, TKey>(this ObservableCollection<TSource> source, Func<TSource, TKey> keySelector) { List<TSource> sortedList = source.OrderBy(keySelector).ToList(); source.Clear(); foreach (var sortedItem in sortedList) { source.Add(sortedItem); } } Unfortunately this

UWP SerialDevice.FromIdAsync throws “Element not found” (Exception from HRESULT: 0x80070490) on Windows 10

心不动则不痛 提交于 2019-12-14 03:51:43
问题 I want to open serial port on an attached Bluetooth device in a Xamarin Forms application. Here is the code (I simplified it in order to illustrate the problem): string l_gdsSelector = SerialDevice.GetDeviceSelector(); var l_ardiDevices = await DeviceInformation.FindAllAsync(l_gdsSelector); foreach(DeviceInformation l_diCurrent in l_ardiDevices) { if(l_diCurrent.Name.StartsWith("PX05")) { m_sdDevice = await SerialDevice.FromIdAsync(l_diCurrent.Id); break; } } This code throws "Element not

How to customize the application title bar for a UWP page

拈花ヽ惹草 提交于 2019-12-14 03:42:15
问题 I am trying to set the application title bar of a page visibile all the time for a UWP page and also disable the restore button, but I am not finding anything related to this. All i could do was to change the color of the application title bar having a code like below public MainPage() { this.InitializeComponent(); ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen; ApplicationView.GetForCurrentView().Title = "TEST"; ApplicationViewTitleBar titleBar =

how to post string to URL in UWP

℡╲_俬逩灬. 提交于 2019-12-14 03:28:00
问题 i want to post a string to an URL so that i can upload a file. I did it in WPF project and i want to do it in UWP project. this is my method in WPF: OpenFileDialog ofd = new OpenFileDialog(); string url = "http://localhost/visualStudioUpload/upload1.php "; WebClient Client = new WebClient(); WebRequest request = WebRequest.Create(url); // Set the Method property of the request to POST. request.Method = "POST"; // Set the ContentType property of the WebRequest. request.ContentType =

uwp GridView selectedItem Popup

我们两清 提交于 2019-12-14 03:09:24
问题 I am using AdaptiveGridView by UWP Community toolkit . I want the selected Item of the gridview to popup on the Z-axis , meaning the selected Item must scale up to a specific size, but it should not disturb the size of other gridview items, rather it should scale on Z axis of the canvas. what are possibilities to animate this effect also maybe using UWP community toolkit scale effect ( but that effects the size of other items as well). if its not possible on selected Item can it be somehow