tidy the codes
This commit is contained in:
1 parent
e02b420634
commit
97e8d0b8c3
33 files changed
+455
-1319
No files matched your search
@@ -23,7 +23,7 @@
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="data:CardModel">
|
||||
<DataTemplate>
|
||||
<hc:Gravatar Style="{StaticResource GravatarCircle}" Margin="10" Source="{Binding Content}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
|
||||
@@ -2,81 +2,48 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
Background="{DynamicResource RegionBrush}"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl">
|
||||
<controls:TransitioningContentControl>
|
||||
<UniformGrid>
|
||||
<controls:Poptip Background="{DynamicResource PrimaryBrush}" AllowsTransparency="True" StaysOpen="False" IsOpen="{Binding IsChecked, ElementName=toggleButton1}"
|
||||
PlacementEx="TopLeft" PlacementTarget="{Binding ElementName=toggleButton1}">
|
||||
<Border Background="AliceBlue">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="White" />
|
||||
</Border>
|
||||
</controls:Poptip>
|
||||
<controls:Poptip Background="{DynamicResource WarningBrush}" AllowsTransparency="True" StaysOpen="False" IsOpen="{Binding IsChecked, ElementName=toggleButton2}"
|
||||
PlacementEx="TopCenter" PlacementTarget="{Binding ElementName=toggleButton2}">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="White" />
|
||||
</controls:Poptip>
|
||||
<controls:Poptip Background="{DynamicResource DangerBrush}" AllowsTransparency="True" StaysOpen="False" IsOpen="{Binding IsChecked, ElementName=toggleButton3}"
|
||||
PlacementEx="TopRight" PlacementTarget="{Binding ElementName=toggleButton3}">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="White" />
|
||||
</controls:Poptip>
|
||||
<!--#endregion-->
|
||||
|
||||
<controls:Poptip Background="{DynamicResource SuccessBrush}" AllowsTransparency="True" StaysOpen="False" IsOpen="{Binding IsChecked, ElementName=toggleButton4}"
|
||||
PlacementEx="LeftTop" PlacementTarget="{Binding ElementName=toggleButton4}">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="White" />
|
||||
</controls:Poptip>
|
||||
<controls:Poptip AllowsTransparency="True" StaysOpen="False" IsOpen="{Binding IsChecked, ElementName=toggleButton5}"
|
||||
PlacementEx="LeftCenter" PlacementTarget="{Binding ElementName=toggleButton5}">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="White" />
|
||||
</controls:Poptip>
|
||||
<controls:Poptip AllowsTransparency="True" StaysOpen="False" IsOpen="{Binding IsChecked, ElementName=toggleButton6}"
|
||||
PlacementEx="LeftBottom" PlacementTarget="{Binding ElementName=toggleButton6}">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="White" />
|
||||
</controls:Poptip>
|
||||
|
||||
<controls:Poptip AllowsTransparency="True" StaysOpen="False" IsOpen="{Binding IsChecked, ElementName=toggleButton7}"
|
||||
PlacementEx="RightTop" PlacementTarget="{Binding ElementName=toggleButton7}">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="White" />
|
||||
</controls:Poptip>
|
||||
<controls:Poptip AllowsTransparency="True" StaysOpen="False" IsOpen="{Binding IsChecked, ElementName=toggleButton8}"
|
||||
PlacementEx="RightCenter" PlacementTarget="{Binding ElementName=toggleButton8}">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="White" />
|
||||
</controls:Poptip>
|
||||
<controls:Poptip AllowsTransparency="True" StaysOpen="False" IsOpen="{Binding IsChecked, ElementName=toggleButton9}"
|
||||
PlacementEx="RightBottom" PlacementTarget="{Binding ElementName=toggleButton9}">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="White" />
|
||||
</controls:Poptip>
|
||||
|
||||
<controls:Poptip AllowsTransparency="True" StaysOpen="False" IsOpen="{Binding IsChecked, ElementName=toggleButton10}"
|
||||
PlacementEx="BottomLeft" PlacementTarget="{Binding ElementName=toggleButton10}">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="White" />
|
||||
</controls:Poptip>
|
||||
<controls:Poptip AllowsTransparency="True" StaysOpen="False" IsOpen="{Binding IsChecked, ElementName=toggleButton11}"
|
||||
PlacementEx="BottomCenter" PlacementTarget="{Binding ElementName=toggleButton11}">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="White" />
|
||||
</controls:Poptip>
|
||||
<controls:Poptip IsOpen="{Binding IsChecked, ElementName=toggleButton12}"
|
||||
PlacementEx="BottomRight" PlacementTarget="{Binding ElementName=toggleButton12}"
|
||||
Background="White">
|
||||
<TextBlock Text="组件提供了12个不同的方向显示Poptip" Margin="10" Foreground="Black" />
|
||||
</controls:Poptip>
|
||||
|
||||
<ToggleButton x:Name="toggleButton1" Grid.Row="0" Grid.Column="1" Content="上左" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
<ToggleButton x:Name="toggleButton2" Grid.Row="0" Grid.Column="2" Content="上中" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
<ToggleButton x:Name="toggleButton3" Grid.Row="0" Grid.Column="3" Content="上右" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
|
||||
<ToggleButton x:Name="toggleButton4" Grid.Row="1" Grid.Column="0" Content="左上" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
<ToggleButton x:Name="toggleButton5" Grid.Row="2" Grid.Column="0" Content="左中" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
<ToggleButton x:Name="toggleButton6" Grid.Row="3" Grid.Column="0" Content="左右" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
|
||||
<ToggleButton x:Name="toggleButton7" Grid.Row="1" Grid.Column="4" Content="右上" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
<ToggleButton x:Name="toggleButton8" Grid.Row="2" Grid.Column="4" Content="右中" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
<ToggleButton x:Name="toggleButton9" Grid.Row="3" Grid.Column="4" Content="右下" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
|
||||
<ToggleButton x:Name="toggleButton10" Grid.Row="4" Grid.Column="1" Content="下左" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
<ToggleButton x:Name="toggleButton11" Grid.Row="4" Grid.Column="2" Content="下中" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
<ToggleButton x:Name="toggleButton12" Grid.Row="4" Grid.Column="3" Content="下右" Margin="5" Width="60" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
|
||||
</UniformGrid>
|
||||
</controls:TransitioningContentControl>
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
<UserControl.Resources>
|
||||
<Style x:Key="Button4PoptipStyle" BasedOn="{StaticResource {x:Type Button}}" TargetType="Button">
|
||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Content" Value="{Binding Tag,RelativeSource={RelativeSource Self},Converter={StaticResource Int2StringConverter},ConverterParameter={x:Static langs:Lang.PoptipPositionStr}}"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<hc:TransitioningContentControl>
|
||||
<Grid Margin="24,32">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<UniformGrid Grid.Column="1" Columns="3">
|
||||
<Button Margin="8,0" Tag="0" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
<Button Margin="8,0" Tag="1" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
<Button Margin="8,0" Tag="2" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Row="1" Grid.Column="2" Rows="3">
|
||||
<Button Margin="8,16" Tag="3" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
<Button Margin="8,16" Tag="4" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
<Button Margin="8,16" Tag="5" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Column="1" Grid.Row="2" Columns="3">
|
||||
<Button Margin="8,0" Tag="8" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
<Button Margin="8,0" Tag="7" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
<Button Margin="8,0" Tag="6" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Row="1" Grid.Column="0" Rows="3">
|
||||
<Button Margin="8,16" Tag="11" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
<Button Margin="8,16" Tag="10" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
<Button Margin="8,16" Tag="9" Style="{StaticResource Button4PoptipStyle}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public sealed partial class PoptipDemoCtl
|
||||
public partial class PoptipDemoCtl
|
||||
{
|
||||
public PoptipDemoCtl()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-12
@@ -7,20 +7,20 @@
|
||||
<hc:TransitioningContentControl>
|
||||
<WrapPanel Margin="16" VerticalAlignment="Center">
|
||||
<StackPanel Margin="16" Button.Click="ButtonProgress_OnClick">
|
||||
<hc:ProgressButton IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonPrimary}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonSuccess}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonInfo}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonWarning}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonDanger}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonPrimary}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonSuccess}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonInfo}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonWarning}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<hc:ProgressButton Style="{StaticResource ProgressButtonDanger}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="16" Button.Click="ButtonProgress_OnClick">
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoading}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingPrimary}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingSuccess}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingInfo}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingWarning}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingDanger}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoading}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingPrimary}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingSuccess}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingInfo}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingWarning}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
<ToggleButton Style="{StaticResource ToggleButtonLoadingDanger}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StringConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
|
||||
Reference in new issue
Block a user