在ViewModel上,如果要求其值,则“ OperationStepInstance”的属性将命令一个巨大的过程。 我的问题是,如果在XAML中该元素被隐藏或折叠,是否可以不要求其值。
默认情况下,即使它是折叠的,也总是要求Dependency属性提供其值。
<Grid Grid.Row="3" HorizontalAlignment="Center" Visibility="{Binding Path=StatusInstance.IsProductive, Converter={StaticResource BoolToVis}}" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Path=ProductionOrderInstance.Key}" Grid.Column="0" Style="{StaticResource ItemTextStyle}" />
<TextBlock Text="-" Grid.Column="1" Style="{StaticResource ItemTextStyle}" Margin="4,0,4,0" />
<TextBlock Text="{Binding Path=ProductionOrderInstance.OperationStepInstance.Number}" Grid.Column="2" Style="{StaticResource ItemTextStyle}" />
<TextBlock Text="/" Grid.Column="3" Style="{StaticResource ItemTextStyle}" Margin="4,0,0,0" />
<TextBlock Text="{Binding Path=StatusInstance.Key}" Grid.Column="4" Style="{StaticResource ItemTextStyle}" Margin="4,0,4,0" />
<TextBlock Text="" Grid.Column="5" Style="{StaticResource ItemTextStyle}" Margin="0,0,0,0" />
</Grid>