Tag: windows phone

Caliburn.Micro在App.xaml的命名空间中没有“Bootstrapper”

编辑:似乎我终于让它工作了。 我问过我之前提到的那篇文章的作者,他说这是一个已知的问题。 他还给了mi一个解决方法(在post下方的评论中),所以我认为这个问题是封闭的。 但感谢大家花时间解决我的问题:) 我正在尝试使用Caliburn Micro框架学习MVVM,但我从一开始就遇到了问题。 我正在学习本教程,并在App.xaml中获得了这样的代码: 但是我收到了一个错误: 名称“Bootstrapper”在名称空间“clr-namespace:Caliburn”中不存在。 我从NuGet存储库获得了Caliburn Micro 1.5.2。 任何想法赞赏…… 我的引导程序: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Caliburn.Micro; namespace Caliburn { public class Bootstrapper : PhoneBootstrapper { PhoneContainer container; protected override void Configure() { container = new PhoneContainer(); container.RegisterPhoneServices(RootFrame); //container.PerRequest(); AddCustomConventions(); } static void AddCustomConventions() { //ellided } protected […]

应用未运行时的Toast通知

我在Windows Phone 8上用推送通知服务(只有吐司)编写应用程序,我还有MSSQL Job发送到我的移动应用程序。 发送数据具有以下格式( typeId是int,它告诉应用程序应该对数据做什么): title subtitle typeId;data 当我运行应用程序时推入收入,我可以通过方法服务我的应用程序(这种情况下工作正常) httpChannel.ShellToastNotificationReceived += new EventHandler(httpChannel_ShellToastNotificationReceived); httpChannel.BindToShellToast(); 当app未运行时,我的问题是无法提供toast推送通知。 用XML中的文本推动收入,但当我点击通知时,我会进入我的应用程序的主页面。 如何附加我的代码来决定typeId和XML中的数据做什么

在Windows Phone 8中使StackPanel可滚动

我有一个控件列表,放入一个stackpanel。 这些控件是Hubtiles,在用户创建后以编程方式添加 – 基本上是一个列表。 我需要创建添加它们的StackPanel,可滚动 – 这对此最好的方法是什么? 我应该将堆栈面板放在ScrollView中,然后使用Hubtile的实际高度增加StackPanels高度 – 使其可滚动,但不是这样,用户可以滚动无限而无需存在任何东西。 因此,只要StackPanel内的控件数达到3,它就会自动增加它的高度,如下所示: 每当StackPanel内的控件数量达到3或更高时: StackPanel.Height = StackPanel.Height + Hubtile.ActualHeight; 非常感谢!

将焦点设置为PanoramaItem

有没有办法在Silverlight for Windows Phone 7中将焦点设置为PanoramaItem? 我试过了: piResults.Focus(); 其中piResults是PanoramaItem的名称。 我也试图将焦点放在PanoramaItem中的一个控件上,但这也没有用。 如果不清楚,我正在尝试执行以下操作:如果按下一个PanoramaItem上的按钮,则转到另一个。

如何解决DEP6500和DEP6701错误?

我在自己的解决方案中有一个名为BTLE的项目。 加载项目并使用手机上的调试器运行它可以找到。 我有第二个解决方案,加载和编译也很好。 我将BTLE项目(添加/现有项目)添加到第二个解决方案,编译它并尝试在调试器中运行它。 我可以看到应用程序被正确加载到手机(我可以从手机上运行),但调试器将无法启动,我收到以下错误消息: 1>—— Deploy started: Project: BTLE, Configuration: Debug ARM —— 1>Deploying to Phone Internal Storage… 1>Updating the layout… 1>Copying files: Total 2 mb to layout… 1>Checking whether required frameworks are installed… 1>Registering the application to run from layout… 1>Deployment complete (0:00:05.469). Full package name: “76081875-4de1-4857- 8ce6-4e7a580ee1b6_1.0.0.0_arm__fdr7mxj3cnxqw” 2>—— Deploy started: Project: STPWindows, […]

试图让Windows Phone 8 ListPicker工作

ListPicker函数,我可以单击它并出现一个全屏弹出窗口,但有一些选项可供选择。 我的xaml: 它背后的C#包括: String[] moduleNumber = { “AA1”, “AA2”, “AA3” }; 和 public MainPage() { InitializeComponent(); this.modulePicker.ItemsSource = moduleNumber; } 那么我需要做些什么来使moduleNumber中列出的字符串显示在ListPicker上? 如果您需要了解更多,请询问。

如何将图像路径保存到Live Tile的WP8 Local文件夹中

我正在更新我的Windows Phone应用程序以使用新的WP8文件存储API( LocalFolder )而不是WP7 API( IsolatedStorageFile )。 旧工作方法 以下是使用IsolatedStorageFile方法将Image成功保存到/ Shared / ShellContent文件夹的方法(在保存图像时注意/Shared/ShellContent/前缀,以及更新实时图块时的isostore:/Shared/ShellContent/前缀。 using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { if (myIsolatedStorage.FileExists(“/Shared/ShellContent/LiveTileImagePath.jpg”)) { myIsolatedStorage.DeleteFile(“/Shared/ShellContent/LiveTileImagePath.jpg”); } IsolatedStorageFileStream copyFileStream = myIsolatedStorage.CreateFile(“/Shared/ShellContent/LiveTileImagePath.jpg”); wb.SaveJpeg(copyFileStream, wb.PixelWidth, wb.PixelHeight, 0, 100); copyFileStream.Close(); //UpdateTile ShellTile tile = ShellTile.ActiveTiles.First(); if (tile != null) { FlipTileData tileData = new FlipTileData() { Title = “title”, BackTitle = “backtitle”, […]

为什么我在使用Microsoft.Bcl时不能在Windows Phone 7.1 MvvmCross项目中使用await关键字 – 无法等待’System.Threading.Tasks.Task?

在使用Microsoft.Bcl“Microsoft BCL Portability Pack”时,我无法在MvvmCross Windows Phone 7.1项目中使用await关键字。 我已经在GitHub上发布了我在下面描述的示例项目的代码, 并且此行发生了await错误 。 当我尝试构建包含FirstViewModel的第三个“核心”Windows可移植类库(PCL)时,我得到以下错误: Type System.Threading.Tasks.Task not awaitable under VS red squiggles, and Cannot await ‘System.Threading.Tasks.Task’ when building. 解决方案中有四个项目: 一个Windows可移植类库(PCL),其中包含一个接口,该接口引用BCL提供的“任务”对象。 一个针对OS 7.1的Windows Phone类库,它实现了上面的接口,并且还使用了BCL中的“任务”。 另一个Windows可移植类库(PCL),提供应用程序的“核心”function,包括ViewModel。 尝试引用和使用上述DLL的Windows Phone 7.1 /“7.5”应用程序。 前两个项目包含接口和接口的实现编译没有任何错误。 但第3个“核心”PCL无法使用上面显示的错误构建。 更多细节如果你想要他们: 我尝试了这个App.config“修复”,如“已知的BCL问题”中所述: http : //blogs.msdn.com/b/bclteam/p/asynctargetingpackkb.aspx 。但是当我添加时没有解决错误App.config只是“核心”项目,也不是我尝试将相同的App.config添加到每个项目。 我可能没有在元素中使用正确的版本,或者我只是错误地完成了App.config的操作。 解决方案中设置为以PCL为目标的每个项目在Visual Studio中都设置为“Profile104”。 那些DLL位于: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile104\ 此PCL配置文件显示为在Visual Studio项目属性中定位这些平台:.NET for Windows […]

Windows 10 Mobile(10.0.14393)地理围栏的后台任务(LocationTrigger)

自从10.0.14393 (Anniversery Update)以来, LocationTrigger似乎不起作用。 我有: Windows Phone 8.1应用程序(也适用于UWP应用程序)。 一个可输入Windows Runtime Component库的可.winmd库( .winmd ) 具有位置function的后台任务声明(设置为库作为条目)。 使用BackgroundExecutionManager.RequestAccessAsync()访问 Geofence类型的LocationTrigger 。 后台任务永远不会被触发。 获取访问权限后的注册/任务代码: public sealed class GeofenceTask : IBackgroundTask { public static void Register() { var taskName = nameof(GeofenceTask); foreach (var n in BackgroundTaskRegistration.AllTasks.Where(n => n.Value.Name == taskName)) { n.Value.Unregister(true); break; } var builder = new BackgroundTaskBuilder {Name = […]

当目标是ImageBrush.ImageSource时,TemplateBinding失败

为什么在这种特定情况下, TemplateBinding似乎失败了? 拿一个基本的扩展按钮: public class IconButton : Button { public ImageSource Icon { get { return (ImageSource)GetValue(IconProperty); } set { SetValue(IconProperty, value); } } public static readonly DependencyProperty ImageProperty = DependencyProperty.Register(“Icon”, typeof(ImageSource), typeof(IconButton), new PropertyMetadata(null)); public IconButton() { DefaultStyleKey = typeof(IconButton); } } 控件模板使用OpacityMask显示图标: 这无声地失败 – 控件显示为实心矩形。 如果我使用常规图像而不是ImageBrush ,则绑定成功: 如果我硬编码图像源路径,它也可以正常工作: 那么,为什么TemplateBinding在ImageBrush失败? 更新 通过演绎(并感谢克里斯的答案),可能的因素是: ImageBrushinheritance自DependencyObject而不是FrameworkElement TemplateBinding不像普通绑定那样支持隐式类型转换(即string-to-ImageSource) […]