.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Does WPF implicit caching of static resources?

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :WPF


in my Application.Current.Resources.MergedDictionaries is a ResourceDictionary with theme specific resources. If the user selects another theme, the theme-depended control is removed from it's parent (Grid) and a splash screen is inserted instead. After replacing the theme-specific ResourceDictonary in the Application.Current.Resources.MergedDictionaries, the theme-depended control is created anew and replaces the splash screen. But, the control still uses the static resources from the replaced ResourceDirectory. Why? Is there any implicit resource caching in WPF? In the Silverlight port of the app, the static theme resources are applied correctly.  


View Complete Post

More Related Resource Links

Static and Dynamic Resources with Brush and Resource Dictionary

Hi, We're using a huge resource dicionary with all the styles and templates for our controls. Some of these are the images that we use for some buttons and icons in the application. As far as I know, Static and Dynamic resources have nothing to do with the ResourceDictionary and The Brush, i could use any of them, if i need the resource to load only when needed i could use dynamic and if i want it to load on initialization time i should use Static. But everytime i try to use a static resource to define a Fill of a rectangle my application crashes on initialization time (when it exectues the InitializeComponents). The resource i'm using is a DrawingBrush that is declared on my resource dictionary and the only way i could make it works is defining it as DynamicResource. What is the limitation? Its realy impossible to define a static resource on a fill property, and if its realy impossible, why?

Requesting static resources

Hi!I created method IsMobileRequest(HttpContext ctx) that checks whether or not user agen is mobile browser. If it is mobile browser, application will redirect user to /mobile controller.Code in Global.asax for redirection handling:protected void Application_BeginRequest() { if(Helpers.MobileUtilities.IsMobileRequest(Context)) { HttpContextBase currentContext = new HttpContextWrapper(HttpContext.Current); RouteData routeData = RouteTable.Routes.GetRouteData(currentContext); String currentControllerName = currentControllerName = (String) routeData.Values["Controller"]; if (currentControllerName.ToLower() != "mobile") { Context.Response.Redirect("/mobile"); } } } This code succefully redirected all request to /mobile but when front-end developer inserted markup that loads static contents (/Content/Images, /Content/Styles, etc.) mobile page didn't render those static files.After some experimenting, I noticed that in ASP.NET MVC request for static files passes throught application stack (Global.aspx) as well as dynamic requests.This version of code addresses that issue:protected void Application_BeginRequest() { if(Helper

Static Class for Beginners

In general, the members of a class can be accessed by instance of that class when they are in public, but there comes a situation to access or call members of a class without an instance and this can be achieved by declaring them as static

How to detect and avoid memory and resources leaks in .NET application

Despite what a lot of people believe, it's easy to introduce memory and resources leaks in .NET applications. The Garbage Collector, or GC for close friends, is not a magician who would completely relieve you from taking care of your memory and resources consumption.

I'll explain in this article why memory leaks exist in .NET and how to avoid them. Don't worry, I won't focus here on the inner workings of the garbage collector and other advanced characteristics of memory and resources management in .NET.

SharePoint 2010 - Top 10 Resources to get you started

This post contains links to download evaluation software, guides, demo virtual machines and lots more, for both Developers and IT Professionals.SharePoint 2010 - Top 10 Resources to get you started

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

Resources for soup-to-nuts of website development lifecycle



 I'm looking for a website, or book, or some resource that can lead me down the path from website design to implementation/deployment. I know that covers a ton of material, but I am really looking for the bullet points, or high-lights, to make sure that I think of everything. I am mostly fuzzy on security measures and deployment since I haven't been involved in those aspects before.

Background:  I have been a programmer for many years, and with a little over 3 years' experience coding websites in vb.net/asp.net with sql server. Due to recent restructuring/layoffs at our firm, I find myself in the position of lead IT person - I'm feeling a bit underqualified but I feel this is my chance to work hard and step up to it. I'm very good at vb.net, master pages, css, asp.net, sql server. I'm worried that the person who was the lead before was doing a bunch of stuff that I'm not aware of...so I need to start learning more than just the code. I don't need lessons on how to code anything...I need to learn how it all gets put together - the next step up.

thanks for any suggestions!

ASP.Net Caching problem ??


I'm having a problem with an asp.net 3.0 application using a gridview to display data.  The problem seems to be that despite a brand new .selectCommand being sent to the sqlDataSource, the gridview starts displaying data from *someone else's* query.  For example, user A is logged in and will be working fine until a few page submissions later when the gridview data starts suddenly showing information that belongs to another user. 

This is my first asp.net application, though I've been working with classic asp and ADO for years so I'm used to sending a SQL string and getting back the results from that string.  Apparently there is a complex caching system which is interferring which I do not at all understand so at this point I just want to stop the server from caching any data whatsoever.  Is this possible?

Any and all help will be much appreciated!!

is the page caching?


I am just trying to understand the basics flow to the MVC framework by putting in some breakpoints in the beginning of the actions of a couple of controllers.

One break point is at the HomeController/Index action where it just returns View() of the "Welcome to MVC".  The Second break point is at a SecondController/Index action where it uses the Entity Framework and returns a View() of a list from the db.

When I run this in debug, it breaks at the points I expected when I go from Home page to the Second page controller and back to Home.  However, when I go to the Second page again, it doesn't break at all?  Is the results of the Second page being cached and how and where?  How do you trigger for it to get check if data is old?

I check to see if the persistence is done on the db, by changing the value of a field on the db side and it still did not cause it to break on that action and displays old information in the view.  I am concerned because it is displaying incorrect values on the UI.  I do not have the OutputCache attribute above this action or specified any cache on my web.config.

Thanks in advance for your time :)

Data caching c#.net


Hi Friends,


I have a large SQL Database in the server from which I can create a dataset of about 10000 rows. My question is about caching this data. Which type of data caching should I choose (Server side or Client side)? Which one will provide better performance?


Thanks in advance

NUnit and public static readonly


I have an app that I am testing with NUNit.  The project im testing has several helper classes that are created as public static readonly.  When I run the NUnit tests, they all fail with the same error

SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.
  ----> System.NullReferenceException : Object reference not set to an instance of an object.
SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.
  ----> System.NullReferenceException : Object reference not set to an instance of an object.

I kept getting this error despite stripping out all

SOA Tips: Address Scalability Bottlenecks with Distributed Caching


SOA makes application scalability easier, but getting the best performance out of your SOA means paying close attention to the details. We'll give you some tips for coding your app more effectively and using distributed caching to remove data access bottlenecks.

Iqbal Khan

MSDN Magazine June 2010

Toolbox: Distributed Caching, Object-Object Mapping, Blogs and More


This column covers Web application performance with distributed caching, a utility for object-object mapping, and a look at interesting blogs.

Scott Mitchell

MSDN Magazine September 2009

Scale Out: Distributed Caching On The Path To Scalability


Developers frequently face issues related to scalability bottlenecks when they have applications that need to handle a lot of load. This article describes the role of a distributed cache in building scalable applications.

Iqbal Khan

MSDN Magazine July 2009

Toolbox: Static Analysis Database Tools, Managing Remote Computers, And More


If you want to apply static analysis to your databases, connect to remote computers, find out more about the Entity Framework, or just check into some cool podcasts for your daily commute, then you'll want to read more about these latest tools and resources.

Scott Mitchell

MSDN Magazine July 2009

Velocity: Build Better Data-Driven Apps With Distributed Caching


Microsoft Velocity exposes a unified, distributed memory cache for client application consumption. We show you how to add Velocity to your data-driven apps.

Aaron Dunnington

MSDN Magazine June 2009

Toolbox: Static Analysis Tools For .NET, Matt Berseth's Blog


This month we take a look at FxCop and other tools that enforce your design rules, along with jQuery.

Scott Mitchell

MSDN Magazine December 2008

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend