|
Hi,
When writing a MVVM WPF app, there's always a point where the view model has to be set to as the data context of the view. For me, usually that's in code. But I realized that if I declare the view model as a static resource inside the xaml and set...
Started by Steve the Plant on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
DataContext="{x:Static Services:ViewModelLocator.MainWindowViewModel}" >.
Locator pattern:
public static class ViewModelLocator { public static MainWindowViewModel:
<Window ...
|
|
I have a product image class. This is an object with re-use potential for general work with images (e.g. for a product, for a CMS when working with images, etc). It will let me set the title of the file, and edit the image in simple ways using standard...
Started by dotnetdev on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
And particularly a "product" struct sounds like it's almost certainly the wrong choice) and a static.
|
|
I am going to create a web server control representing a treeview. So I want to use 2 images for + and - for expand/collapse. How can I build this into the control in a way that can be used as image source when rendered on the page?
Since this will be...
Started by awe on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Then change their build action in the property grid from content to embeded resource.
It will be compiled control project.
Your image -> Properties -> Build Action -> Embedded Resource.
|
Ask your Facebook Friends
|
When ever the web page is loaded i am getting warning in the debugger as
Resource interpreted as stylesheet but transferred with MIME type text/plain.
I am getting the above warning when the browser requests for js, css, gif and png files.
Any idea how...
Started by Niger on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
This error, a valid Content-Type header is returned with the correct mime-type for the resource.
|
|
Hi folks,
changing a static resource during runtine is something that sounds not possible.
I have a TextBox which displays a simple number. Then I have defined a style, which changes the Template of the TextBox to become a round TextBox:
<Style x:Key...
Answer Snippets (Read the full thread at stackoverflow):
So you could ....
A purist might say you shouldn't include data like the numbers (which must mean something in your application context) in a Style .
The Style is just the look of the control, so in practice you'll need to re-use this style multiple times .
|
|
We're looking at removing all of the static resources (mainly images) in our ASP.NET 2.0 web app, and moving them to their own separate server. The main design requirements are for speed (so caching will be important) and a minimal level of security (...
Started by jacko on
, 4 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Threading in servers and can be made very ....
It was specifically designed for serving high-volume static content - guess which industry.
The king of the hill for high-speed static web serving is asynchronous I/O, at least the last time.
|
|
I have been looking into optimizing a website and specifically looking into CSS sprites, and serving static resources from a subdomain ( static.mysite.com ). Reference: Split Components Across Domains
We are using cassini (which comes with visual studio...
Started by Ram on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
I've generally found Yahoo's perf advice static content during ....
Just not going to happen.
Up the absolute URL for each static resource using a variable from your masterpage (or config/contents/static and static.mysite.com.
|
|
Hi folks,
I have next situation: I need to create widget in standalone static library, which then will be linked with final application (visual c++ 9.0, qt 4.5). This static widget library contains some resources (icons), and consist of a several .cpp...
Started by vnm on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Let me quote from the qt manual: "Note an example how to do it right, if this... .
Initialize() { static Q_INIT_RESOURCE(qtwidgets_custom_resources); } StaticLibInitializerThe Q_INIT_RESOURCE macro can't be used in a namespace.
|
|
How does C#, or other languages for that matter, handle memory allocation (and memory de-allocation) between these two scenarios:
1.) A method on a static class is invoked.
public Program { Foo foo = Loader.load(); } public static Loader { public static...
Started by jtb on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
You ....
A static method, field, property, or event is callable on a class even when no instance your static methods behaves just as it would if you used it from within a class instance: it is scoped performance (memory saving) to gain here.
|
|
Hi, does anyone know of a platform independent resource system for C++ like the one that comes with QT (but without the Qt dependency)? I would like to access arbitrary data from withhin my C++ source code. I.e. not only icons but also translations or...
Answer Snippets (Read the full thread at stackoverflow):
The encoding....
The app that encodes the 'resource' files executes as a pre-build step.
I then #include those headers where I need access to the data .
JS, PNGs, etc.) and created C++ headers containing the data encoded as static const char* .
|