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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Difference between ComponentResourceKey and a URI dictionary reference?

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :WPF
 
Hi, Sorry if that title doesn't make sense. I'm learning WPF and looking for a way to declare brush resources (eventually styles) in a single place and use them throughout the application which will have the UI in several different class libraries. I have a class library project named Common that all of the UI class libraries can reference. The book I'm using says that the ComponentResourceKey markup extension is designed for this purpose in which you have to create a Themes folder containing a file named generic.xaml. I've found that I can also just create a resource dictionary named anything in my Common project and then merge it with each Window's resouce dictionary using pack uri syntax: <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/Common;component/OasisBrushes.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> What is the difference between the two approaches? Why be forced to use a specific path and file name when you can do it the second way? Additionally, is there a way to reference the resource globally for the class library project so that I don't have to put it in each window/control? Can a class library have an App.xaml? Thanks!


View Complete Post


More Related Resource Links

What s the difference of Endpoint Reference and Message Information Header in WS Addressing?

  
What s the difference of Endpoint Reference and Message Information Header in WS Addressing? Thanks aheadFrank Xu Lei--????,???? ???.NET????????????????????? Focus on Distributed Applications Development and EAI based on .NET   ???????:http://www.frankxulei.com/ ???????:http://www.cnblogs.com/frank_xl/ ??WCF?????? ??WCF??????

difference between Add Reference and Add Services Reference in WCF

  

 

 

I have created a WCF Services called wcfProcess1 and hosted thru WcfSvcHost

I am consuming the wcfProcess1 in another windows program by calling by adding as Add Reference, DLL of the wcfProcess1 from Bin folder and not by adding as Add Services Reference.

Is this correct way to do?

By adding the DLL Reference as Add Reference i am still able to consume the wcfProcess1

What are the advantages and disadvantages of it?

 What is the difference between Add Reference and Add Services Reference in the client program when consuming the wcfProcess1?

  

Regards,

Thomas

 


What is the difference between Add Reference and Add Services Reference

  

I have created a WCF Services called wcfProcess1 and hosted thru WcfSvcHost I am consuming the wcfProcess1 in another windows program by calling by adding as Add Reference, DLL of the wcfProcess1 from Bin folder and not by adding as Add Services Reference. Is this correct way to do? By adding the DLL Reference as Add Reference i am still able to consume the wcfProcess1 What are the advantages and disadvantages of it? What is the difference between Add Reference and Add Services Reference in the client program when consuming the wcfProcess1?

Regards,

Thomas


A better way to reference your wizard steps using named steps

  
Note: this article uses the plain vanilla but the concepts apply equally well to its popular counterpart .

By far the most common way that I see wizard steps reference in code snippets is by their index.

Thinking about new C# method prototypes: object as dictionary

  
I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

What is the difference between "dynamic" and "object" keywords?

  
Let's take a quick look at the object keyword first. I'm not going to talk a lot about it because it's been around since C# 1.0. This keyword is nothing more than a shortcut for System.Object, which is the root type in the C# class hierarchy. (However, as Eric Lippert pointed out in his blog post, not everything in C# derives from object.) This is a powerful mechanism, since you can assign almost any value to instances of this type.

.net difference between versions

  

 what is the difference between .net 2.0/3.0/ 3.5


Difference Btw Website vs Web application and Virtual directory in IIS 7

  

May i know what is the Differenc that they actually make in IIS7 .

Please tell me at a low level as i am still a novice in Asp.Net

 

Thanks in Advance.

Balaji


reference from menubuttons to text parts in article on the same page

  

Hi, I'm searching now for hours but couldn't find it.Cry

In my menu i have several buttons which (by a <a href..) should go the a part of an article that is in the same form.

Menu button : What is a database should go to the page default.aspx and in there is an article published.
A part of this article is having a piece of text about "what is a database"

Menu button: how to make a query should go to this same article in the same page but then to the part that is have the piece about the query. The next could be an example of what i'm doing:

<ul>
    <li><a href="default.aspx ?????>what is a database</a></li>
    <li><a href="default.aspx ?????>what is a query</a></li>

