Commit 82209b91 by liulongfei

GH资源图片拖拽至CotnrolObject

parent bff93f07
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("VIZ.TVP.Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VIZ.TVP.Common")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.TVP.Common.Properties {
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VIZ.TVP.Common.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.TVP.Common.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
\ No newline at end of file
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VIZ.TVP.Common">
</ResourceDictionary>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5B25ED51-2687-444F-80C1-6CFCAAC0BF57}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>VIZ.TVP.Common</RootNamespace>
<AssemblyName>VIZ.TVP.Common</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.Data.Desktop.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Widgets\DragBoder\ResourceDragBorder.cs" />
<Compile Include="Widgets\DropTextEdit\DropTextEdit.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Common\VIZ.Framework.Common.csproj">
<Project>{92834c05-703e-4f05-9224-f36220939d8f}</Project>
<Name>VIZ.Framework.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Core\VIZ.Framework.Core.csproj">
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Domain\VIZ.Framework.Domain.csproj">
<Project>{28661e82-c86a-4611-a028-c34f6ac85c97}</Project>
<Name>VIZ.Framework.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Domain\VIZ.TVP.Domain.csproj">
<Project>{65425cb5-7465-4e36-86a7-416341c8793c}</Project>
<Name>VIZ.TVP.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Storage\VIZ.TVP.Storage.csproj">
<Project>{d9e0c48d-d7e7-4207-a999-2fded536d4da}</Project>
<Name>VIZ.TVP.Storage</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using DevExpress.Xpf.Grid;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using VIZ.TVP.Domain;
namespace VIZ.TVP.Common
{
/// <summary>
/// 资源拖拽面板
/// </summary>
public class ResourceDragBorder : Border
{
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
{
base.OnPreviewMouseLeftButtonDown(e);
CardData cardData = this.DataContext as CardData;
if (cardData == null)
return;
IResourceDrag drag = cardData.Row as IResourceDrag;
if (drag == null)
return;
ResourceDragData data = new ResourceDragData();
data.FileType = drag.FileType;
data.ResourcePath = drag.ResourcePath;
DragDrop.DoDragDrop(this, data, DragDropEffects.Move);
}
}
}
using DevExpress.Xpf.Core;
using DevExpress.Xpf.Editors;
using DevExpress.Xpf.Grid;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using VIZ.TVP.Domain;
namespace VIZ.TVP.Common
{
/// <summary>
/// 拖拽停靠文本编辑器
/// </summary>
public class DropTextEdit : TextEdit
{
public DropTextEdit()
{
this.AllowDrop = true;
}
protected override void OnPreviewDrop(DragEventArgs e)
{
base.OnPreviewDrop(e);
if (!e.Data.GetDataPresent(typeof(ResourceDragData)))
return;
ResourceDragData data = e.Data.GetData(typeof(ResourceDragData)) as ResourceDragData;
if (data == null)
return;
EditGridCellData cellData = this.DataContext as EditGridCellData;
if (cellData == null)
return;
// 控制对象字段
if (cellData.Row is VizControlObjectFieldModel)
{
VizControlObjectFieldModel fieldModel = cellData.Row as VizControlObjectFieldModel;
fieldModel.Value = data.ResourcePath;
}
// 动态数据
if (cellData.Row is ExpandoObject)
{
IDictionary<string, object> dic = cellData.Row as IDictionary<string, object>;
dic[cellData.Column.FieldName] = data.ResourcePath;
}
}
}
}
...@@ -11,7 +11,7 @@ namespace VIZ.TVP.Domain ...@@ -11,7 +11,7 @@ namespace VIZ.TVP.Domain
/// <summary> /// <summary>
/// GH 资源文件模型 /// GH 资源文件模型
/// </summary> /// </summary>
public class GHResourceFileModel : ResourceFileModelBase, IDisposable public class GHResourceFileModel : ResourceFileModelBase, IResourceDrag, IDisposable
{ {
/// <summary> /// <summary>
/// GH 节点 /// GH 节点
...@@ -88,6 +88,18 @@ namespace VIZ.TVP.Domain ...@@ -88,6 +88,18 @@ namespace VIZ.TVP.Domain
#endregion #endregion
#region ResourcePath -- 资源路径
/// <summary>
/// 资源路径
/// </summary>
public string ResourcePath
{
get { return $"{this.FileType}*{this.Path}"; }
}
#endregion
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// 扩展属性 // 扩展属性
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 资源拖拽
/// </summary>
public interface IResourceDrag
{
/// <summary>
/// 文件类型
/// </summary>
ResourceFileType FileType { get; }
/// <summary>
/// 资源路径
/// </summary>
string ResourcePath { get; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 资源拖拽数据
/// </summary>
public class ResourceDragData
{
/// <summary>
/// 资源类型
/// </summary>
public ResourceFileType FileType { get; set; }
/// <summary>
/// 资源路径
/// </summary>
public string ResourcePath { get; set; }
}
}
...@@ -98,8 +98,10 @@ ...@@ -98,8 +98,10 @@
<Compile Include="Model\Project\Program\ProgramListItemModel.cs" /> <Compile Include="Model\Project\Program\ProgramListItemModel.cs" />
<Compile Include="Model\Project\Program\ProgramListModel.cs" /> <Compile Include="Model\Project\Program\ProgramListModel.cs" />
<Compile Include="Model\Project\Program\ProgramTemplateModel.cs" /> <Compile Include="Model\Project\Program\ProgramTemplateModel.cs" />
<Compile Include="Model\Resource\IResourceDrag.cs" />
<Compile Include="Model\Resource\LF\LFResourceFileModel.cs" /> <Compile Include="Model\Resource\LF\LFResourceFileModel.cs" />
<Compile Include="Model\Resource\LF\LFResourceFolderModel.cs" /> <Compile Include="Model\Resource\LF\LFResourceFolderModel.cs" />
<Compile Include="Model\Resource\ResourceDragData.cs" />
<Compile Include="Model\TVPConnection\ITVPEndpointManager.cs" /> <Compile Include="Model\TVPConnection\ITVPEndpointManager.cs" />
<Compile Include="Model\TVPConnection\TVPConnectionGroupModel.cs" /> <Compile Include="Model\TVPConnection\TVPConnectionGroupModel.cs" />
<Compile Include="Model\TVPConnection\TVPConnectionModel.cs" /> <Compile Include="Model\TVPConnection\TVPConnectionModel.cs" />
......
...@@ -152,7 +152,7 @@ namespace VIZ.TVP.Module ...@@ -152,7 +152,7 @@ namespace VIZ.TVP.Module
column.CellEditTemplate = view.FindResource("ColumnTemplate_Text") as DataTemplate; column.CellEditTemplate = view.FindResource("ColumnTemplate_Text") as DataTemplate;
break; break;
case VizControlObjectFieldType.image: case VizControlObjectFieldType.image:
column.CellEditTemplate = view.FindResource("ColumnTemplate_Text") as DataTemplate; column.CellEditTemplate = view.FindResource("ColumnTemplate_Image") as DataTemplate;
break; break;
case VizControlObjectFieldType.list: case VizControlObjectFieldType.list:
break; break;
...@@ -186,6 +186,20 @@ namespace VIZ.TVP.Module ...@@ -186,6 +186,20 @@ namespace VIZ.TVP.Module
} }
/// <summary> /// <summary>
/// 是否是同一种类型
/// </summary>
/// <param name="fileType">文件类型</param>
/// <param name="fieldType">字段类型</param>
/// <returns>是否是同一种类型</returns>
public bool IsSameType(ResourceFileType fileType, VizControlObjectFieldType fieldType)
{
if (fileType == ResourceFileType.IMAGE && fieldType == VizControlObjectFieldType.image)
return true;
return false;
}
/// <summary>
/// 动态数据项属性改变时触发 /// 动态数据项属性改变时触发
/// </summary> /// </summary>
private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e) private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e)
......
...@@ -22,6 +22,11 @@ namespace VIZ.TVP.Module ...@@ -22,6 +22,11 @@ namespace VIZ.TVP.Module
public DataTemplate TextDataTemplate { get; set; } public DataTemplate TextDataTemplate { get; set; }
/// <summary> /// <summary>
/// 图片模板
/// </summary>
public DataTemplate ImageDataTemplate { get; set; }
/// <summary>
/// Bool类型的模板 /// Bool类型的模板
/// </summary> /// </summary>
public DataTemplate BooleanDataTemplate { get; set; } public DataTemplate BooleanDataTemplate { get; set; }
...@@ -46,7 +51,7 @@ namespace VIZ.TVP.Module ...@@ -46,7 +51,7 @@ namespace VIZ.TVP.Module
case VizControlObjectFieldType.text: return this.TextDataTemplate; case VizControlObjectFieldType.text: return this.TextDataTemplate;
case VizControlObjectFieldType.boolean: return this.BooleanDataTemplate; case VizControlObjectFieldType.boolean: return this.BooleanDataTemplate;
case VizControlObjectFieldType.richtext: return this.TextDataTemplate; case VizControlObjectFieldType.richtext: return this.TextDataTemplate;
case VizControlObjectFieldType.image: return this.TextDataTemplate; case VizControlObjectFieldType.image: return this.ImageDataTemplate;
case VizControlObjectFieldType.list: return this.TextDataTemplate; case VizControlObjectFieldType.list: return this.TextDataTemplate;
default: return null; default: return null;
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm" xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core" xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:domain="clr-namespace:VIZ.TVP.Domain;assembly=VIZ.TVP.Domain" xmlns:domain="clr-namespace:VIZ.TVP.Domain;assembly=VIZ.TVP.Domain"
xmlns:common="clr-namespace:VIZ.TVP.Common;assembly=VIZ.TVP.Common"
xmlns:local="clr-namespace:VIZ.TVP.Module" xmlns:local="clr-namespace:VIZ.TVP.Module"
d:DataContext="{d:DesignInstance Type=local:ControlListViewModel}" d:DataContext="{d:DesignInstance Type=local:ControlListViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
...@@ -18,7 +19,12 @@ ...@@ -18,7 +19,12 @@
<!-- 文本编辑 --> <!-- 文本编辑 -->
<DataTemplate x:Key="ColumnTemplate_Text"> <DataTemplate x:Key="ColumnTemplate_Text">
<dxe:TextEdit Name="PART_Editor" /> <dxe:TextEdit x:Name="PART_Editor"></dxe:TextEdit>
</DataTemplate>
<!-- 图片编辑 -->
<DataTemplate x:Key="ColumnTemplate_Image">
<common:DropTextEdit x:Name="PART_Editor"></common:DropTextEdit>
</DataTemplate> </DataTemplate>
<!-- Boolean编辑 --> <!-- Boolean编辑 -->
...@@ -29,13 +35,16 @@ ...@@ -29,13 +35,16 @@
<local:ControlListValueDataTemplateSelecter x:Key="ControlListValueDataTemplateSelecter" <local:ControlListValueDataTemplateSelecter x:Key="ControlListValueDataTemplateSelecter"
TextDataTemplate="{StaticResource ColumnTemplate_Text}" TextDataTemplate="{StaticResource ColumnTemplate_Text}"
ImageDataTemplate="{StaticResource ColumnTemplate_Image}"
BooleanDataTemplate="{StaticResource ColumnTemplate_Boolean}"> BooleanDataTemplate="{StaticResource ColumnTemplate_Boolean}">
</local:ControlListValueDataTemplateSelecter> </local:ControlListValueDataTemplateSelecter>
<DataTemplate x:Key="ColumnTemplate"> <DataTemplate x:Key="ColumnTemplate">
<ContentControl> <ContentControl>
<dxg:GridColumn FieldName="{Binding FieldName}" Width="{Binding Width}" Header="{Binding Header}" ReadOnly="{Binding ReadOnly}" <dxg:GridColumn FieldName="{Binding FieldName}" Width="{Binding Width}" Header="{Binding Header}" ReadOnly="{Binding ReadOnly}"
CellEditTemplate="{Binding CellEditTemplate}" AllowSorting="False" AllowColumnFiltering="False" /> AllowEditing="True" AllowSorting="False" AllowColumnFiltering="False"
CellTemplate="{Binding CellEditTemplate}"
CellEditTemplate="{Binding CellEditTemplate}" />
</ContentControl> </ContentControl>
</DataTemplate> </DataTemplate>
...@@ -50,17 +59,21 @@ ...@@ -50,17 +59,21 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- 控制对象字段 --> <!-- 控制对象字段 -->
<dxg:GridControl ItemsSource="{Binding Path=SelectedControlObject.Fields}" ShowBorder="False" Grid.Column="0" <dxg:GridControl ItemsSource="{Binding Path=SelectedControlObject.Fields}" ShowBorder="False" Grid.Column="0"
SelectedItem="{Binding Path=SelectedControlObjectField,Mode=TwoWay}" Margin="0,0,6,0"> SelectedItem="{Binding Path=SelectedControlObjectField,Mode=TwoWay}" Margin="0,0,6,0"
AllowDrop="True">
<dxg:GridControl.Columns> <dxg:GridControl.Columns>
<dxg:GridColumn Header="字段" FieldName="FieldIdentifier" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False" Width="150" AllowResizing="True"></dxg:GridColumn> <dxg:GridColumn Header="字段" FieldName="FieldIdentifier" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False" Width="150" AllowResizing="True"></dxg:GridColumn>
<dxg:GridColumn Header="类型" FieldName="Type" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False" Width="100" AllowResizing="True"></dxg:GridColumn> <dxg:GridColumn Header="类型" FieldName="Type" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False" Width="100" AllowResizing="True"></dxg:GridColumn>
<dxg:GridColumn Header="值" FieldName="Value" AllowSorting="False" AllowColumnFiltering="False" Width="*" AllowResizing="True" CellEditTemplateSelector="{StaticResource ControlListValueDataTemplateSelecter}"></dxg:GridColumn> <dxg:GridColumn Header="值" FieldName="Value" AllowSorting="False" AllowColumnFiltering="False" Width="*" AllowResizing="True"
AllowEditing="True"
CellTemplateSelector="{StaticResource ControlListValueDataTemplateSelecter}"
CellEditTemplateSelector="{StaticResource ControlListValueDataTemplateSelecter}"></dxg:GridColumn>
</dxg:GridControl.Columns> </dxg:GridControl.Columns>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True" <dxg:TableView AllowEditing="True" ShowIndicator="True"
NavigationStyle="Cell" NavigationStyle="Cell"
ShowGroupPanel="False" ShowGroupPanel="False"
AllowDragDrop="True" AllowDrop="True"
ShowBandsPanel="False" ShowBandsPanel="False"
ShowTotalSummary="False" ShowTotalSummary="False"
ShowFixedTotalSummary="False" ShowFixedTotalSummary="False"
...@@ -71,7 +84,7 @@ ...@@ -71,7 +84,7 @@
</dxg:GridControl> </dxg:GridControl>
<GridSplitter VerticalAlignment="Stretch" HorizontalAlignment="Right" Width="6" Grid.Column="0"></GridSplitter> <GridSplitter VerticalAlignment="Stretch" HorizontalAlignment="Right" Width="6" Grid.Column="0"></GridSplitter>
<!-- 控制对象编辑器 --> <!-- 控制对象编辑器 -->
<dxg:GridControl ItemsSource="{Binding Path=ListValue}" ShowBorder="False" Grid.Column="1" <dxg:GridControl ItemsSource="{Binding Path=ListValue}" ShowBorder="False" Grid.Column="1" AllowDrop="True"
ColumnsSource="{Binding Path=ListValueColumns}" ColumnGeneratorTemplate="{StaticResource ColumnTemplate}"> ColumnsSource="{Binding Path=ListValueColumns}" ColumnGeneratorTemplate="{StaticResource ColumnTemplate}">
<dxg:GridControl.ContextMenu> <dxg:GridControl.ContextMenu>
<ContextMenu> <ContextMenu>
...@@ -82,7 +95,7 @@ ...@@ -82,7 +95,7 @@
<dxg:TableView AllowEditing="True" ShowIndicator="True" <dxg:TableView AllowEditing="True" ShowIndicator="True"
NavigationStyle="Cell" NavigationStyle="Cell"
ShowGroupPanel="False" ShowGroupPanel="False"
AllowDragDrop="True" AllowDrop="True"
ShowBandsPanel="False" ShowBandsPanel="False"
ShowTotalSummary="False" ShowTotalSummary="False"
ShowFixedTotalSummary="False" ShowFixedTotalSummary="False"
......
...@@ -24,5 +24,10 @@ namespace VIZ.TVP.Module ...@@ -24,5 +24,10 @@ namespace VIZ.TVP.Module
{ {
InitializeComponent(); InitializeComponent();
} }
private void GridControl_Drop(object sender, DragEventArgs e)
{
}
} }
} }
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys" xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core" xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:local="clr-namespace:VIZ.TVP.Module" xmlns:local="clr-namespace:VIZ.TVP.Module"
xmlns:common="clr-namespace:VIZ.TVP.Common;assembly=VIZ.TVP.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Domain;assembly=VIZ.TVP.Domain" xmlns:domain="clr-namespace:VIZ.TVP.Domain;assembly=VIZ.TVP.Domain"
mc:Ignorable="d" mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:VizResourceViewModel}" d:DataContext="{d:DesignInstance Type=local:VizResourceViewModel}"
...@@ -90,15 +91,17 @@ ...@@ -90,15 +91,17 @@
<dxg:GridControl.Resources> <dxg:GridControl.Resources>
<!-- 定义Card模板 --> <!-- 定义Card模板 -->
<DataTemplate x:Key="CardTemplate"> <DataTemplate x:Key="CardTemplate">
<Grid Width="160" ClipToBounds="False" UseLayoutRounding="True"> <common:ResourceDragBorder Background="Transparent">
<Grid.RowDefinitions> <Grid Width="160" ClipToBounds="False" UseLayoutRounding="True">
<RowDefinition Height="90" /> <Grid.RowDefinitions>
<RowDefinition Height="30" /> <RowDefinition Height="90" />
</Grid.RowDefinitions> <RowDefinition Height="30" />
<Image Source="{Binding Path=Row.ThumbnailBitmap,Converter={StaticResource Bitmap2ImageSourceConverter}}"></Image> </Grid.RowDefinitions>
<TextBlock Grid.Row="1" TextAlignment="Center" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" HorizontalAlignment="Center" <Image Source="{Binding Path=Row.ThumbnailBitmap,Converter={StaticResource Bitmap2ImageSourceConverter}}"></Image>
<TextBlock Grid.Row="1" TextAlignment="Center" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" HorizontalAlignment="Center"
Text="{Binding Path=Row.Name}" ToolTip="{Binding Path=Row.Name}" Margin="0,5,0,0"/> Text="{Binding Path=Row.Name}" ToolTip="{Binding Path=Row.Name}" Margin="0,5,0,0"/>
</Grid> </Grid>
</common:ResourceDragBorder>
</DataTemplate> </DataTemplate>
</dxg:GridControl.Resources> </dxg:GridControl.Resources>
<dxg:GridControl.ContextMenu> <dxg:GridControl.ContextMenu>
......
...@@ -362,6 +362,10 @@ ...@@ -362,6 +362,10 @@
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project> <Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name> <Name>VIZ.Framework.Storage</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Common\VIZ.TVP.Common.csproj">
<Project>{5b25ed51-2687-444f-80c1-6cfcaac0bf57}</Project>
<Name>VIZ.TVP.Common</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Connection\VIZ.TVP.Connection.csproj"> <ProjectReference Include="..\VIZ.TVP.Connection\VIZ.TVP.Connection.csproj">
<Project>{c42e3144-2ad7-461b-80b8-491d69b3530e}</Project> <Project>{c42e3144-2ad7-461b-80b8-491d69b3530e}</Project>
<Name>VIZ.TVP.Connection</Name> <Name>VIZ.TVP.Connection</Name>
......
...@@ -75,6 +75,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TVP.Module.Resource", " ...@@ -75,6 +75,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TVP.Module.Resource", "
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TVP.Plugin.Test", "VIZ.TVP.Plugin.Test\VIZ.TVP.Plugin.Test.csproj", "{B31C8C74-8B93-4247-9425-98AE346170BE}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TVP.Plugin.Test", "VIZ.TVP.Plugin.Test\VIZ.TVP.Plugin.Test.csproj", "{B31C8C74-8B93-4247-9425-98AE346170BE}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TVP.Common", "VIZ.TVP.Common\VIZ.TVP.Common.csproj", "{5B25ED51-2687-444F-80C1-6CFCAAC0BF57}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -235,6 +237,14 @@ Global ...@@ -235,6 +237,14 @@ Global
{B31C8C74-8B93-4247-9425-98AE346170BE}.Release|Any CPU.Build.0 = Release|Any CPU {B31C8C74-8B93-4247-9425-98AE346170BE}.Release|Any CPU.Build.0 = Release|Any CPU
{B31C8C74-8B93-4247-9425-98AE346170BE}.Release|x64.ActiveCfg = Release|Any CPU {B31C8C74-8B93-4247-9425-98AE346170BE}.Release|x64.ActiveCfg = Release|Any CPU
{B31C8C74-8B93-4247-9425-98AE346170BE}.Release|x64.Build.0 = Release|Any CPU {B31C8C74-8B93-4247-9425-98AE346170BE}.Release|x64.Build.0 = Release|Any CPU
{5B25ED51-2687-444F-80C1-6CFCAAC0BF57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B25ED51-2687-444F-80C1-6CFCAAC0BF57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B25ED51-2687-444F-80C1-6CFCAAC0BF57}.Debug|x64.ActiveCfg = Debug|x64
{5B25ED51-2687-444F-80C1-6CFCAAC0BF57}.Debug|x64.Build.0 = Debug|x64
{5B25ED51-2687-444F-80C1-6CFCAAC0BF57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B25ED51-2687-444F-80C1-6CFCAAC0BF57}.Release|Any CPU.Build.0 = Release|Any CPU
{5B25ED51-2687-444F-80C1-6CFCAAC0BF57}.Release|x64.ActiveCfg = Release|Any CPU
{5B25ED51-2687-444F-80C1-6CFCAAC0BF57}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
...@@ -259,6 +269,7 @@ Global ...@@ -259,6 +269,7 @@ Global
{B4FAA424-E356-465B-B0BA-7B915C4F8E2A} = {D835160C-344B-4EE4-8441-3847686C4AB0} {B4FAA424-E356-465B-B0BA-7B915C4F8E2A} = {D835160C-344B-4EE4-8441-3847686C4AB0}
{18AC4721-CEF0-4D91-BE3A-65829313B2C7} = {68E0F44E-70C5-4D7D-A0BC-0D8A56D8B979} {18AC4721-CEF0-4D91-BE3A-65829313B2C7} = {68E0F44E-70C5-4D7D-A0BC-0D8A56D8B979}
{B31C8C74-8B93-4247-9425-98AE346170BE} = {68E0F44E-70C5-4D7D-A0BC-0D8A56D8B979} {B31C8C74-8B93-4247-9425-98AE346170BE} = {68E0F44E-70C5-4D7D-A0BC-0D8A56D8B979}
{5B25ED51-2687-444F-80C1-6CFCAAC0BF57} = {770E1AC6-36C2-4EED-98A4-767A689C10E3}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {25E4D7B8-911F-47E7-8C18-B6F002A07E00} SolutionGuid = {25E4D7B8-911F-47E7-8C18-B6F002A07E00}
......
...@@ -167,6 +167,10 @@ ...@@ -167,6 +167,10 @@
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project> <Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name> <Name>VIZ.Framework.Storage</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Common\VIZ.TVP.Common.csproj">
<Project>{5b25ed51-2687-444f-80c1-6cfcaac0bf57}</Project>
<Name>VIZ.TVP.Common</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Connection\VIZ.TVP.Connection.csproj"> <ProjectReference Include="..\VIZ.TVP.Connection\VIZ.TVP.Connection.csproj">
<Project>{c42e3144-2ad7-461b-80b8-491d69b3530e}</Project> <Project>{c42e3144-2ad7-461b-80b8-491d69b3530e}</Project>
<Name>VIZ.TVP.Connection</Name> <Name>VIZ.TVP.Connection</Name>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment