UWP Windows 10 App memory increasing on navigation

Every time you navigate to a Page, you create a new instance of Page, but the previous Page is not disposed (even if the Page is already in the navigation stack). To prevent multiple allocation of same page, set NavigationCacheMode=”Enabled” attribute to the Page. Also, to minimize the memory allocation, you must override method OnNavigatedTo … Read more

Removing PDF invisible objects with iTextSharp

If the PDF which you are trying is a template/predefined/fixed then you can remove that object by calling RemoveField. PdfReader pdfReader = new PdfReader(../Template_Path.pdf”)); PdfStamper pdfStamperToPopulate = new PdfStamper(pdfReader, new FileStream(outputPath, FileMode.Create)); AcroFields pdfFormFields = pdfStamperToPopulate.AcroFields; pdfFormFields.RemoveField(“fieldNameToBeRemoved”);

Hourly, Daily, Monthly Helper+Model methods

You can create daily,monthly and yearly data by using the same logic. You just have to replace Hour with Day,Month or Year. List<dynamic> dailyData = new List<dynamic>(); DateTime dayIterator = StartDate.Value; while (dayIterator.Hour <= ddvm.CurrentDay) { if (ddvm.DailyPaymentTotal != null && ddvm.DailyPaymentTotal.Count() > 0 ) { DailyPaymentTotalModel day = ddvm.DailyPaymentTotal.FirstOrDefault(hpt => hpt.DateTimeStamp == dayIterator); if … Read more

C# first class continuation via C++ interop or some other way?

There is the C# 5 CTP, which performs a continuation-passing-style transformation over methods declared with the new async keyword, and continuation-passing based calls when using the await keyword. This is not actually a new CLR feature but rather a set of directives for the compiler to perform the CPS transformation over your code and a … Read more

WPF Attached Events vs Non-Attached Events

The difference is mostly syntactic, both delegate references are being handled by WPF’s EventManager but what the attached events give you is the ability to declare generic functionality without needing to bloat all your classes’ implementation. In the case of a normal routed event, the class provides the interface to be able to at some … Read more