Tuesday, June 28, 2016
Friday, August 15, 2014
Unlike Windows 8, Windows Phone only has one template for toast notification i.e. “toastText02”. It has application icon on left and accepts two text string with first with bold text and another with normal text. It is advisable to have very short strings to avoid truncation. We can use XML functions to set above two text.
When user clicks on toast notification, the app gets launched. We can set launch attribute of toast element containing parameters which we can use to decide navigation page when the app is launched. We can write following code to set launch parameter.
So if our launch page is MainPage.xaml then uri would be “MainPage.xaml?FileID=1”. We can read the QueryString value in MainPage.xaml and do operation as per project requirement.
Now we can create a ScheduledToastNotification where we can pass XmlDocument object containing information about toast and scheduled time when the toast notification should be displayed. We can optional also set “ID” property for ScheduledToastNotification so that we can cancel it in future if required.
We can also set MaximumSnoozeCount parameter to set maximum number of times notification should be displayed and SnoozeInterval parameter to set time interval between notifications. SnoozeInterval should be between 1 to 60 minutes and MaximumSnoozeCount should be between 1 to 5.
If we don’t want to show ToastNotification popup and only show the details in action center then we can set SuppressPopup property.
It is advisable to check if any toast notification with similar ID is already created or not. If already created then you can notify the user or delete it.
Now we can create ToastNotifier object and add scheduled notification using following code
For ToastNotification to work correctly we have to set Notification Service as “WNS” in WMAppManifest.xml file. This is one of the most important steps as your app could be reject in Certification process if “WNS” is not selected in Notification Service.
Below is complete code to create ScheduledToastNotification in Windows Phone Silverlight 8.1 app.
Wednesday, April 2, 2014
- Download Cab File and extract mdmp file
- As you can see in above image we have set symbol path as environment variable. We have set “http://msdl.microsoft.com/download/symbols” path which is a link for Microsoft Symbol Server.
- Open WinDBG using "WinDBG -y" command
- As you can see in above image you get a command line at bottom of screen with text “0.000>”.
- Turn on the noisy symbol loading mode using “!sym noisy” command. This command instructs the debugger to display information about its search for symbols.You can find more about this command from following link
0.000> !sym noisy
- Use .reload command to delete all symbol information for the specified module and reload these symbols as needed. Using “/f” parameter with .reload command will force the debugger to load the symbols immediately.
0.000> .reload /fYou can know more about this command from following link
- Use “KV” command to get stack frame information. It displays frame pointer omission (FPO) information.
0.000> kvYou can find more about this command from following link
- Use “!analyze –v” to get information about current exception or bug check with verbose output.
0.000> !analyze -vYou can find more about this command from following link
Other Useful link
Wednesday, October 16, 2013
In the above code, we are using "StartsWith" function to filter the Collection, and show the items which starts with text typed in TextBox. We can also use "Contains" function instead of "StartsWith" to show all the items which contains text typed in TextBox.
On TextChanged event on TextBox to reapply the filter we have to refresh the view using "CollectionViewSource.View.Refresh" function.
You can also refer following links to know more about CollectionViewSource
Friday, July 26, 2013
Today I am going to share a code snippet to create an Editable Button in WPF, where we can update the text of a Button at runtime. In this control the user would right-click a button and then click 'Edit' to make to control Editable, and later right-click it to save/cancel the change.
First step to make the Button editable is to change the Style of Button and add a TextBox inside it, which we will make visible when the user clicks on 'Edit'.
As you can see in the above code, I have added a "txtContent" textbox which is hidden. Also to make editing look like a part of the Button, the Background and BorderBrush properties of textbox are transparent
In the above code we have an "IsEditMode" property which the user can use to know whether the control is in Edit Mode or not. Also, we have two different Context Menus, one to Edit the Control, and the another to Save/Cancel the changes. Based on the menuitems that are clicked, we are going to set the visibility of TextBox and ContentPresenter, defined in XAML.
Now we can use the control in our application as below
Hope the above control helps you in your development.