windows-phone-8.1

How to highlight dates in a TextBlock MVVM Light

风格不统一 提交于 2019-12-13 04:01:16
问题 I want to highlight the foreground or background color of the dates based on current date. How can I do it in my ViewModel? What are the codes I can use to highlight the date? Here are my codes for the whole project: xaml: <Grid Margin="10,102,10,298"> <GridView ItemsSource="{Binding Calendar.DateCollection}"> <GridView.ItemTemplate> <DataTemplate> <Grid x:Name="dateGrid" Background="AntiqueWhite" Width="50" Height="30"> <TextBlock x:Name="txtDate" Text="{Binding}" Foreground="Black"

Muliple Pushpins in Windows Phone 8.1

我的梦境 提交于 2019-12-13 03:56:44
问题 I am using MapControl to display map. I have MapServiceToken too. I have added custom pushpin using MapIcon and assigned this object to Map. It is working fine. But when i try to add multiple pushpins using same scenario and assign it to map so i am getting last pushpin on the map. Rest of other pushpins are not getting visible. Kindly tell me any simple solution to this problem. Thanks 回答1: You can binding your pushpins on map without MapIcon. Add in xaml <Maps:MapControl x:Name=

Windows Phone 8.1 - FileOpenPicker filter by name

好久不见. 提交于 2019-12-13 03:56:26
问题 I'm developing a Windows Phone app (Windows Runtime, not Windows Phone Silverlight 8.1). In it, I have to let the user select multiple photos to do some processing with them. To accomplish this, I'm using the FileOpenPicker class, and it works fine. But I want to show only the pictures whose name doesn't start with a given string, for example, "abc-". So, in this case, I would only want the FileOpenPicker to display the pictures whose name doesn't start with " abc-". So, is it possible to do

Read .xml File into XmlDocument

早过忘川 提交于 2019-12-13 02:37:43
问题 I have a live tile template such as: <tile> <visual version="2"> <binding template="TileSquare150x150Text02" fallback="TileSquareText02"> <text id="1">Text Field 1 (larger text)</text> <text id="2">Text Field 2</text> </binding> </visual> </tile> I can read it into an XmlDocument like so: StringBuilder sb = new StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\" ?><tile>"); sb.Append("<visual version=\"2\"><binding template=\"TileSquare150x150Text04\" fallback=\"TileSquareText04\"><text

RenderTargetBitmap in Windows Phone Unit Test App

别来无恙 提交于 2019-12-13 02:08:05
问题 I'm trying to write a unit test that will test a visual appearance of my custom control. Therefore I want to capture the control visual appearance using RenderTargetBitmap and then use assertions on result pixels. Here is my test: [TestClass] public class UnitTest2 { [TestMethod] public void TestMethod2() { //pixels to test byte[] pixels = null; // Since I create a UI elements, I need to use Dispatcher here. var task = CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core

Windows Phone 8.1 gridview

好久不见. 提交于 2019-12-13 02:05:48
问题 How can I create a stackpanel in a gridview with various elements in the stackpanel responding to different click event? The stackpanel will contain 2 appbarbutton and each appbarbutton has a textblock that increments based on the number of clicks... <GridView ItemsSource={Binding}> <GridView.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <StackPanel Orientation="Vertical"> <StackPanel Orientation="Horizontal"> <AppBarButton Icon="Like" Name="like" IsCompact="True" Click=

Local settings in Windows Phone 8.1 app are not stored

牧云@^-^@ 提交于 2019-12-13 02:04:44
问题 I have created many apps for Windows Phone 7 and 8. To store settings I was using these methods: IsolatedStorageSettings.ApplicationSettings["key"] = value; IsolatedStorageSettings.ApplicationSettings.Save(); Everything worked perfectly, my settings were stored. Save() method did the job. But now I am creating an app for Windows Phone 8.1 (WinRT). I have followed this guide to learn hot to save settings. Ane here is how it looks like now: Windows.Storage.ApplicationData.Current.LocalSettings

Border for ContentDialog in Windows Phone 8.1

眉间皱痕 提交于 2019-12-13 01:28:55
问题 I am developing an application for Windows Phone 8.1 (Windows RT apps). I'd like to show a ContentDialog with a white border around it, and I can see the dialog all right, but I am not able to see any border in it. I have defined my own xaml for it, since I use this dialog frequently and I wanted to have common settings in one place. Here is the XAML: <ContentDialog x:Class="MyNamespace.MyDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas

Convert BitmapImage to byte[]

放肆的年华 提交于 2019-12-13 01:15:26
问题 I have problem with converting BitmapImage to byte[]. I tried a lot of solutions and nothing works, every time i get different errors. For example i found nice solutions but it also doesn't work. What's wrong with it? I'm using Windows Phone 8.1. public static byte[] ImageToBytes(BitmapImage img) { using (MemoryStream ms = new MemoryStream()) { WriteableBitmap btmMap = new WriteableBitmap(img); System.Windows.Media.Imaging.Extensions.SaveJpeg(btmMap, ms, img.PixelWidth, img.PixelHeight, 0,

RadialGradientBrush in Windows Phone 8.1?

孤者浪人 提交于 2019-12-12 21:15:24
问题 Please tell me how can I create a RadialGradientBrush in Windows Phone 8.1 app? I've tried to find it here but there is no such brush Windows.UI.Xaml.Media Any ideas? Thank you! 回答1: If you don't mind installing the new Microsoft's Win2D library from NuGet or their Win2D GitHub, you can use the Microsoft.Graphics.Canvas.CanvasRadialGradientBrush . For further reference: Microsoft.Graphics.Canvas.CanvasRadialGradientBrush 来源: https://stackoverflow.com/questions/27943177/radialgradientbrush-in