Are visual effects of runtime Expression Blend possible?

I am trying to create several UserControl classes in Blend 3. I want parts of them to be “collapsed” during creation at runtime, but I want to be able to edit my components without having to paste the code every time I want to build.

It works with sample data sources, as shown in the following example. But it doesn't seem to work with other properties ... or am I doing something wrong?

With the sample data source SDS_AIVertexAction, we can do this in Expression Blend:

<UserControl
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:local="clr-namespace:WpfApplication1"
mc:Ignorable="d"
...>


<Grid x:Name="LayoutRoot" 
    d:DataContext="{Binding Source={StaticResource SDS_AIVertexAction}}" >
    ...
</Grid>

But this is not possible:

 <Label Content="{Binding Name}" Visibility="Collapsed" d:Visibility="Visible" />

, " ", guff , . - , ?

+3
1

, .

d: , , . - d: , .

, StaticResource, ( - , ):

<UserControl.Resources>
  <Style x:Key="invisible" TargetType="Label">
    <Setter Property="Visibility" Value="Collapsed"/>
  </Style>
</UserControl.Resources>
<!-- ... -->
<Label Style="{StaticResource invisible}" d:Visibility="Visible" />
0

Source: https://habr.com/ru/post/1716683/


All Articles