Search code examples
winrt-xamlwin-universal-apptemplate10

Using DesignTime data with Template10


I would like to show design time data in Blend. I am using Template10 (from Hamburger base project) and I can't see design time data.

From this base project, I would like some help to display the design time data for the variable named "Value".

Thanks!

Samuel


Solution

  • Designtime data is accomplished, typically, by loading view-model properties with sample data in the constructor of the view-model. If you are using the T10 project template, then there is already a placeholder where you can add this.

    public MainPageViewModel()
    {
        if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
        {
            Value = "Designtime value";
        }
    }
    

    Best of luck.