Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you prevent a base class property from rendering in a DataForm?
    primarykey
    data
    text
    <p>Please excuse this novice question, but I'm ramping up on Silverlight and MVVM Light. I created a view called MyView.xaml and a corresponding MyViewModel.cs. </p> <p><strong>MyView.xaml</strong></p> <pre><code>&lt;navigation:Page x:Class="Dashboard.Views.MyView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:Dashboard.ViewModels" xmlns:controls="clr-namespace:Dashboard.Controls" mc:Ignorable="d" xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" d:DesignWidth="640" d:DesignHeight="480" Title="MyView Page" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"&gt; &lt;navigation:Page.Resources&gt; &lt;vm:MyViewModel x:Key="MyViewModel" /&gt; &lt;/navigation:Page.Resources&gt; &lt;navigation:Page.DataContext&gt; &lt;Binding Source="{StaticResource MyViewModel}"/&gt; &lt;/navigation:Page.DataContext&gt; &lt;Grid x:Name="LayoutRoot"&gt; &lt;StackPanel Orientation="Vertical" Style="{StaticResource LoginControlsStackPanelStyle}" HorizontalAlignment="Center" VerticalAlignment="Center"&gt; &lt;toolkit:DataForm Name="dataForm1" CurrentItem="{Binding}"/&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; </code></pre> <p></p> <p><strong>MyViewModel.cs</strong></p> <pre><code>namespace Dashboard.ViewModels { public class MyViewModel : ViewModelBase { public string FirstName { get; set; } public string LastName { get; set; } } } </code></pre> <p>When I run the project, my form renders the IsInDesignMode property. I obviously do not want this. How can I prevent the base class property from rendering in the dataform?</p> <p>Thanks.</p> <p>Andrew</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload