<My:MWindow  xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl"
                 x:Class="B20UVLog.Windows.DBSet"
        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:B20UVLog.Windows" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
             mc:Ignorable="d"
             WindowStyle="ToolWindow"
        Title="数据库配置" Height="300" Width="600">
    <Window.DataContext>
        <viewmodels:DBSetViewModel/>
    </Window.DataContext>
    <Grid>
        <Grid Margin="20">
            <Grid.Resources>
                <Style TargetType="TextBlock" BasedOn="{StaticResource TextBlockStyle}">
                    <Setter Property="Margin" Value="5 0 10 0"/>
                    <Setter Property="HorizontalAlignment" Value="Right"/>
                </Style>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="160"/>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="160"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <TextBlock Grid.Column="0" Grid.Row="0" Text="DataSource:"/>
            <My:MTextBox  Grid.Column="1" Grid.Row="0" Text="{Binding DataSource,Mode=TwoWay}"/>
            <TextBlock Grid.Column="2" Grid.Row="0" Text="Port:"/>
            <!--<My:MTextBox  Grid.Column="3" Grid.Row="0" Text="{Binding Port}"/>-->
            <My:MTextBox  Grid.Column="3" Grid.Row="0" Text="{Binding DataSource}"/>
            <TextBlock Grid.Column="0" Grid.Row="1" Text="User:"/>
            <My:MTextBox  Grid.Column="1" Grid.Row="1" Text="{Binding User}"/>
            <TextBlock Grid.Column="2" Grid.Row="1" Text="Password:"/>
            <My:MTextBox  Grid.Column="3" Grid.Row="1" Text="{Binding Password}"/>
            <TextBlock Grid.Column="0" Grid.Row="2" Text="Database:"/>
            <My:MTextBox  Grid.Column="1" Grid.Row="2" Text="{Binding Database}"/>
            <StackPanel Grid.Column="3" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
                <My:MButton Command="{Binding TestConCommand}">测试</My:MButton>
                <My:MButton Type="Primary" Command="{Binding SaveCommand}">确定</My:MButton>
            </StackPanel>
        </Grid>
    </Grid>
</My:MWindow>
