Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. XAML error message but it works. How can I fix it?

XAML error message but it works. How can I fix it?

Scheduled Pinned Locked Moved WCF and WF
visual-studiowpfhelpquestioncsharp
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wolfram Steinke
    wrote on last edited by
    #1

    I’m trying to load a combobox from an XML file. There isn’t however a direct 1:1 relation between the structure of the file and the list item. I therefore have the following code snippets. XAML

    <Window.Resources>
        <ObjectDataProvider MethodName="GetConnectionAccountNames"
                            ObjectType="{x:Type gui:ConnectionAccountHelper}"
                            x:Key="connectionAccount">
        <!--
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="Format" />
            </ObjectDataProvider.MethodParameters>
        -->
        </ObjectDataProvider>
    </Window.Resources>
    

    The combobox (which actually sits in an Infragistics Ribbon Control)

    <igRibbon:ComboEditorTool
    Id="ktsConnections"
    x:Name="connectionsCombo"
    DropDownResizeMode="VerticalOnly"
    IsEditable="False"
    EditAreaWidth="150.0"
    ItemsSource="{Binding Source={StaticResource connectionAccount}}">
    </igRibbon:ComboEditorTool>

    The work is of course done in the method in the helper class

        public static IEnumerable<string> GetConnectionAccountNames()
        {
            Dictionary<string, ConnectionAccount> accounts = HelperItems.GetSavedConnectionAccounts();
            foreach (ConnectionAccount a in accounts.Values)
            {
                yield return a.Uri + ":" + a.PortDebug;
            }
        }
    

    As far it goes it does actually build and work and give me the result I want. Only one thing I can’t explain. The designer will no longer display the window because it detects the following error on the ItemsSource="{Binding line. Could not find a part of the path 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Resources\ConnectionAccounts.xml'. The last part of the path is actually the path relative to the EXE’s location, where for the XML file. I’m at a loss as to how to get rid of that error. Does anyone have an idea? It makes no sense to me. Thanks in advance.

    Happy programming!!

    N 1 Reply Last reply
    0
    • W Wolfram Steinke

      I’m trying to load a combobox from an XML file. There isn’t however a direct 1:1 relation between the structure of the file and the list item. I therefore have the following code snippets. XAML

      <Window.Resources>
          <ObjectDataProvider MethodName="GetConnectionAccountNames"
                              ObjectType="{x:Type gui:ConnectionAccountHelper}"
                              x:Key="connectionAccount">
          <!--
              <ObjectDataProvider.MethodParameters>
                  <x:Type TypeName="Format" />
              </ObjectDataProvider.MethodParameters>
          -->
          </ObjectDataProvider>
      </Window.Resources>
      

      The combobox (which actually sits in an Infragistics Ribbon Control)

      <igRibbon:ComboEditorTool
      Id="ktsConnections"
      x:Name="connectionsCombo"
      DropDownResizeMode="VerticalOnly"
      IsEditable="False"
      EditAreaWidth="150.0"
      ItemsSource="{Binding Source={StaticResource connectionAccount}}">
      </igRibbon:ComboEditorTool>

      The work is of course done in the method in the helper class

          public static IEnumerable<string> GetConnectionAccountNames()
          {
              Dictionary<string, ConnectionAccount> accounts = HelperItems.GetSavedConnectionAccounts();
              foreach (ConnectionAccount a in accounts.Values)
              {
                  yield return a.Uri + ":" + a.PortDebug;
              }
          }
      

      As far it goes it does actually build and work and give me the result I want. Only one thing I can’t explain. The designer will no longer display the window because it detects the following error on the ItemsSource="{Binding line. Could not find a part of the path 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Resources\ConnectionAccounts.xml'. The last part of the path is actually the path relative to the EXE’s location, where for the XML file. I’m at a loss as to how to get rid of that error. Does anyone have an idea? It makes no sense to me. Thanks in advance.

      Happy programming!!

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Yes, I've encountered this also. Seems as though the designer doesn't recognize the ObjectDataProvider node.


      I know the language. I've read a book. - _Madmatt

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups