Tag: windows runtime

弹出窗口或弹出窗口以显示附加信息

我希望在我的应用程序顶部显示弹出窗口以及其他信息,我的信息是Listview有~500项我已经尝试过: flyout问题 – >它可能里面有scrollViewer,所以我的listview没有正确虚拟化其他一切正常。 有我的代码: Flyout myFlyout = new Flyout(); myFlyout.Placement = FlyoutPlacementMode.Full; myFlyout.Content = myListView; myFlyout.ShowAt(this); popup问题 – >它不居中,verticalAlignment不起作用,水平也不起作用 Popup myPopup = new Popup(); myPopup.Child = myListView; myPopup.IsOpen = true; 那么我应该走哪条路,尝试编辑弹出模板或通过设置垂直和水平偏移来居中弹出窗口? 或者有更好的方式来显示像窗口一样的弹出窗口,如项目列表或其他类似的信息

XAML分组GridView /语义缩放不显示所有孩子?

我正在尝试使用XAML C#Grouped GridView示例使我的SemanticZoom在XAML C#Windows 8应用程序中工作。 问题是,由于某种原因,它显示正确的标题(在这种情况下是类别),但它没有显示标题下的所有项目(它只显示每个项目,当我在其中一些项目中最多有6个项目时)。 这是SemanticZoom的XAML代码(请注意,为了简洁起见,我省略了ZoomedOutView,因为它运行良好): 以及启动应用程序时调用的Refresh()C#函数: System.Collections.ObjectModel.ObservableCollection finalSource = new System.Collections.ObjectModel.ObservableCollection(); public async Task Refresh() { var Pins = await pinTable.ReadAsync(); //pinTable is an Azure Mobile Services table List categoriesMixed = new List(); if (Pins.ToArray().Length < 1) { //adds a new "Welcome" pin to the table, taken out for brevity } foreach (pin […]

在屏幕键盘显示时调整winrt页面的大小

我有一个Windows 8.1 C#应用程序,它显示了一个带有相当大的文本框的页面(几乎涵盖了所有页面;它是一个写作应用程序)。 当屏幕键盘出现时,它覆盖了文本框的一半。 我想调整文本框(甚至整个页面)的大小,以便它不被键盘覆盖。 我现在正在使用静态InputPane并订阅其显示和隐藏事件来实现此目的。 然后我尝试使用eventargs中提供的带有方框的矩形来更改文本框的边距。 这样可行,但由于我的页面仍然是屏幕的高度,因此它将其向下滚动到底部。 public MainPage() { var inputPane = InputPane.GetForCurrentView(); inputPane.Showing += this.InputPaneShowing; inputPane.Hiding += this.InputPaneHiding; } void InputPaneHiding(InputPane sender, InputPaneVisibilityEventArgs args) { this.EditBox.Margin = new Thickness(); } private void InputPaneShowing(InputPane sender, InputPaneVisibilityEventArgs args) { this.EditBox.Margin = new Thickness(0, 0, 0, args.OccludedRect.Height); } 在尝试这一点时,我感觉这不是理想的解决方案,但我没有更好的主意。 理想情况下,我认为当你打开应用程序时,它会像垂直分割一样,但是底部的键盘是水平的,而应用程序只是键盘上方的可用尺寸。 知道这是否可行?

C#检测重音颜色更改WinRT XAML

我正在尝试检测Application.Resources资源字典中的更改,因此我可以在更新时自动将Titlebar更改为Accent Color。 所有XAML控件和元素都会自动更改,并且在将纯色画笔设置为DSDFS画笔的地址时,其内部值会更改。 这是我尝试用来检测更改的代码: public static DependencyProperty accent = DependencyProperty.Register(“DictChange”, typeof(ResourceDictionary), typeof(Shell), new PropertyMetadata(Application.Current.Resources, new PropertyChangedCallback(accent_PropertyChanged))); public ResourceDictionary DictChange { get { return (ResourceDictionary)GetValue(accent); } set { SetValue(accent, value); } } private static void accent_PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { _app.SetTitlebar(); } 我假设它错了,或者我不确定检测更改是否正确。 之前的迭代中,我使用Application.Current.Resources[“SystemControlBackgroundAccentBrush”] as SolidColorBrush并尝试检测其属性,但这也无效。 我究竟做错了什么? 请帮忙 :)

