forked from CommunityToolkit/WindowsCommunityToolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathControlSizeTrigger.bind
More file actions
43 lines (41 loc) · 1.69 KB
/
Copy pathControlSizeTrigger.bind
File metadata and controls
43 lines (41 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<Page
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:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
<triggers:ControlSizeTrigger
TargetElement="{Binding ElementName=ParentGrid}"
MinWidth="400"
MaxWidth="500"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="ResizingText.FontSize" Value="20"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<StackPanel VerticalAlignment="Center" Width="500">
<Grid
x:Name="ParentGrid"
Width="{Binding Value, ElementName=Slider, Mode=OneWay}"
Height="50"
Background="Blue"/>
<TextBlock
x:Name="ResizingText"
FontSize="12"
Text="Windows Community Toolkit"
HorizontalAlignment="Center"/>
<Slider
x:Name="Slider"
Minimum="0"
Maximum="500" />
</StackPanel>
</Grid>
</Page>