windows-phone

Storing arraylist in IsolatedStorage

谁说胖子不能爱 提交于 2019-12-13 04:45:36
问题 how do i store a list of array into isolated storage? Possible to place image inside the arraylist too? Thanks 回答1: Like the comments said all you need is to get some serializable object and you're able to store it in IS. Be awate that arrays of more than one dimension are not serializable! Here is a code chunk I use for IS: using System.IO; using System.IO.IsolatedStorage; using System.Xml.Serialization; namespace PhoneApp1 { public class IsolatedStorage { public static void SaveToIs(String

Defining and using resources from code and xaml

萝らか妹 提交于 2019-12-13 04:19:35
问题 I am trying to define Colors, Brushes and few others as a system resource and use them later from code and xaml like I have defined strings in AppResources.resx and used them in code like MyApp.Resources.AppResources.MyStringResource and in xaml like Text="{Binding Source={StaticResource LocalizedStrings}, Path=LocalizedResources.MyStringResource}" I came across ResourceDictionary at few places while I was looking for a solution to it. But I didn't get to know how and where to add a

Inject/serve custom CSS in WP8 WebBrowser Control [duplicate]

心已入冬 提交于 2019-12-13 03:59:36
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: How to inject Javascript in the WP7 WebBrowser control? I have a WebBrowser control in my MainPage.xaml serving an external web page. <phone:WebBrowser Name="TravelPlanner" Source="http://URL-HERE.com" IsScriptEnabled="True"/> Is it possible for me to somehow inject or serve my own CSS (or JavaScript for that matter)? 回答1: Yes. By invoking WebBrowser.InvokeScript after WebBrowser.LoadCompleted you can execute

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

Windows phone refresh/update listbox items

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 03:33:56
问题 I have a problem with a RSS feed app. When my app launches, the listbox gets the feeds and show them in my listbox, but when i press my refresh button the listbox never updates, it just show the same items again, but if i close the app, and then relaunch it, it will show the latest feeds. I hope there is someone that can help. Thanks. MainWindow.xaml: <ListBox Grid.Row="1" Name="feedListBox" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionChanged="feedListBox_SelectionChanged">

Identifying the index/row number of the ItemsControl item that has been tapped via an event handler

随声附和 提交于 2019-12-13 03:10:03
问题 I've a list of locations the user has saved for future reference (this is for a weather app). I'm using an ItemsControl to present the list: <ItemsControl Grid.Row="0" x:Name="locations" ItemsSource="{Binding Path=Locations}" ItemTemplate="{StaticResource locationRow}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> This is the ItemTemplate: <DataTemplate x:Key="locationRow"> <StackPanel>

Write/Restore ObservableCollection<T>

允我心安 提交于 2019-12-13 02:27:08
问题 I have huge problem with saveing and restore ObservableCollection to IsolatedData. I'm trying with this code. Helper class for Observable public class ListItem { public String Title { get; set; } public bool Checked { get; set; } public ListItem(String title, bool isChecked=false) { Title = title; Checked = isChecked; } private ListItem() { } } IsoHelper public class IsoStoreHelper { private static IsolatedStorageFile _isoStore; public static IsolatedStorageFile IsoStore { get { return

Converting XAML into an image in Windows Phone?

匆匆过客 提交于 2019-12-13 02:23:33
问题 For Windows Phone 8, I am looking for a way of converting XAML into an image. Is that possible? I have made a custom control in XAML mixing elements such as images and so forth, that I would like to programmatically "take a screenshot of" and save it. The reason for this is that I'm trying to customize the lockscreen in my very own way. 回答1: Use the WriteableBitmap class. From MSDN: Generate a bitmap snapshot of a visual tree starting from any UIElement: Construct a WriteableBitmap using

How to create a LongListSelector control programmatically

元气小坏坏 提交于 2019-12-13 02:16:45
问题 This is yet another LongListSelector question.. I need to have some selectors with this style and add different bindings to them: <phone:LongListSelector x:Name="ListSelector"> <phone:LongListSelector.ItemTemplate> <DataTemplate> <StackPanel Name="containerStack" Margin="0,0,0,0" Orientation="Horizontal"> <StackPanel HorizontalAlignment="Left" Height="Auto" VerticalAlignment="Top" Width="60" Margin="3,20,2,20"> <TextBlock TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}"

Is it possible to start same animation for different controls at same start time

蹲街弑〆低调 提交于 2019-12-13 02:13:28
问题 I have a story board with double animation, <Storyboard x:Name="Storyboard1"> <DoubleAnimation From="0" To="200" Duration="0:0:2" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> </DoubleAnimation> </Storyboard> and I just adding TargetNameProperty dynamically, private void set_animation_for_images(string target_name) { Storyboard1.Stop(); Storyboard1.SetValue(Storyboard.TargetNameProperty, target_name); Storyboard1.Begin(); } Here is it possible to