Where my question marks are, there should be a connection to that particular piece of text.
In each article part there is an ID="text1" and the second part id="text2"

How shoudl i do that, Should i use a question mark.
Please give me some guidance how to structure the <li> statement or a pointer where I can read about it.

th

Reference HttpApplication from a separate HttpApplication

  

I want to create a website that can monitor the status of other websites running on the same server. Is this possible? How do I get a reference to a site's HttpApplication context from a separate HttpApplication?


Registering controls of current assembly object reference NOT set error

  

Hi There,

I have created a simple ASP.net Web Application (2.0) and have added a web user control.

Now in my page I have added this control but I have registered like this,

<%@ Register Assembly="WebApplication1" Namespace="WebApplication1" TagPrefix="Custom" %>

Which means I want to access all the controls in my current Web Application project

Then I have added my user control like this,

<Custom:MyUserControl ID="MyUserControl1" runat="server" PublicProperty="Hello" />

Every thing is fine but when I execute the project, NO control on my user control gets "instantiated" and thus I receive error "Object Reference Not Set"

Note that My Control has,

1) Public property PublicProperty as String

2) 1 Label control

In Load Event Handler I am setting Text property of Label Control to PublicProperty. Here object reference NOT set error occurs (which means Label control is NOT initialized).

I don't want to register my control using Src, TagPrefix etc. Any ideas?

Thanks


Difference between normal DLL & .net DLL

  

Hi All,


What is a difference between a regular DLL & .net DLL ?

Thanks in adavnce


Need function to find difference between two dates

  

Hi all


I need a function written in vb to find the exact month difference between two dates.


For example

    Start Date : 01/01/2010

    End Date   : 15/02/2010

 then the difference value should be like this 1.5  i.e i need the difference in decimal value.




difference between GetPostbackEventReference and GetCallbackEventReference

  

 

Hi All,

I was working with these two methods of ClientScriptManager class, but still not able to understand it properly.

Any one  have work on experience with these methods, want to know the difference between

GetPostbackEventReference and GetCallbackEventReference.

Friends, please dont post any urls. I also searching through different articles, but seened only definitions without any proper explained examples.


Page.FindControl Causing Null Reference Exception

  

Hi guys,

I developed a page in VWD 2008 and it works perfectly locally, but when I deployed it on the server every Page.FindControl() call is causing the NullReference Exception "Object reference not set to an instance of an object. " Can anyone help me out? Code is below

Cheers,

Mike Marshall

            For i As Integer = 1 To 10
                If (CType(Page.FindControl("last_" & i), TextBox).Text.Length > 0) Or (CType(Page.FindControl("first_" & i), TextBox).Text.Length > 0) Or (CType(Page.FindControl("dob_" & i), TextBox).Text.Length > 0) Then
                    Dim person_entry(7) As String
                    person_entry(0) = info_list.Count - 1
                    person_entry(1) = CType(Page.FindControl("last_" & i), TextBox).Text
                    person_entry(2) = CType(Page.FindControl("first_" & i), TextBox).Text
                    person_entry(3) = CType(Page.FindControl("dob_" & i), TextBox).Text
                    person_entry(4) = CType(Page.FindControl("appear_" & i), TextBox).Text
                    person_entry(5) = CType(Page.FindControl("mental_" & i), TextBox).Text
                    person_entry(6) = CType(Page.FindControl("behave_" & i), TextB

LINQ Sorting After Goup w/ Table Reference

  

Having a little trouble here.  I am taking a table (Articles) and grouping all the results by the key that references another table (ArticleSectionCategories).  I then want to sort these results by the OrderBy field of the referenced table (ArticleSectionCategory.OrderBy).  This is what I am using right now but it is not working.  Any thoughts?

 

                var GroupedArticles = from A in DC.Articles
                                     where A.PackagesId == packageId
                                     group A by A.ArticleSectionCategoriesId into G
                                     select G.OrderBy(C => C.ArticleSectionCategory.OrderBy);


 


Categories: 
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