Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6835643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:15:24+00:00 2026-05-26T23:15:24+00:00

I tried to run this example but I got binding problem. Designer highlights the

  • 0

I tried to run this example but I got binding problem.

Designer highlights the error The resource "monthCollection" could not be resolved

How can I use Utility.MonthCollection as local resource?

XAML part:

<Window x:Class="FaceReport.WindowMain"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Title="Rapor" Height="402" Width="600" WindowState="Normal">
<Grid Name="gridMain" x:Uid="uidGridMain">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <ComboBox SelectedIndex="0" 
              DisplayMemberPath="Value" SelectedValuePath="Key" Margin="132,9,200,0"
              Grid.Row="3" Height="24" VerticalAlignment="Top" Name="cbBind" 

              ItemsSource="{Binding Source={StaticResource Utility.ReportForCollection},
                Path=Utility.ReportForCollection}"                   
              />
 </Grid>
 </Window>

C# part:

namespace FaceReport
{
internal class Utility
{
    public enum ReportFor
    {
        Choose,
        All,
        Group,
        Person
    }

    private static Dictionary<ReportFor, string> _dictReportFor;
    public static Dictionary<ReportFor, string> ReportForCollection
    {
        get
        {
            return _dictReportFor;
        }
    }

    static Utility()
    {
        //initialize the collection with user friendly strings for each enum
        _dictReportFor = new Dictionary<ReportFor, string>(){
            {ReportFor.Choose, "Lütfen seçiniz..."},        
            {ReportFor.All, "Herkes"},
            {ReportFor.Group, "Grup"},
            {ReportFor.Person, "Şahıs"}};
    }
}

/// <summary>
/// Application's main form
/// </summary>
public partial class WindowMain : Window
{
    /// <summary>
    /// Constructor
    /// </summary>
    public WindowMain()
    {
        InitializeComponent();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:15:25+00:00Added an answer on May 26, 2026 at 11:15 pm

    You’re missing this bit:

    ->this Utility class can be instantiated as a resource<- and then
    referenced in the ComboBox creation.

    It’ll look something like this:

    <Application.Resources>
        <local:Utility x:Key="monthCollection"/>
    </Application.Resources>
    

    This bit:{Binding Source={StaticResource monthCollection}, Path=MonthCollection
    says to find the static resource monthCollection and on it use the property MonthCollection so you first must instantiate the object which has `MonthCollection as a property and then reference that static resource.

    You will probably also need a statement something like this added to the top of your file:

    xmlns:local="clr-namespace:YourNamespaceHere"
    

    Untested code below:

    <Window x:Class="FaceReport.WindowMain"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:FaceReport"
    
     Title="Rapor" Height="402" Width="600" WindowState="Normal">
    
    <Application.Resources>
        <local:Utility x:Key="reportCollection"/>
    </Application.Resources>
    
     <Grid Name="gridMain" x:Uid="uidGridMain">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <ComboBox SelectedIndex="0" DisplayMemberPath="Value" SelectedValuePath="Key"  Margin="132,9,200,0" Grid.Row="3" Height="24" VerticalAlignment="Top" Name="cbBind" 
         ItemsSource="{Binding Source={StaticResource reportCollection}, Path=ReportForCollection}" />
     </Grid>
    </Window>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to run example from HornetQ and I got this error: [java] HornetQServer_0
When I run this code the selected item is not visible. I've already tried
Error I tried this page to run on local, it is running perfectly fine
I'm trying to run a GLSL example , but I can't. The error is
How do I run this command with subprocess? I tried: proc = subprocess.Popen( '''ECHO
I have tryed to run this code in my console: script/plugin install git://github.com/apotonick/cells.git ...but
I tried to run 2 JQuery-ajax at the same time, but it's seem always
I received the following error when I tried to run a C# WinForms application
Got a little problem i asked about it before but maybe i didnt ask
This is a homework question, I got the basics down, but I can't seem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.