Skip to content

Commit c93bed7

Browse files
committed
Restore
1 parent 73264d6 commit c93bed7

File tree

1 file changed

+30
-17
lines changed

1 file changed

+30
-17
lines changed

samples/BehaviorsTestApplication/Views/Pages/DataTriggerBehaviorView.axaml

+30-17
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,39 @@
99
<Design.DataContext>
1010
<vm:MainWindowViewModel />
1111
</Design.DataContext>
12-
<Grid RowDefinitions="Auto,*">
13-
<TextBox Grid.Row="0" Text="{Binding MyString}" />
14-
<Border Grid.Row="1" Background="Black" CornerRadius="5">
12+
<Grid RowDefinitions="*,Auto">
13+
<Rectangle Name="DataTriggerRectangle"
14+
Grid.Row="0" Margin="5"
15+
Fill="{DynamicResource BlueBrush}"
16+
Stroke="{DynamicResource GrayBrush}"
17+
StrokeThickness="5">
1518
<Interaction.Behaviors>
16-
<DataTriggerBehavior Binding="{Binding MyString}" ComparisonCondition="Equal" Value="">
17-
<ChangePropertyAction PropertyName="IsVisible" Value="False" />
19+
<DataTriggerBehavior Binding="{Binding #Slider.Value}"
20+
ComparisonCondition="GreaterThan"
21+
Value="50">
22+
<ChangePropertyAction TargetObject="DataTriggerRectangle"
23+
PropertyName="Fill"
24+
Value="{DynamicResource YellowBrush}" />
1825
</DataTriggerBehavior>
19-
<DataTriggerBehavior Binding="{Binding MyString}" ComparisonCondition="NotEqual" Value="">
20-
<ChangePropertyAction PropertyName="IsVisible" Value="True" />
26+
<DataTriggerBehavior Binding="{Binding #Slider.Value}"
27+
ComparisonCondition="LessThanOrEqual"
28+
Value="50">
29+
<ChangePropertyAction TargetObject="DataTriggerRectangle"
30+
PropertyName="Fill"
31+
Value="{DynamicResource BlueBrush}" />
2132
</DataTriggerBehavior>
2233
</Interaction.Behaviors>
23-
<StackPanel>
24-
<TextBlock FontSize="25" Foreground="White">
25-
<Interaction.Behaviors>
26-
<DataTriggerBehavior Binding="{Binding MyString}" ComparisonCondition="NotEqual" Value="">
27-
<ChangePropertyAction PropertyName="Text" Value="{Binding MyString}" />
28-
</DataTriggerBehavior>
29-
</Interaction.Behaviors>
30-
</TextBlock>
31-
</StackPanel>
32-
</Border>
34+
</Rectangle>
35+
<StackPanel Grid.Row="1"
36+
Margin="5,0,5,5"
37+
Orientation="Horizontal"
38+
HorizontalAlignment="Center"
39+
VerticalAlignment="Center">
40+
<TextBlock Text="{Binding #Slider.Value}"
41+
VerticalAlignment="Center"
42+
Width="50"
43+
Foreground="{DynamicResource GrayBrush}" />
44+
<Slider Name="Slider" Width="400" IsSnapToTickEnabled="True" TickFrequency="1" />
45+
</StackPanel>
3346
</Grid>
3447
</UserControl>

0 commit comments

Comments
 (0)