|
Friday, April 19, 2013
Global Windows Azure Bootcamp
Friday, April 05, 2013
How to clear Page NavigationCache in Windows 8 Store App
Windows 8 Store App got a nice concept of Page navigation, it supports users to navigate from pages within App, somewhat similar how you navigate on any single website.
I am not going to explain how Page Navigation works in Windows 8 store App. you can check this article on MSDN to learn Page Navigations.
I am going explain one small trick or workaround which I used in my 2 Apps and it’s worked well for me.
I faced an issue in my app where I want to maintain NavigationCache but based on some condition. like in my TechEd India 2013 App if value of City is changed then I want to reload data from service but if city value is same then I want to use data from Cache, and there was another scenario in my Gold store kiosk App where I found this workaround.
Scenario: In my App I have a Page named as “CategoryDetails”, in this page I list out all the products based on Category. User can select a category on main page which navigate him to this page and display all items in that category. I used GridView to display all items. On click on Item user will get navigated to ItemDetails page. Also there is another feature which allow user to select multiple items and from bottom App Bar he can add them to wish list. Many times after selecting 2-3 items user click on some item to check details and then again come back. here. Main issue is I was not able to maintain the selection of the items if you navigate to ItemDetails page and then come back.
To maintain selection I decided to enable PageNavigationCache and it worked . But it results me in another problem, since i use this same page to load items from different categories. user can select category on Home page or from Top App bar and then page load items for that particular category.
Issue: when user go to Home/Main using top app bar and select different category and come again back to this “CategoryDetails” page to view items in that, it fails to load those new items, by default it shows the old data as page get loaded from Cache, with debugger I checked it doesn’t hit Load state method where i have my code to load the Items collection based on Parameter value (category id).
Expected result is – when I select some items on CategoryDetails page and if I navigate to ItemDetails page and then navigate back then it should maintain the Selection of items, if I navigate to Home page and select different category and come on this page then I should have New items related to New category and it should not show mi old data.
After lots of try, errors and studying the exact process of page navigation and page loading by adding break points I came to know that In “LayoutAwarePage.cs” there is “_pageKey” which plays important role in navigation cache. I tried following code and it worked for me.
I added following small method to “LayoutAwarePage.cs”
protected void ClearNavigationCache()
{
this._pageKey = null;
}
And I added following code to CategoryDetails.xaml.cs page.
protected override void OnNavigatedT(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
{
// If Navigation is not Back then this code clears the NvigationsCache
// and which force system to run the load state method for new data.
if (e.NavigationMode != NavigationMode.Back)
{
base.ClearNavigationCache();
}
base.OnNavigatedTo(e);
}
and last step is enable Cache mode on CategoryDetails.xaml page by adding following line at top of XAML page where we declare our namespaces on XAML page.
NavigationCacheMode="Enabled"
Or you can also add it on CategoryDetails.xaml.cs inside Contractor of your page after you call InititializeComponent method.
public CategoryDetails()
{
this.InitializeComponent();
this.NavigationCacheMode =
Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;
}
thats what I did and I got control on Page NavigationCache, now I can use data from cache or I can force my page to get new data.
similarly you can use it to clear navigation cache on any conditions. I used same trick in my TechEd India 2013 App. where I want to clear the page cache if SelectedCity of my App is changed.
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
{
if (DefaultViewModel.Keys.Contains("SelectedCity"))
{
if (DefaultViewModel["SelectedCity"] != App.SelectedCity)
{
base.ClearNavigationCache();
}
}
base.OnNavigatedTo(e);
}
I am sure many of you must be facing similar issue so sharing this with you. use it and enjoy !!!
Please Note: this is workaround I found while working on my app. It worked for me But please note that I am not aware any other side effect of nullifying “_pageKey” property so use this on your own risk. if you come to know any issue please do share with me.
Wednesday, August 01, 2012
The procedure entry point _ Atomic_fetch_sub_4 could not be located in the dynamaic link library
I was facing this issue with my Visual Studio 2012 RC on my Windows 8 Machine from the day I installed Office 15, I thought VS got crashed and today I tried to fix it by reinstalling it but it didn’t worked then I found solution in a comment on ACS Blogs which worked for me, so sharing with you.
Following was the Error I got when I try to start my visual studio
“The procedure entry point _ Atomic_fetch_sub_4 could not be located in the dynamaic link library C:\Program Files(x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe”
Why ?
As Dave Lubash mentioned on ACS Blogs, “The CRT that ships with Office 15 Beta has a breaking change that prevents Visual Studio RC from running.”
Fix:
Download and Install July 2012 Update for Microsoft Visual Studio 2012 RC from http://www.microsoft.com/en-us/download/details.aspx?id=30178
that’s All. it will start working again. thanks to Dave Lubash for sharing this suggestion on ACS Blogs.
Monday, April 16, 2012
Mouse without Borders–Excellent tool I ever seen
From last couple of months I always use to think how if I can use my two laptops just like as extended desktop? How if I can use one single mouse and use it on both screens? how if I can I can just drag and drop some file from one laptop/desktop to other? but I never thought that there could be some tool which can allow me to do this.
And today the dream came true, I got this excellent tool called as “Mouse without Borders”. The tool developed as part of Garage projects program in Microsoft. Initially this tool was available only for internal use but now its available publically.
I downloaded it and tested it on my two laptops, its Excellent!!! simply great that’s why I can say. Trust me this is one of the best tool I even came to know.
Monday, February 20, 2012
PUG I Love Windows Phone Contest
Competition Guidelines :
Key dates of competition :
Competition open for Entries : 14th February 2012Competition closed for Entries : 29th February 2012Announcement of the winners : 10th March 2012
Thursday, January 19, 2012
PUG Community TechDays (IT Pro Track) Jan 2012
Tuesday, January 17, 2012
4 Days Free Training on Windows Phone Application Development
Get ready to accelerate your learning with guidance from experts and win Windows Phone Device. Check out the practical examples and learn to compute, develop and build applications for Windows Phone, the easy way. Pune User Group is coming up with a new 4 Days Training program "iunlockjoy - PUG Windows Phone Development Training Program", an event where professionals can learn all about the Windows Phone Application Development. |
Thursday, November 03, 2011
Microsoft Announces Windows Phone Developer Program for India
‘I unlock Joy’ programme for developers has started from November 1, 2011 and will continue till June 30, 2012 whereas the program for students will begin on December 18, 2011 and conclude on March 30 next year.
Developer competitive categories:
“SUBMIT & WIN” CATEGORY: A registered participant submits THREE qualified Windows Phone Application in the Marketplace and gets a chance to win a Windows Phone. In this category, the Applications must be distinct and of non-trivial utility value for the Application User. A “Spam” or close replicas of existing Windows Phone Applications are disqualified.
Saturday, June 18, 2011
HTML 5 and CSS3 Support in Visual Studio 2010 SP1
Microsoft released an update for visual studio 2010 to support HTML 5, CSS3. The update is known as “Web Standards Update for Microsoft Visual Studio 2010 SP1” and it is available to download as a Free update from Visual studio gallery. According to VS web developer Team blog this updates the HTML5 intellisense and validation to reflect the latest W3C specifications and fixes some bugs in the current SP1 support for HTML5. Also JavaScript intellisense it updated to reflect many of the new browser capabilities such as Geolocation and DOM storage. Finally, this update adds comprehensive CSS3 intellisense and validation based on the latest specifications from W3C.
This Update provides you intellisense and validation for most common HTML 5 features like:
- Video & related tags
- Audio & related tag
- New input types like email, url, date etc.
- Drag & Drop support
- Accessibility standard WAI-ARIA
- Microdata
- Schema.org & more SEO friendly goodness
Friday, March 11, 2011
Tuesday, February 01, 2011
Multi line ToolTip in Silverlight App
2 days back I came across a requirement in my Silverlight 4 project where I need to display a multiline tooltip on my control… if it is just a tooltip then its very simple requirement. we can just use
ToolTipService.ToolTip="tool tip text”.
or we can also bind it to some object and set the tool tip text to that object. e.g.
ToolTipService.ToolTip="{Binding ActivityToolTip}"
but what if I want to display a tool tip which contains more than 1 line ?
one can simply say user “\n” in text, but there is problem. if you going to assign tooltip text in your XAML then you can not use “\n” in your XAML code. it will give you error. if you binding it and going to assign tool tip form your C# code then you can use “\n” but not in XAML code.
while searching I got a nice solution on MSDN forum which worked for me and now I can add multiline tooltip from my XAML code itself.
you can use 
 to define the new line character. so code will be like this
ToolTipService.ToolTip = “ ToolTip Line 1 
 ToolTip Line 2 
 ToolTip Line 3”
and the out for above will be tooltip like -
ToolTip Line 1
ToolTip Line 2
ToolTip Line 3
Monday, January 31, 2011
Free In-depth Windows Azure Training Videos
Windows Azure Jump Start Training Videos!
Microsoft hosted another new and exclusive Jump Start virtual training event, this time covering the Windows Azure Platform.
“Building Cloud Applications using the Windows Azure Platform” was tailored for application architects and developers interested in leveraging the cloud.
Who is the target audience for this training?
- Application Architects and Developers
- Customers and partners already building a Windows Azure pilot project or planning to migrate an application to the Windows Azure Platform
- Companies searching for real-world answers as they consider whether or not the Windows Azure Platform fits their needs.
Wednesday, November 10, 2010
Could not load type System.ServiceModel.Activation.HttpModule
Just faced one problem with my Windows Server 2008 R2 server while configuring my Silverlight WCF application for demo…
my application was working fine on my localhost and it fail to start when I uploaded to my demo server, and I got following error message…
“Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.”
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
This error can occur when IIS is installed after installing .NET Framework 4, or if the 3.0 version of the WCF Http Activation module is installed after installing IIS and .NET Framework 4.
simplest solution to resolve this issue, run the following from command line:
aspnet_regiis.exe /iru
you can locate aspnet_regiis.exe at
- %windir%\Microsoft.NET\Framework\v4.0.30319
- %windir%\Microsoft.NET\Framework64\v4.0.30319 (on a 64-bit machine)
Monday, November 01, 2010
PUG Live Webcasts - An exclusive series of webcasts by Pune User Group
We are pleased to announce the launch of PUG Live Webcasts, an initiative by PUG team through which you will enjoy series of Webcasts on various Microsoft technologies. We are starting with Visual Studio 2010 and Windows Phone 7 Development series; very soon we will be coming up with SharePoint 2010, Silverlight and many more technologies.
for more details visit http://www.puneusergroup.org/live-webcasts.aspx
Wednesday, October 27, 2010
Free Microsoft Press eBooks available for download
List of some of Microsoft free eBooks:
- Free eBook: Moving to Microsoft Visual Studio 2010 (10 chapters by Patrice Pelland, Pascal Paré, and Ken Haines)
- Free eBook: Introducing Microsoft SQL Server 2008 R2 (10 chapters by Ross Mistry and Stacia Misner)
- Free eBook: Programming Windows Phone 7 Series (DRAFT Preview) (6 chapters by Charles Petzold)
- Free eBook: Petzold’s Programming Windows Phone 7 (Special Excerpt 2) (newer than the eBook above; 11 chapters by Charles Petzold)
- Free eBook: Own Your Future: Update Your Skills with Resources and Career Ideas from Microsoft (8 chapters by Katherine Murray)
- Free eBook: Understanding Microsoft Virtualization Solutions (Second Edition) (6 chapters by Mitch Tulloch)
- Free eBook: First Look Microsoft Office 2010 (14 chapters by Katherine Murray)
- Free eBook: Windows 7 troubleshooting tips (short eBook by Mitch Tulloch)
- Free eBook: Introducing Windows Server 2008 R2 (9 chapters by Charlie Russel and Craig Zacker)
- Free eBook: Deploying Windows 7, Essential Guidance (10 chapters from the Windows 7 Resource Kit and 6 TechNet articles)
From Microsoft Press web site thanks to Abhishek Kant for sharing the list.
Friday, October 08, 2010
WebMatrix Beta 2 released
Microsoft announced release of WebMatrix Beta 2 and the Web Platform Installer is available for download at http://go.microsoft.com/fwlink/?LinkID=194638
WebMatrix is a free tool which offers developers a one-click solution to create, build website faster and make their job easier. It provides easy way to customize and build Web sites from popular open source apps like WordPress, Drupal and Joomla as well as a powerful tool to build sites from the ground up using ASP.NET, PHP, HTML and a number of other leading technologies. it also provides facility to publish websites with integrated deployment tools and gallery of hosting providers that meet their needs. this is a great tool for web developers who want to find a new and easier way of building web sites, or who want to learn how to build web sites quickly.
Saturday, September 18, 2010
ASP.NET security Vulnerability Found
Few hours ago Microsoft released a Microsoft Security Advisory about a security vulnerability in ASP.NET. This vulnerability exists in all versions of ASP.NET. Microsoft recommend that all customers immediately apply a workaround to prevent attackers from using this vulnerability against your ASP.NET applications.
here are details and a workaround from Scott Guthrie’s Blog as it is…
-----
Important: ASP.NET Security Vulnerability
A few hours ago we released a Microsoft Security Advisory about a security vulnerability in ASP.NET. This vulnerability exists in all versions of ASP.NET.
This vulnerability was publically disclosed late Friday at a security conference. We recommend that all customers immediately apply a workaround (described below) to prevent attackers from using this vulnerability against your ASP.NET applications.
What does the vulnerability enable?
An attacker using this vulnerability can request and download files within an ASP.NET Application like the web.config file (which often contains sensitive data).
At attacker exploiting this vulnerability can also decrypt data sent to the client in an encrypted state (like ViewState data within a page).
Friday, September 17, 2010
Windows Phone 7 Developer Tools RTM now
Click here to download the web installer.
Click here to download ISO image.
as mentioned by Scott G on his blog, this download includes following tools which are required for any one to write an application for WP7, and good news is all these tools are FREE.
- Visual Studio 2010 Express for Windows Phone – Free edition of VS 2010 for Phone development.
- Express Blend 4 for Windows Phone – Free version of Blend for Windows Phone 7 Development.
- Silverlight for Windows Phone 7 – Rich framework for building great applications for Windows Phone 7.
- XNA Game Studio for Windows Phone 7 – Rich framework that enables you to build great 2D and 3D games for Windows Phone 7.
- Windows Phone Emulator – A hardware accelerated emulator that allows you to run and debug your applications and games without requiring a phone.
- Phone Registration Tool – When you get a device, this allows you to “unlock” the device so you can run/debug your application on it, using your Marketplace account.
Friday, August 06, 2010
Consuming RSS Feeds in your ASP.NET website
There are various ways to use this, you can search for some standard third-party controls, or you can use JavaScript for this, but I think the simplest way is use XMLDataSource, because if you have checked the format of RSS feed then you must be knowing that RSS is nothing but XML file. and once you created this XMLDataSource then you can easily bind this with standard ASP.NET controls like DataList, Labels, Hyperlink etc. so lets see how we can do this in simple 4-5 steps.
- Open Visual Studio and Create a Website or a web application Project.
- on Default.aspx page in design area just drop a XMLDataSource control from Toolbox.
Wednesday, July 28, 2010
Office 2010 Community launch in Pune
Office 2010 another major revolution in Microsoft's most cutting edge technologies is here to get your work done the easy way. Check out the latest news and views on Office 2010 from the experts, attend Office 2010 Community launch event hosted by Pune User Group.
Date: Sat, 7 Aug 2010 - Sat, 7 Aug 2010
Time: 09:00:AM - 01:00:PM