.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

Can't find resource dictionary

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :WPF

I'm using VS2010, .net 4, in a pure WPF app. I'm using the code here to customize an expander control


I've put the code in a separate xaml file (/Styles/ScreenStyles.xaml) and included it via my app.xaml file using a merged dictionary

<Application x:Class="WpfApplication1.App"

View Complete Post

More Related Resource Links

Why can't I load an an external resource dictionary that contains type converters?

Basically what I'm doing is putting a bunch of type converters as resources in a ResourceDictionary contained in an externally referenced assembly. Let's call the assembly WpfCommon. I'm directly referencing the assembly from my main application. In the App.xaml:       <Application.Resources>         <ResourceDictionary>             <ResourceDictionary.MergedDictionaries>                 <ResourceDictionary Source="pack://application:,,,/Common.Wpf;component/Wpf/ResourceDictionaries/Converters/Converters.xaml"/>             </ResourceDictionary.MergedDictionaries>         </ResourceDictionary>     </Application.Resources>   Converters.xaml:   <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:Common_Wpf_Converters="clr-namespace:Common.Wpf.Converters">     <ResourceDictionary>         <Common_Wpf_Convert

What is the recommended format for vector icons in resource dictionary?

It seems that Expression Design wants to export vector graphics in resource dictionary format as DrawingBrushes.  These are a bit of a pain to use in something like a MenuItem.Icon.  So I have been converting the DrawingBrushes to DrawingImages.  The only downside I've run into so far is that I can't figure out how to force the DrawingImage to be a certain size say 20x20 where the content may not take up that whole size.  The issue is that when you put these vector icons on a toolbar and you want the images to align, it is tricky when each icon is a slightly different height.

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?

cannot find resource login.aspx

I have set up users with the membership provider and thus have a database in my vwd2008 app named aspnetdb.mdf.  I added another "database2" to the app.  I set up a form to login called Default.aspx.  Once logged In the user is taken to Default2.aspx.  On Default2, I have a GridView connected to database2.  What I am doing is trying to view Default2 without logging in and prompt a response.  Instead I get the error 404 that login.aspx cannot be found.  HOw do I correct this? On Default2 Page Load......If Not Page.IsPostBack Then Response.Write("Gotcha") End If Does this have anything to do with me using two databases in the same web app ?

Unable to find static resource in runtime even while designer can see it

So i have:    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Werp.MigrationHelper"> <Style TargetType="{x:Type UserControl}" x:Key="WizardPageControl" x:Name="WizardPageControl"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type UserControl}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="10" /> <ColumnDefinition Width="475" /> <ColumnDefinition Width="10" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="10" /> <RowDefinition Height="410"/> <RowDefinition Height="50" /> <RowDefinition Height="10" /> </Grid.RowDefinitions> <StackPanel Orientation="Vertical" Name="MainContent" Grid.Row="1" Grid.Column="1"> <ContentPresenter Content="{TemplateBinding Content}"/> </StackPanel> <StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center&qu

Wpf - User control or dictionary resource



i am beginner in programming WPF - and sorry for my English :).

I am trying lern to use namespace and class in WPF.

I have to question :

1) In the DictionaryResource I can create ContextMenu and later assign this ConterxtMenu to TextBox ( using StaticResource ).

The same I can achieve when I using UserControl ( I create ContextMenu as UserControl and assign to TextBox ).

Do any of these ways is preferred for certain applications such as DictionaryResource apply rather to give the appearance rather than creating the whole ContextMenu?

Are there other ways to share the code?

2) I created such a ContextMenu in ResourceDIctionary (in a separate file.) It has two entries such as "Show", "Close." Signed it to a TextBox in my main window.

And now how to call the (assigned) ContextMenu event to "Show" to change the text in the TextBox?

Xaml cannot find StaticResource even sure the resource is defined



I'm having trouble using static resources for color schemes in my user interface library. I have my Generic.xaml file, where I "include" all the other resource dictionary files:

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">


  <ResourceDictionary Source="/Moonlite.Platform.Shell.UI;component/Themes/ColorSchemes/Default.xaml" />


Include Button Click Event in WPF Resource dictionary's CodeBehind file

I have 3 buttons as a part of menu in my MainWindow.xaml file.  
On click of these I have a Common Grid that gets populated with the
 data from my database. Now for these i have set various Control
 templates with 3 different keys for my 3 different options.

Coming to my main point. When I include Click events under my
 Gridview and compile, it doesn't let me to do so cause of error.
 And to overcome this i made use of a Code behind C# Class file for
 my resourcedictionary (styles.xaml) that is styles.xaml.cs.
I got this from http://stackoverflow.com/questions/92100/is-it-possible-to- set-code-behind-a-resource-dictionary-in-wpf-for-event-handling

But As soon as i follow all procedure mentioned at above link it
says me ... Error Message: 'X' does not contain a definition for 'show'
 and no extension method 'show' accepting a first argument of
type 'X' could be found (are you missing a using directive or an

Find a value in Dictionary (value = class)


How do I find a value in Dictionaly. In my case value is a class object.


Cannot access Application Level Resource if it's the only resource in the dictionary


I've declared  two resources in App.xaml as shown:

    <sys:String x:Key="Foo">Foofoofoofoo</sys:String>
    <sys:String x:Key="Bar">BarBarBar</sys:String

How to find Resource Deadlock on the database / server?


How to find Resource Deadlock on the database / server?please help me...



i am using sql server 2008 and my jobs fail due to deadlock so i want to capture the root cause.please help me

Where can I Find Free PHP Resource?


  I have seen a lot of people asking for sites that can free download PHP script .I have the same problem

Thanks for your help!

iPad converterformac|| ipdfconverter

Resource Dictionary


I am trying to use a Resource dictionary globally, like i do not want to specify resource directory in each xaml page,

I tried to specify it in app.xaml, Resources like

                <ResourceDictionary x:Name="Something" Source="Themes\something.xaml" />

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.

find a Control inside a GridView using jQuery


I have databound GridView in my page and I have a hidden DIV in all rows. Each row contains a Button that I want it to make the DIV visible for me! how can I use that with jQuery?!

here is the code page: 

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                EnableModelValidation="True" GridLines="None" ShowHeader="False" Width="100%">

Printing resource files



I have some resource files for localization and would like to print them. When I try to print them in Visual Studio (with File -> Print...) the button is disabled. Does anyone know how to print them? (Without copying each into word or excel)

Thanks and regards,

Is there any way to find out the reason for session expiry?


Dear All,

is there any way to find out the reason for session expiry?



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