DataContextAware ViewModels

Jun 15, 2010 at 1:42 PM

hi, when i open your sample DataContextAware ViewModels project in blend4rc or vs2010, i never see any designtime data.

i got the same result in my testproject.

[ExportViewModel("AppsVM", true)]
    public sealed class AppsVM : NotifyPropertyChangedBase, IDesignTimeAware
    {
        public string DisplayName { get; private set; }
        
        public AppsVM()
        {
            this.DisplayName = "APPS "+ this.GetHashCode().ToString();
        }

        #region Implementation of IDesignTimeAware

        public void DesignTimeInitialization()
        {
            this.DisplayName = "APPS Design " + this.GetHashCode().ToString();
            OnPropertyChanged(() => this.DisplayName);
        }

        #endregion
    }
<UserControl x:Class="TestNaviAndMef.View.Apps"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mefed="clr-namespace:MEFedMVVM.ViewModelLocator;assembly=MEFedMVVM.WPF" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             mefed:ViewModelLocator.ViewModel="AppsVM">
    <Grid>
         <TextBlock Text="{Binding Path=DisplayName}" />
    </Grid>
</UserControl>

do i miss something?

Coordinator
Jun 16, 2010 at 9:05 AM
can you send me a sample project since I am getting the DesignTime Data for that...

Regards
Marlon
WPF Blog - http://marlongrech.wordpress.com/
Microsoft MVP for Client App



On Tue, Jun 15, 2010 at 1:42 PM, blindmeis <notifications@codeplex.com> wrote:

From: blindmeis

hi, when i open your sample DataContextAware ViewModels project in blend4rc or vs2010, i never see any designtime data.

i got the same result in my testproject.

[ExportViewModel("AppsVM", true)]
    public sealed class AppsVM : NotifyPropertyChangedBase, IDesignTimeAware
    {
        public string DisplayName { get; private set; }
        
        public AppsVM()
        {
            this.DisplayName = "APPS "+ this.GetHashCode().ToString();
        }

        #region Implementation of IDesignTimeAware

        public void DesignTimeInitialization()
        {
            this.DisplayName = "APPS Design " + this.GetHashCode().ToString();
            OnPropertyChanged(() => this.DisplayName);
        }

        #endregion
    }
<UserControl x:Class="TestNaviAndMef.View.Apps"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mefed="clr-namespace:MEFedMVVM.ViewModelLocator;assembly=MEFedMVVM.WPF" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             mefed:ViewModelLocator.ViewModel="AppsVM">
    <Grid>
         <TextBlock Text="{Binding Path=DisplayName}" />
    </Grid>
</UserControl>

do i miss something?

Read the full discussion online.

To add a post to this discussion, reply to this email (MEFedMVVM@discussions.codeplex.com)

To start a new discussion for this project, email MEFedMVVM@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Jun 16, 2010 at 10:25 AM

i have to correct my self... i can see designtime data in blend rc4 but not in vs2010 ultimate -DEU.

i think i have to use blend more often^^ still writing xaml by hand in vs2010...

Coordinator
Jun 16, 2010 at 12:10 PM
:)

yep MEFedMVVM does not support Design Time Data in VS only in Blend I am afraid

Regards
Marlon
WPF Blog - http://marlongrech.wordpress.com/
Microsoft MVP for Client App



On Wed, Jun 16, 2010 at 10:25 AM, blindmeis <notifications@codeplex.com> wrote:

From: blindmeis

i have to correct my self... i can see designtime data in blend rc4 but not in vs2010 ultimate -DEU.

i think i have to use blend more often^^ still writing xaml by hand in vs2010...

Read the full discussion online.

To add a post to this discussion, reply to this email (MEFedMVVM@discussions.codeplex.com)

To start a new discussion for this project, email MEFedMVVM@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com