标签:path image html col data sed ima ble onclick
原文:WPF 隐藏式控件
没用Popup用的面板控件,全部代码使用xaml的触发器。
代码:
<Grid> <DockPanel> <StackPanel Background="Red" Height="40" DockPanel.Dock="Top"> <Button x:Name="ShowPanelBtn" Height="40" Width="40" HorizontalAlignment="Right"> <Button.Style> <Style TargetType="Button"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="Content" Value="∨"/> </Trigger> <Trigger Property="IsMouseOver" Value="false"> <Setter Property="Content" Value="∧"/> </Trigger> </Style.Triggers> </Style> </Button.Style> </Button> </StackPanel> <Grid Background="Green" x:Name="DownPanel" Height="40" VerticalAlignment="Top"> <Grid.Style> <Style TargetType="Grid"> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=ShowPanelBtn,Path=IsMouseOver}" Value="true"> <Setter Property="Visibility" Value="Visible"/> </DataTrigger> <DataTrigger Binding="{Binding ElementName=ShowPanelBtn,Path=IsMouseOver}" Value="false"> <Setter Property="Visibility" Value="Collapsed"/> </DataTrigger> </Style.Triggers> </Style> </Grid.Style> </Grid> </DockPanel> </Grid>
标签:path image html col data sed ima ble onclick
原文地址:https://www.cnblogs.com/lonelyxmas/p/12833943.html