windows-phone-8.1

Manipulation on Pivot in Windows Phone 8.1

时光怂恿深爱的人放手 提交于 2019-12-23 06:07:39
问题 I have a Pivot with 2 PivotItems. I'm trying to detect whether the user swiped left or right. I thought I could detect this by checking the difference between the ManipulationStarted and ManipulationCompleted point. But whatever I do, those events won't get triggered. <Pivot x:Name="albumart_pivot" Margin="0,-30,0,0" ManipulationStarted="ManipulationStartedEvent" ManipulationCompleted="ManipulationCompletedEvent" ManipulationMode="TranslateX"> <PivotItem Margin="0"> <Grid> <Rectangle Canvas

Manipulation on Pivot in Windows Phone 8.1

依然范特西╮ 提交于 2019-12-23 06:07:10
问题 I have a Pivot with 2 PivotItems. I'm trying to detect whether the user swiped left or right. I thought I could detect this by checking the difference between the ManipulationStarted and ManipulationCompleted point. But whatever I do, those events won't get triggered. <Pivot x:Name="albumart_pivot" Margin="0,-30,0,0" ManipulationStarted="ManipulationStartedEvent" ManipulationCompleted="ManipulationCompletedEvent" ManipulationMode="TranslateX"> <PivotItem Margin="0"> <Grid> <Rectangle Canvas

Add a sidebar in Windows Phone 8.1 application

╄→гoц情女王★ 提交于 2019-12-23 05:30:48
问题 I'm building Windows Phone 8.1 application and I want a sidebar like in android apps. How can I do it? I tried this example, but doesn't compile and manipulation event's do not fire. 回答1: Here is very simple example with velocity handling. Make sure to set grid's Manipulation property to All . Change grid's background from DarkSalmon to Transparent . XAML <Canvas Name="RootCanvas"> <Canvas.Resources> <Storyboard x:Name="MoveAnimation"> <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard

Navigate to a different page from ContinueFileOpenPicker method

杀马特。学长 韩版系。学妹 提交于 2019-12-23 05:17:24
问题 I'm using the FilePicker for Windows Universal apps and I'm trying to launch the File Picker from MainPage.xaml and then navigate to a different page (LoadPhoto.xaml) to render the selected image. I initially implemented my app so that I'd navigate to LoadPhoto.xaml and then, as part of loading the page, I'd call the File Picker. However that caused issues when resuming the app, so I moved the File Picker call out of the constructor. In the newest implementation, I call the file picker from

How to subscribe to events properly in Windows Runtime apps?

旧巷老猫 提交于 2019-12-23 04:54:29
问题 I subscribe to OrientationChanged event in the constructor like this: public SecondPage() { this.InitializeComponent(); deviceOrientationSensor = SimpleOrientationSensor.GetDefault(); if (deviceOrientationSensor != null) { deviceOrientationSensor.OrientationChanged += OrientationChanged; } } and then: private void OrientationChanged(SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args) { deviceOrientation = args.Orientation; // the rest... } So the problem

Storyboard animation is lagging

浪子不回头ぞ 提交于 2019-12-23 04:54:14
问题 i created a snow falling animation but it is little lagging, if i create this animation in blank new app it works fine but if try to build some more things and use it fully build app it starts lagging. XAML <Grid> <Canvas x:Name="ContentPanel" Height="768"> </Canvas> </Grid> C# using System.Windows.Shapes; using System.Windows.Media.Animation; using System.Windows.Media; public partial class MainPage : PhoneApplicationPage { private static Random random; public MainPage() {

Dynamically add text in an image on Xaml/Windows Phone

喜你入骨 提交于 2019-12-23 04:53:44
问题 I have a XAML ListBox where I am implementing an Image beside that a block of text is there. I want to display a count text in that image. For example for the first block in the image I want to display 1, for the 2nd block I want to display 2. This goes on. Below is the snippet. Can anybody please help me how can I write the count numbers in the image? <StackPanel Grid.Column="0"> <Image Source="/Assets/Images/pin.png"></Image> </StackPanel> <TextBlock Name="locationID" Visibility="Collapsed"

LINQ: Dynamic where with generic property and value

戏子无情 提交于 2019-12-23 04:53:37
问题 I'm trying to build a simple select method for querying Linq-to-SQL table thru a generic static method. I'm stuck at creating the expression dynamically. Same kind of question here: LINQ : Dynamic select T is the class of the database table (Person) P is the type of the value. The value and property types should be the same (F.ex String) column is the name of property on the given class ("Name") value is the where statement value for the field ("Jack") F.ex Select all persons where name is

(WinRT)How to get TextBox caret index?

南楼画角 提交于 2019-12-23 04:49:23
问题 I got some problems with getting caret index of TextBox in Windows Store App(WP 8.1). I need to insert specific symbols to the text when button is pressed. I tried this: text.Text = text.Text.Insert(text.SelectionStart, "~"); But this code inserts symbol to the beginning of text, not to the place where caret is. UPDATE I updated my code thanks to Ladi. But now I got another problem: I'm building HMTL editor app so my default TextBlock.Text is: <!DOCTYPE html>\r\n<html>\r\n<head>\r\n</head>\r

How do I read an embedded text file on Windows Phone 8.1?

不问归期 提交于 2019-12-23 04:04:21
问题 (I can find many answers for Windows Phone 7 which probably work Windows Phone 8/8.1 Silverlight, but not for Windows Phone [Store] 8.1) While testing my application, I want to use a dummy server response. Since it's a large amount of data that includes quotation marks, I don't want to use a constant string and have to escape everything. How can I read a text file that's included with my Windows Phone 8.1 application? 回答1: For this example, I have a file called sample-response.txt and its