Я хочу, чтобы ViewModel не создавался во время разработки.
Итак, заголовок выглядит следующим образом:
<UserControl x:Class="app.reports.sta"
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:vm="clr-namespace:viewmod.reports.sta;assembly=viewmodAss"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
mc:Ignorable="d"
d:DesignHeight="1000" d:DesignWidth="1200"
d:DataContext="{d:DesignInstance Type=vm:staViewModel, IsDesignTimeCreatable=False}"
Language="de-DE">
DataContext устанавливается так, как показано ниже:
<UserControl.DataContext>
<vm:staViewModel/>
</UserControl.DataContext>
<!--With this part active, the designer throws an error from the viewmodel constructor -->
<!--Without this part, the designer works, but when the app is run, not data is displayed (which is quite obivous) -->
Как мне установить DataContext
так, чтобы ViewModel не будет создан в DesignTime?