mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-25 02:46:38 +08:00
节点导入完成
This commit is contained in:
26
AIStudio.Wpf.Mind/Controls/NodeDTSWindow.xaml
Normal file
26
AIStudio.Wpf.Mind/Controls/NodeDTSWindow.xaml
Normal file
@@ -0,0 +1,26 @@
|
||||
<Window x:Class="AIStudio.Wpf.Mind.Controls.NodeDTSWindow"
|
||||
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:local="clr-namespace:AIStudio.Wpf.Mind.Controls"
|
||||
mc:Ignorable="d"
|
||||
WindowStyle="None"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Height="450" Width="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Margin="5" Text="{Binding Title}"/>
|
||||
<Border BorderThickness="0,0,0,1" BorderBrush="DarkGray" VerticalAlignment="Bottom"></Border>
|
||||
<TextBox Grid.Row="1" Margin="5" TextWrapping="Wrap" AcceptsReturn="True" AcceptsTab="True" Text="{Binding Content}"/>
|
||||
<Border Grid.Row="2" BorderThickness="0,0,0,1" BorderBrush="DarkGray" VerticalAlignment="Top"></Border>
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Margin="5" Padding="6,3" Background="#73a1bf" Foreground="White" BorderThickness="0" Content="OK" x:Name="btnOK" Click="btnOK_Click" IsDefault="True"/>
|
||||
<Button Margin="5" Padding="6,3" Background="#FFEDA46F" Foreground="White" BorderThickness="0" Content="Cancel" x:Name="btnCancel" Click="btnCancel_Click" IsCancel="True" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
71
AIStudio.Wpf.Mind/Controls/NodeDTSWindow.xaml.cs
Normal file
71
AIStudio.Wpf.Mind/Controls/NodeDTSWindow.xaml.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System.Windows;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
|
||||
namespace AIStudio.Wpf.Mind.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// NodeDTSWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NodeDTSWindow : Window
|
||||
{
|
||||
public NodeDTSWindow(string title, string content)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var viewmodel = new NodeDTSWindowViewModel();
|
||||
viewmodel.Title = title;
|
||||
viewmodel.Content = content;
|
||||
|
||||
this.DataContext = viewmodel;
|
||||
}
|
||||
|
||||
public string ContentString
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.DataContext as NodeDTSWindowViewModel).Content;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = true;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public class NodeDTSWindowViewModel : BindableBase
|
||||
{
|
||||
private string _title;
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
return _title;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _title, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _content;
|
||||
public string Content
|
||||
{
|
||||
get
|
||||
{
|
||||
return _content;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _content, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user