ListView的项目在WinRT中插入动画

最近我开始构建自己的大型Windows 8商店应用程序。 在UI上工作我开始复制一些好的UI。 我在标准的Mail应用程序中遇到了在列表视图中插入新元素的非常有趣的动画。 当您单击链时,它会展开并显示链中的所有消息。 这是拍摄的video。 我不知道他们用什么技术来实现这个动画和行为。 任何人都可以帮助我,解释或举例说明我该如何实现这种行为? 谢谢。

GetFilesAsync停止工作

我有这段代码 public static class Storage { public async static Task Exists(string filename) { var folder = await Package.Current.InstalledLocation.GetFolderAsync(“Assets”); var _files= await folder.GetFilesAsync(CommonFileQuery.OrderByName).AsTask().ConfigureAwait(false); var file = _files.FirstOrDefault(x => x.Name == filename); return file != null; } } 并从我的Windows 8商店应用程序调用它; this.IconExists = this.Game != null && Storage.Exists(this.IconName).Result; 因此,如果我在上面的行上放置一个断点并逐步运行它,它可以工作,但是没有中断并且只是运行应用程序会导致应用程序挂起。 几天前,类似的代码正在提交; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; […]

UWP UnauthorizedException

我目前正在编写我的第一个UWP应用程序,只是为了学习绳索。 我正在构建一个小应用程序,从下载的facebook-archive中提取数据。 但是当我尝试打开文件时(即使每个人都有完全访问权限),我都会收到UnauthorizedException。 我不明白这一点,我没有发现任何人只有任何旧文件有这个问题(有很多人遇到更具体的情况问题,但不只是他们的硬盘上的简单文件) System.UnauthorizedAccessException was unhandled by user code HResult=-2147024891 Message=Access to the path ‘C:\Users\patri\Downloads\facebook-100004420950389\html\messages.htm’ is denied. Source=System.IO.FileSystem StackTrace: at System.IO.WinRTIOExtensions.d__1`1.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.IO.WinRTFileSystem.d__1.MoveNext() — End of stack trace from previous location where exception was thrown […]

WinRT中的磁盘空间在Windows 8中使用C#

我有两个解决方案但两个对我都没用。 解决方案1:kernel32.dll(其工作代码) 注意:但我不想在我的应用程序中导入任何dll。 b / c市场提交的问题。 [DllImport(“kernel32.dll”, SetLastError = true)] static extern bool GetDiskFreeSpaceEx( string lpDirectoryName, out ulong lpFreeBytesAvailable, out ulong lpTotalNumberOfBytes, out ulong lpTotalNumberOfFreeBytes); static void TestDiskSpace() { IStorageFolder appFolder = ApplicationData.Current.LocalFolder; ulong a, b, c; if(GetDiskFreeSpaceEx(appFolder.Path, out a, out b, out c)) Debug.WriteLine(string.Format(“{0} bytes free”, a)); } 解决方案2:使用DriveInfo类(WinRT不工作代码) 注意:WinRT开发中缺少名称空间。 WinRT for Windows 8开发不支持此类。 […]

WinRT XAML工具包可视化错误

我有一个页面,我想使用WinRT Xaml Toolkit数据可视化控件放置图表。 我有以下代码: VS告诉我,PieSeries错了:“’PieSeries’类型的值不能添加到’Collection`1”类型的集合或字典中。 为什么这是一个错误?

如何在UWP App中创建信息丰富的Toast通知

在我的应用程序中,我想告知用户何时执行了特定操作,例如记录更新成功或添加了新记录,但是没有内置控件可以显示此类信息。 是否有类似于UWP的Android Toast.makeText?