mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-12-03 04:18:01 +08:00
init branch
This commit is contained in:
parent
4f9cc3a472
commit
69eee87e5e
@ -359,6 +359,12 @@
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\VSO_Card_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\VSO_Card_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ImageStack_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ImageStack_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Dance.png">
|
||||
<Link>Resources\Img\Dance.png</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
|
||||
|
@ -396,6 +396,12 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Dance.png">
|
||||
<Link>Resources\Img\Dance.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ImageStack_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ImageStack_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\VSO_Card_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\VSO_Card_16x.png</Link>
|
||||
</Resource>
|
||||
|
@ -458,6 +458,12 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\Dance.png">
|
||||
<Link>Resources\Img\Dance.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ImageStack_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\ImageStack_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\VSO_Card_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\VSO_Card_16x.png</Link>
|
||||
</Resource>
|
||||
|
@ -104,6 +104,8 @@
|
||||
|
||||
public static readonly string MagnifierDemoCtl = nameof(MagnifierDemoCtl);
|
||||
|
||||
public static readonly string ImageBlockDemoCtl = nameof(ImageBlockDemoCtl);
|
||||
|
||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||
|
||||
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
|
||||
|
@ -54,7 +54,8 @@ var controlList = new List<string>
|
||||
"RangeSliderDemoCtl",
|
||||
"ButtonGroupDemoCtl",
|
||||
"CardDemoCtl",
|
||||
"MagnifierDemoCtl"
|
||||
"MagnifierDemoCtl",
|
||||
"ImageBlockDemoCtl"
|
||||
};
|
||||
var styleList = new List<string>
|
||||
{
|
||||
|
@ -54,6 +54,9 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\CardDemoCtl.xaml.cs">
|
||||
<DependentUpon>CardDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ImageBlockDemoCtl.xaml.cs">
|
||||
<DependentUpon>ImageBlockDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\MagnifierDemoCtl.xaml.cs">
|
||||
<DependentUpon>MagnifierDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -423,6 +426,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ImageBlockDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\MagnifierDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
@ -690,6 +690,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 图片块 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string ImageBlock {
|
||||
get {
|
||||
return ResourceManager.GetString("ImageBlock", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 图片浏览器 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -630,4 +630,7 @@
|
||||
<data name="Magnifier" xml:space="preserve">
|
||||
<value>Magnifier</value>
|
||||
</data>
|
||||
<data name="ImageBlock" xml:space="preserve">
|
||||
<value>ImageBlock</value>
|
||||
</data>
|
||||
</root>
|
@ -630,4 +630,7 @@
|
||||
<data name="Magnifier" xml:space="preserve">
|
||||
<value>放大镜</value>
|
||||
</data>
|
||||
<data name="ImageBlock" xml:space="preserve">
|
||||
<value>图片块</value>
|
||||
</data>
|
||||
</root>
|
BIN
src/Shared/HandyControlDemo_Shared/Resources/Img/Dance.png
Normal file
BIN
src/Shared/HandyControlDemo_Shared/Resources/Img/Dance.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 617 KiB |
Binary file not shown.
After Width: | Height: | Size: 336 B |
@ -0,0 +1,6 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.ImageBlockDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl">
|
||||
<userControl:UnderConstruction/>
|
||||
</UserControl>
|
@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class ImageBlockDemoCtl
|
||||
{
|
||||
public ImageBlockDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
@ -195,6 +195,11 @@
|
||||
</hc:StatusSwitchElement.CheckedElement>
|
||||
</ToggleButton>
|
||||
<ListBox Name="ListBoxControl" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" BorderThickness="0" SelectionMode="Single" Style="{StaticResource ListBoxTransparent}">
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ImageBlockDemoCtl}" Content="{x:Static langs:Lang.ImageBlock}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ImageStack_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.MagnifierDemoCtl}" Content="{x:Static langs:Lang.Magnifier}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Search_16x.png"/>
|
||||
@ -330,7 +335,7 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ColorWheel_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.GridDemoCtl}" Content="{x:Static langs:Lang.Grid}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.GridDemoCtl}" Content="{x:Static langs:Lang.Grid}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/GridPane_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
|
46
src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs
Normal file
46
src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class ImageBlock : FrameworkElement
|
||||
{
|
||||
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
|
||||
"Source", typeof(ImageSource), typeof(ImageBlock), new FrameworkPropertyMetadata(default(ImageSource),
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public ImageSource Source
|
||||
{
|
||||
get => (ImageSource) GetValue(SourceProperty);
|
||||
set => SetValue(SourceProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ColumnsProperty = DependencyProperty.Register(
|
||||
"Columns", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public int Columns
|
||||
{
|
||||
get => (int) GetValue(ColumnsProperty);
|
||||
set => SetValue(ColumnsProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty RowsProperty = DependencyProperty.Register(
|
||||
"Rows", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public int Rows
|
||||
{
|
||||
get => (int) GetValue(RowsProperty);
|
||||
set => SetValue(RowsProperty, value);
|
||||
}
|
||||
|
||||
protected override void OnRender(DrawingContext dc)
|
||||
{
|
||||
var imageSource = Source;
|
||||
|
||||
if (imageSource != null) dc.DrawImage(imageSource, new Rect(new Point(), RenderSize));
|
||||
}
|
||||
}
|
||||
}
|
@ -19,6 +19,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PanelElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PasswordBoxAttach.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\RectangleAttach.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Image\ImageBlock.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Magnifier.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\ButtonGroup.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Card.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user