windows-phone-8

How to Scroll to the Bottom of a ListBox when Items are Added

早过忘川 提交于 2019-12-25 10:25:14
问题 I'd like to be able to create some sort of auto scrolling feature in a ListBox I have, where new data is added periodically to the ListBox. Items populating the ListBox are held in an ObservableCollection, and are always added to the end of the collection. Is there a way to make the ListBox auto scroll to the bottom every time a new item is added to the ObservableCollection and the View is updated? 回答1: listBox1.SelectedIndex = listBox1.Items.Count - 1; listBox1.SelectedIndex = -1; 来源: https:

Accessing a html page that is in a tab of a html page using Windows Phone 8 app

折月煮酒 提交于 2019-12-25 10:18:45
问题 I am programming in C# and for Windows Phone 8. I am currently trying to access a html page (lets say an students subject grades[page 2]). This html page is referenced by a href tag that is placed within another html page (the students home screen after log in [page 1]), which i have accessed using a HttpClient object with the help of a POSTAsync function. I need to know a way by which i can programmatically click this specific link (from page 1 to page 2). I know how to access the href

custom shape in windows phone 8

坚强是说给别人听的谎言 提交于 2019-12-25 09:38:45
问题 I want to derive Shape class following: class MyRectangle : Shape { protected override System.Windows.Media.Geometry DefiningGeometry { get { return null; } } } but I get error because DefiningGeometry property can't be overrided (althought wpf can). How can i custom shape in WP8 ? 回答1: You should base your custom shape on a Path rather than inheriting from Shape directly. 来源: https://stackoverflow.com/questions/19519936/custom-shape-in-windows-phone-8

windows phone 8 resource path at runtime

女生的网名这么多〃 提交于 2019-12-25 09:31:36
问题 I have to include some files with my windows phone 8 app. the app will accordingly get those file from resource and read or show partly the content according to the algorithm. how do i get the path to my embedded resource? 回答1: If you include file in you project, for instance in Data folder of your project (in our case json file) as a resource then use next code to get content from that file: string content = string.Empty; string resource_file = "Data/myfile.json"; if

Display images from facebook in separate thumbnails

余生长醉 提交于 2019-12-25 08:54:26
问题 I am developing windows phone application. here I am taking some images from Facebook.All images coming in horizontal scrolling one after other Problem: how to add some blank space between two images This is my code so far: <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible" > <Image Source="{Binding Path=picture}" Width="250" Height="250" /> </StackPanel> <

Communication with OBD-II using Windows Phone

删除回忆录丶 提交于 2019-12-25 08:28:12
问题 I have a problem with sending and receiving data from elm327 device. I tried to connect to the device using channel 01 (on Bluetooth) but it doesn't matter what command I send, I just receive the string "AT+BRSF=24\r" as an answer. I tried also to connect at channel 16 and there I receive a string "NO DATA" somebody knows what is the problem? thank you, Arie 回答1: The AT+BRSF=24 response sounds like you're communicating with the wrong Bluetooth device (perhaps a headset?). "NO DATA" sounds

Looping sound in SoundEffect class Windows Phone 8

百般思念 提交于 2019-12-25 08:17:13
问题 I am developing a game, and need to add background music for that. I tried Microsoft.Xna.Framework.Audio namespace's SoundEffect class. Initially I used SoundEffectInstance Sound = SoundEffect.FromStream(Application.GetResourceStream(new Uri("Assets/background.wav", UriKind.Relative)).Stream).CreateInstance(); Sound.IsLooped = true; Sound.Play(); And it was not working. Then I tried SoundEffect sound; StreamResourceInfo info = Application.GetResourceStream( new Uri("Assets/background.wav",

DataContractJsonSerializer returning null object

 ̄綄美尐妖づ 提交于 2019-12-25 08:15:17
问题 I've been struggling with this problem for quite some time now, and can't solve it. I have the following JSON string: {"Search":[{"Title":"somestring","Year":"somestring","imdbID":"somestring"}]}, {"Title":"somestring","Year":"somestring","imdbID":"somestring"} etc The string can repeat itself multiple times, so I want to store the values in a list. In order to do this I've created the following two classes: The SuggestionListener class: [DataContract] class SuggestionLister { public List

IBM Mobile First Platform (6.3) - Windows Phone 8 environment and Angularjs

喜你入骨 提交于 2019-12-25 07:58:37
问题 I create demo app using angularjs (+ angular-ui-router) to develop and build to android, ios, windows phone 8 environment. Everythings works fine on android, ios and mobile web simulator, but on windows phone device it doesn't show my custom directive. I use visual studio express 2012 for windows phone to build. in index.html: <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>test</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,

Keep a reference to objects passed to a UserControl

女生的网名这么多〃 提交于 2019-12-25 07:37:29
问题 I created a UserControl that has a ContentControl in it. This ContentControl gets Buttons from the normal .xaml-pages. But depending on some events I need to change this Button's Label or Image but i am getting a NullReferenceException. UserControl1.xaml <Grid> <!-- different Stuff that needs to be around --> <ContentControl Content="{Binding UserControlContent, ElementName=userContent}"/> </Grid> UserControl1.xaml.cs public static readonly DependencyProperty AppBarContentProperty =