Tag: winrt xaml

从Win RT / Windows 8应用程序启动Windowsapp store列表

在Windows Phone上有一个市场审查任务。 有没有办法在WinRT应用程序中实现等效function? 我意识到Charms栏中有“率和评论”按钮,但是,这不是我需要的,因为我想在应用程序中集成一个按钮来启动评论UI。 这可能看似微不足道,但这是最重要的要求之一! 对于Windows 8 / winrt / metro风格 , 是否有相当于wp7的marketplacereviewtask? 因为提问者对Charms bar方法很满意。 谢谢

Windows RT App中的图像闪烁

我有一个Windows RT应用程序,我以编程方式更改Image组件中的位图。 一切都适用于XAML和下面的代码,除了我们在图像更改时看到的闪烁。 我应该改变什么才能摆脱闪烁? XAML : 码: namespace Test01 { public sealed partial class MainPage : Page { int currentSlice = 128; String axis = “ax-“; public MainPage() { this.InitializeComponent(); } public void displayImages() { BitmapImage bitmapImage = image1.Source as BitmapImage; bitmapImage.UriSource = null; image1.Source = null; BitmapImage bitmapImage2 = image2.Source as BitmapImage; bitmapImage2.UriSource = […]

在Windows 8应用程序中扩展启动后无法导航到页面

我已经按照Microsoft提供的指南创建了扩展的启动画面。 屏幕显示关闭,数据加载,但随后应用程序无法导航到登录页面。 这怎么可能? ExtendedSplash.xaml.cs public sealed partial class ExtendedSplash { public ExtendedSplash(SplashScreen splash) { this.InitializeComponent(); // Position the extended splash screen image in the same location as the splash screen image. this.extendedSplashImage.SetValue(Canvas.LeftProperty, splash.ImageLocation.X); this.extendedSplashImage.SetValue(Canvas.TopProperty, splash.ImageLocation.Y); this.extendedSplashImage.Height = splash.ImageLocation.Height; this.extendedSplashImage.Width = splash.ImageLocation.Width; // Position the extended splash screen’s progress ring. this.ProgressRing.SetValue(Canvas.TopProperty, splash.ImageLocation.Y + splash.ImageLocation.Height + 32); […]

Caliburn Micro:在ViewModel之间传递Object

我正在使用Caliburn Micro 2.0.0-alpha2开发一个简单的Crud应用程序(Windows 8.1商店应用程序) 我在视图模型之间导航,传递对象时遇到麻烦。 我多次阅读提出的解决方案 Anders Gustafsson( 如何使用WinRT Caliburn.Micro将参数传递给导航视图模型? ) 我试着让它适应我的范围。 但是这个对象是空的。 我需要将从listView中选择的单个对象传递给我的crudPage。 crudPage由显示FormView的userControl组成。 所以我想用传递对象的值初始化这个Form。 我认为问题是只有在创建ViewModel之后才初始化“参数”,但我不知道如何解决这个问题。 根据Anders Gustafsson的想法,有我的代码 TransporterListViewModel(来自数据库的传输器列表) public class TransporterListViewModel : ViewModelBase { public string Title { get; set; } public TransporterListViewModel(INavigationService navigationService) : base(navigationService) { LoadData(); } public async void LoadData() { _transporters = await TransporterService.GetAll(); } private BindableCollection _transporters; public […]

Metro应用的倒数计时器

我是Metro Style Develop的初学者,我试图制作一个需要定时器的小游戏,倒计时从10到0.但是在这个Visual Studio中没有Timer Component,而DispatcherTimer没有映射到xmlns。 我试图使用TimeSpan,这个字段有“TicksPerSecond”但是这个例子不能帮助我制作我的倒数计时器: http : //msdn.microsoft.com/en-us/library/system.timespan.tickspersecond.aspx TimeSpan也有这个方法“FromSeconds”,我也不能将这个用于我的倒数计时器: http : //msdn.microsoft.com/en-us/library/system.timespan.fromseconds.aspx 另外我在stackoverflow上阅读了这个问题: 如何在Metro Style App中实现计时器,但这没用。 我能为这个倒数计时器做些什么?

如何在WinRT XAML中更改其值时为TextBlock设置动画?

我有以下Storyboard 和以下TextBlock 两者都在SettingsFlyout而不是Page 。 我希望在TextBlock值更改时启动Storyboard 。 我正在使用MVVM,所以除非绝对必要,否则请不要使用代码隐藏的东西。 我尝试搜索提示并尝试了Behaviors , Triggers和VisualState不同组合,但无处可去。

Metro APP – BitmapImage to Byte 或从Web下载图像并将其转换为Byte 数组

有没有办法将BitmapImage(Windows.UI.Xaml.Media.BitmapImage)转换为Byte []数组? 我没有尝试过任何工作….另一种可能的情况(如果BitmapImage无法转换为Byte数组)是从web下载图像然后将其转换为数组… 但我不知道我怎么能这样做……如果有人有想法,那将是非常好的。 目前尝试: HttpClient http = new HttpClient(); Stream resp = await http.GetStreamAsync(“http://localhost/img/test.jpg”); var ras = new InMemoryRandomAccessStream(); await resp.CopyToAsync(ras.AsStreamForWrite()); BitmapImage bi = new BitmapImage(); bi.SetSource(ras); byte[] pixeBuffer = null; using (MemoryStream ms = new MemoryStream()) { int i = bi.PixelHeight; int i2 = bi.PixelWidth; WriteableBitmap wb = new WriteableBitmap(bi.PixelWidth, bi.PixelHeight); Stream s1 […]

如何将Base64字符串转换为图像,然后将其绑定到Metro风格应用程序中的GridView?

我收集了来自Web服务的产品,我在网格视图中预览了这个产品,但是我将产品的图像作为Base64字符串。 如何将其转换为图像并将其绑定到网格视图中的图像? 任何能帮助我解决这个问题的代码。

如何在Windows 8 metro应用程序中拥有用户提示对话框?

我想从模态窗口获取我的应用程序的一些用户输入,如Name,DOB等 为此我需要显示一个对话框,其中包含文本框和其他控件。 通常在WinForms / WPF中我会创建一个inheritance自Form / Window类的类,并使用Show / ShowDialog方法将表单呈现给用户 如何在使用XAML / C#的Windows 8 metro应用程序中实现此行为? 我查看了Windows.UI.Popups命名空间下的MessageDialog类 但它只显示像经典MessageBox的消息。 我查看了另一个CoreWindowFlyout类,也不确定是否可以将其用于我期望的行为。

从DataTemplate UWP绑定UserControl DP

我有一个显示小雕像的FlipView 。 小雕像包含其图像的路径 。 将此属性绑定到常规DataTemplate是可以的。 (以下代码工作正常) 但是当使用我的UserControl时,它不再起作用了: 从未设置过FigurinePath DP。 (如果我使用硬编码字符串,那很好。)这是输出中的错误: 错误:BindingExpression路径错误:’Com.Test.ViewModels.UserControl.FigurineStickerUserControlViewModel,eSmart.ViewModels,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null’上找不到’Path’属性。 BindingExpression:Path =’Path’DataItem =’Com.Test.ViewModels.UserControl.FigurineStickerUserControlViewModel,Test.ViewModels,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null’; target元素是’Com.Test.Views.FigurineStickerUserControl’(Name =’pageRoot’); target属性是’FigurinePath’(类型’对象’) 看起来DataTemplate尝试将Figurine分配为UserControl的DataContext,然后从我的UC的DataContext中检索属性。 但我的UC有自己的DataContext(它的ViewModel),我不想删除它。 不幸的是,对于WinRT / UWP,我没有使用Binding可以做的FindAncestor技巧。 我已经尝试过这个:( FlipFigurine是FlipView对象) 它不起作用。 即使将DP更改为对象并尝试以下操作也不起作用,DP的设置器永远不会被调用。 但是日志中没有错误。 FigurinePath=”{Binding SelectedItem, ElementName=FlipFigurine}” 有没有办法访问实际的Figurine对象,只需将其Path属性绑定到我的UC的FigurinePath属性?