windows-phone-8

Correctly cancel async operation and fire it again

北战南征 提交于 2020-01-10 03:15:09
问题 How to handle case, where user might hit the button, which invokes long running async operation, multiple time. My idea was first check if the async operation is running, cancel it and fire it again. So far I have tried to build this kind of functionality using CancellationTokenSource, but it is not working as expected. Some times there is two async operations running, so the "old" async oprations is not cancelled yet when I start new one and this mixes up the resul handling. Any suggestions

Async JSON Deserialization

白昼怎懂夜的黑 提交于 2020-01-09 11:09:32
问题 I need to do a RestRequest and get some JSON, I am not sure if my method is really async since there is still a little freeze in my UI when I use this method. public async Task<List<MyObject>> Load() { var tcs = new TaskCompletionSource<List<Myobject>>(); var client = new RestSharp.RestClient("https://exampleapi.com"); client.Authenticator = OAuth1Authenticator.ForProtectedResource( [...]); var request = new RestSharp.RestRequest("examp.json", Method.GET); client.ExecuteAsync(request,

DirectX render to texture alpha blending

爱⌒轻易说出口 提交于 2020-01-07 07:58:10
问题 Problem is following: I'm rendering sprites to the texture, then I render texture to the screen. Simple, right? However, when I do that, each time sprite gets rendered, it overwrites every pixel it covers, independent of alpha value of its pixels. Example: Here you can see two sprites with text "ABC". First is rendered in the right top corner and second on top of it with Y offset. As you can see, the second one overrides even those pixels of first sprite that shouldn't be overwritten with

Trial experience of app is allowing unrestricted access - Windows Phone 8

你离开我真会死。 提交于 2020-01-07 07:09:34
问题 I launched my first app yesterday to the store. The app has a trial version which simply restricts full access to the game. I downloaded the trial and played for a while, no problems - good. I then purchased the full version by from the store and started the app again only to find that it didnt release it's restrited areas - NOT good. I have implemented the following code in the app to implement the restrictions: /// <summary> /// The TrialExperienceHelper class can serve as a convenient

Get Navigation data in View Model Windows phone 8

家住魔仙堡 提交于 2020-01-07 04:23:39
问题 I'm using Mvvmlight INavigationService in the project, from view model I navigate to a view , and pass object as parameter ,how do I get either in the view model or in the code behind. I have implemented based on this My View model locator private static INavigationService CreateNavigationService() { var navigationService = new NavigationService(); navigationService.Configure("topupdetails", new System.Uri("/Views/TopUpDetails.xaml", System.UriKind.Relative)); return navigationService; } View

Toast for Push Notification on Windows Phone 8 using Worklight 6.1

半城伤御伤魂 提交于 2020-01-07 04:10:12
问题 I'm using Worklight 6.1 and sending push notifications to Windows Phone 8 using unauthenticated procedure. I am creating the notification by using the following procedure. This procedure updates the tile and badge but doesn't generates a toast notification: WL.Server.createDefaultNotification(notificationText, badgeDigit, {custom:"data"}); What is the correct procedure for adding a "toast" to a received push notification on Windows Phone 8? Also, is there any way to clear the notification on

Upload Image with Facebook status, WP8

*爱你&永不变心* 提交于 2020-01-07 02:31:32
问题 I am unable to send the facebook status with image. Found the code but it throws the exception The Safe handle is closed kindly let me know if i am missing something. there was another example where File.OpenRead(filename) was used but it threw the UnAuthorizedAccessException the code is following : public static Stream ImageToShare { set { try { using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { if (myIsolatedStorage.FileExists(ImageToShareKey)

How to change button image on clicking and again on releasing in windows phone

℡╲_俬逩灬. 提交于 2020-01-06 20:18:23
问题 I want to change image1(let say) on clicking a button, to image2 and again on releasing I want to change it back to image1. If any body knows please answer me. I am new to windows phone development. 回答1: <Button x:Name="MyButton" IsPressed="{Binding MyButtonIsPressed}"></Button> C# private bool _myButtonIsPressed; public bool MyButtonIsPressed { get{ return _myButtonIsPressed;} set{ _myButtonIsPressed = value; if(value==false){ MyButton.Content = ImageWhenReleasing; } else{ MyButton.Content =

Share image in windows phone

邮差的信 提交于 2020-01-06 19:38:28
问题 I am using v7.1 sdk for developing windows phone 8 application ( as my system doesn't support windows 8 so i cant use window phone 8 sdk). I want to share image . In windows phone 8 sdk it is possible using SHAREMEDIATASK but in windows phone sdk v7.1 it is not possible . Now the only solution is to save that image in library and open programmatically, i am doing it like this : MediaLibrary library = new MediaLibrary(); WriteableBitmap wbmp = new WriteableBitmap(canvas1, null); MemoryStream

Edit the DefineConstants in csproj file

删除回忆录丶 提交于 2020-01-06 17:58:27
问题 I have csproj with the following tag: <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>Bin\Debug</OutputPath> <DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;SUPPORTS_ICLOUD</DefineConstants> <NoStdLib>true</NoStdLib> <NoConfig>true</NoConfig> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> Here if you see that i have added