Tag: windows runtime

Windows 8 – BeginAnimation?

看来我不能做myObject.BeginAnimation(dp , animation) 。 这是一个错误还是已被更改?

XAML绑定到属性

我的XAML + C#Windowsapp store应用中有复选框。 另外我有bool属性: WindowsStoreTestApp.SessionData.RememberUser是public和static。 我希望复选框的属性IsChecked与此bool属性保持一致(或绑定或映射)。 我试过这个:XAML C# chbRemember1.DataContext = SessionData.RememberUser; 财产代码: namespace WindowsStoreTestApp { public class SessionData { public static bool RememberUser { get; set; } } } 但它似乎没有用。 你能帮助我吗?

在WinRT应用程序中处理2,3,4,5手指轻敲,双击并保持手势

我可以轻松处理1个手指Tapped , DoubleTap和Holding手势,如下所示: public MainPage() { this.InitializeComponent(); this.Tapped += mc_Tapped; this.DoubleTapped += mc_DoubleTapped; this.Holding += mc_Holding; } public void mc_Tapped(object sender, TappedRoutedEventArgs e) { //Tap } public void mc_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) { //DoubleTap } public void mc_Holding(object sender, HoldingRoutedEventArgs e) { //Hold } 但是这些事件没有获得手指数量的属性,当屏幕上出现超过1个触摸接触时,它们甚至不会被触发。 我还想处理DoubleTap个手指Tapped , DoubleTap和Holding手势。 谁能告诉我怎么做?

如何关闭Windows Phone 8.1应用程序

在WP7和WP8中,我只需要清除页面中的backstack,然后按“返回”按钮,应用程序将关闭。 在WP8.1中,我做了Frame.BackStack.Clear(),按Back并且应用程序只是最小化..如何用后退按钮杀死它?

从资源文件/内容获取流

这是从资源文件获取Stream的正确/唯一方法吗? Uri uri = new Uri(fullPath); StorageFile storageFile = await Windows.Storage.StorageFile. GetFileFromApplicationUriAsync(uri); IRandomAccessStreamWithContentType randomAccessStream = await storageFile.OpenReadAsync(); IInputStream resourceStream = (IInputStream) randomAccessStream.GetInputStreamAt(0); 我的所有其他源(http和本地存储)都返回一个Stream对象,并且使用if-else代码使用其中一个或其他代码是很痛苦的。 我也尝试过创建一个MemoryStream,但我甚至找不到一个方法来获取字节…请帮助。 uint size = (uint)randomAccessStream.Size; IBuffer buffer = new Windows.Storage.Streams.Buffer(size); await randomAccessStream.ReadAsync(buffer, size, InputStreamOptions.None); Stream stream = new MemoryStream(buffer); // error takes byte[] not IBuffer 从资源中读取时的IInputStream.ReadAsync(): http : //msdn.microsoft.com/en-us/library/windows/apps/windows.storage.streams.iinputstream.readasync.aspx 而Stream.Read()和Stream.ReadAsync()看起来像这样: http://msdn.microsoft.com/en-us/library/system.io.stream.read.aspx 和 […]

WinRT替换System.Environment.TickCount

System.Environment.TickCount的WinRT替换是什么?

在Windows 8中获取类型程序集

我正在尝试在Windows 8中使用MEF。 为了构建容器的AssemblyCatalog ,我需要对程序集的引用。 在过去,我会这样做: var catalog = new AssemblyCatalog(typeof(App).Assembly); 神秘的是, Type对象上不再存在Assembly属性。 有人知道一个好的工作吗? 还有另一种方法来组装吗? 我可以使用Assembly.Load加载它,但我需要程序集的名称。 我不能从类型中得到那个。 使用DirectoryCatalog可能是替代? 我不喜欢这个主意,但我会做我需要的。

ISupportIncrementalLoading Collection – 在LoadingMoreItems正在进行时通知UI

我已经在我的应用程序中创建了一个IncrementalLoadingCollection类,它实现了ISupportIncrementalLoading并从ObservableCollectioninheritance。 它工作正常,项目已加载,但我想在应用程序的Status Bar显示有一些消息正在进行中。 实现这一目标的好方法是什么? 由于在滚动列表时会在内部调用LoadMoreItemsAsync ,因此我无法访问该部分以提供更新Status Bar的代码。 现在,我在LoadMoreItemsAsync中这样做,我觉得这是一个糟糕的方法,但到目前为止我找不到更好的… 任何建议都非常感谢。

有没有办法在运行时找到PackageFamilyName?

有没有办法在运行时找出PackageFamilyName(如清单中出现的那样)? 我查看了/ Program Files / WindowsApps,但在那里找不到相关的字符串。 找不到任何能让我这样做的API …… 欢迎任何其他想法。

Windows 8中通过Metro DynamicResource启动屏幕的颜色?

我在以下路径中查看了Generic.xaml和ThemeResources.xaml: C:\ Program Files(x86)\ Windows Kits \ 8.0 \ Include \ WinRT \ Xaml \ Design 但是,它们似乎不包含我可以使用的资源键,以便检索在Windows 8开始屏幕中选择的当前方案的颜色。 我试图通过XAML中的DynamicResource检索的颜色在下面直观地看到,以certificate我的观点。