.NET Framework Developer Center > .NET Development Forums > Windows Presentation Foundation (WPF) > Where is the documentatio for MC3029 compler error?
Ask a questionAsk a question
 

AnswerWhere is the documentatio for MC3029 compler error?

  • Wednesday, November 04, 2009 10:49 PMO.Z. Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,

       I was playing with data binding when I've received this warning

    error MC3029: <The type of my application class> member is not valid because it does not have a qualifying type name.

       I surmise this is because System.Windows.Application class is declared partial, but I couldn't find _any_ documentation on this particular compiler error. At the time of this writing the search http://msdn.microsoft.com/en-us/library/default.aspx?q=MC3029 yields no results. I would appreciate knowing more about what this error actually means and it would be good to see this info in MSDN.

     


    WBR O.Z.

Answers

  • Monday, November 16, 2009 8:49 AMJim Zhou - MSFTModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi O.Z.,
    --><Button Height="{Binding Source={x:Static WpfApp:App}, Path=Current.ButtonHeight}" Margin="64,29,139,0" Name="button1" VerticalAlignment="Top">Button</Button>

    I recommend that you create another class and expose a static property to hold the value, and then you can just use the syntax something likk below:

    Code snippet:
    <YourElement property="{x:Static local:CustomClass.staticProperty}" />

    Thanks.
    Sincerely.

    Jim Zhou -MSFT
    • Marked As Answer byO.Z. Monday, November 16, 2009 10:42 AM
    •  

All Replies

  • Friday, November 06, 2009 7:08 PMMoby Disk Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I just received this error and I couldn't find it on MSDN.  This forum post is all I could find.
  • Tuesday, November 10, 2009 11:20 AMJim Zhou - MSFTModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi O.Z.,
    What is the detailed code in your scenario? can you provide some sample?For your information, here is an analogous post about MC3029 error.
    http://stackoverflow.com/questions/1420034/my-resources-in-wpf-xaml

    Thanks.
    Sincerely.
    Jim Zhou -MSFT
  • Wednesday, November 11, 2009 7:31 PMO.Z. Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Here you go, Jim.

    The Window, MC3029 happens when compiling it

    <Window x:Class="WpfApplication1.Window2"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:WpfApp="clr-namespace:WpfApplication1"
        Title="Window2" Height="300" Width="300">
        <Grid>
            <Button Height="{Binding Source={x:Static WpfApp:App}, Path=Current.ButtonHeight}" Margin="64,29,139,0" Name="button1" VerticalAlignment="Top">Button</Button>
        </Grid>
    </Window>
    

    The application's XAML

    <Application x:Class="WpfApplication1.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        StartupUri="Window2.xaml">
        <Application.Resources>
             
        </Application.Resources>
    </Application>
    
    

    And the application's XAML.CS

    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Windows;
    
    namespace WpfApplication1
    {
      /// <summary>
      /// Interaction logic for App.xaml
      /// </summary>
      public partial class App : Application
      {
        double ButtonHeight = 10;
        new App Current
        {
          get
          {
            return (App)Application.Current;
          }
        }
      }
    }
    
    


    WBR O.Z.
    • Edited byO.Z. Wednesday, November 11, 2009 7:31 PMBetter formatting
    •  
  • Monday, November 16, 2009 8:49 AMJim Zhou - MSFTModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi O.Z.,
    --><Button Height="{Binding Source={x:Static WpfApp:App}, Path=Current.ButtonHeight}" Margin="64,29,139,0" Name="button1" VerticalAlignment="Top">Button</Button>

    I recommend that you create another class and expose a static property to hold the value, and then you can just use the syntax something likk below:

    Code snippet:
    <YourElement property="{x:Static local:CustomClass.staticProperty}" />

    Thanks.
    Sincerely.

    Jim Zhou -MSFT
    • Marked As Answer byO.Z. Monday, November 16, 2009 10:42 AM
    •  
  • Monday, November 16, 2009 10:42 AMO.Z. Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    So I did, thanks. Hopefully this thread will partially compensate the lack of documentation on the compiler error.
    WBR O.Z.