0

0

什么是MVVM架构和数据绑定?

零下一度

零下一度

发布时间:2017-06-24 09:25:16

|

3270人浏览过

|

来源于php中文网

原创

 

(申明:最近在做一个练习,写点东西,谨供参考。)

1、界面展示:其中的布局和样式就不说了,重点在MVVM架构和数据绑定(Model层使用EF(Entity Framework)实体框架,不做介绍)。

 

绑定后:

2、架构介绍:

在Views层中新建CusGroupEditWindow窗体,ViewModels中建立CusGroupEditViewModel类,在窗体的xaml或者cs中引用ViewModels对应类:

   xaml中:

    <Window.DataContext>   

          <local:CusGroupEditViewModel/> <!--(添加引用local:为CusGroupEditViewModel的路径)-->     

      </Window.DataContext>

  cs:DataContext = CusGroupEditViewModel。(添加引用路径)

/***********************************************/

*CsGroup是在ViewModel中定义的一个CusGroup对象,    *

*CusGroup对象是在SQL数据库中的表,在EF中的对象。    *

/***********************************************/

3、TextBox绑定:

  <TextBox MaxWidth="550" Width="100" Text="{Binding CsGroup.Alarm,Mode=TwoWay}" />

4、Button绑定:

  <Button Width="100" Height="35" Margin="10" Command="{Binding BtnChangedCommand}" CommandParameter="btnCusGroupSave" Background="#fc8530" >         

            <TextBlock  Text="保存"  FontWeight="Bold" FontSize="16"></TextBlock>

      </Button> 

Krea AI
Krea AI

多功能的一站式AI图像生成和编辑平台

下载

<!-- Command="{Binding BtnChangedCommand}"中是在ViewModel中的委托,继承ICommoand -->

<!--CommandParameter="btnCusGroupSave"  参数-->

5、CheckBox绑定:

  <CheckBox Name="cbCash" Margin="0,0,5,0" IsChecked="{Binding CsGroup.IsCash}"/>

  <!-- IsCash 是在SQL表中CusGroup中字段,bit类型--> 6、ComboBox绑定:

6、ComboBox绑定:

<ComboBox MaxWidth="150" Width="100" SelectedValue="{Binding StrCMBselectValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="Text"
                                              SelectedValuePath="Value" ItemsSource="{Binding LstCSGDownLevelID, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />

 

 

 <!--SelectedValue:选中CommoBox的值,Mode双向模式,属性改变时触发;DisplayMemberPath:显示时绑定;SelectedValuePath:表示选择下拉框某一项对应的值;ItemsSource:绑定的数据源 -->

<!-- 其中Value和Text也可理解为数据源,在ViewModel中有赋值-->                                                 

7、DataGrid绑定:

<DataGrid ColumnWidth="*" SelectedItem="{Binding CurrentSelectItem}"  ItemsSource="{Binding CsGroupsAll}" AutoGenerateColumns="False"  IsReadOnly="True" >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Header="分组编号" Binding="{Binding Code}" />
                                    <DataGridTextColumn Header="分组名称" Binding="{Binding Name}" />
                                </DataGrid.Columns>
                            </DataGrid>

 

/***************************************************************/

        //DataGrid当前选择对象private CusGroup currentSelectItem;public CusGroup CurrentSelectItem
        {get { return currentSelectItem; }set{
                currentSelectItem = value;

                GetCutCmbSelect(value);
            }
        }
View Code

 

<!--代码没有自动缩进,有点不知所措-->

/***************************************************************/

 

ViewModel 中的代码:

   
   
using HeYin.ERP.DataModels;using HeYin.ERP.IServices;using HeYin.ERP.Models;using HeYin.ERP.Services;using Microsoft.Practices.Prism.Commands;using System;using System.Collections.Generic;using System.Collections.ObjectModel;using System.Windows;using System.Text.RegularExpressions;using System.Windows.Controls;namespace HeYin.ERP.Client.ViewModels.Customer
{class CusGroupEditViewModel : BaseViewModel
    {private bool bIsAdd = false;

        ICusGroupService CGS;  //调用IService接口#region Properties 属性private Guid gCsGroupID = Guid.Empty;//All CusGroupprivate List<CusGroup> csGroupsAll;public List<CusGroup> CsGroupsAll
        {get { return csGroupsAll; }set{
                csGroupsAll = value; //设定值OnPropertyChanged("CsGroupsAll"); //在属性更改后,通知            }
        }private List<CusGroup> csGroupsMinPrestore;public List<CusGroup> CsGroupsAllMinPrestore
        {get { return csGroupsMinPrestore; }set{
                csGroupsMinPrestore = value; //设定值OnPropertyChanged("CsGroupsAllMinPrestore"); //在属性更改后,通知            }
        }//CusGroup对象private CusGroup csGroup;public CusGroup CsGroup
        {get { return csGroup; }set{ csGroup = value;
                OnPropertyChanged("CsGroup"); }
        }/// <summary>/// /// </summary>private string strCMBselectValue;public string StrCMBselectValue
        {get { return strCMBselectValue; }set{if (value != null)
                {
                    strCMBselectValue = value;
                    OnPropertyChanged("StrCMBselectValue");
                }
            }
        }/// <summary>/// ComboBoxDataModel:作为一个ComboBox的对象,可以理解为数据源/// </summary>private ObservableCollection<ComboBoxDataModel> lstCSGDownLevelID;public ObservableCollection<ComboBoxDataModel> LstCSGDownLevelID
        {get { return lstCSGDownLevelID; }set{
                lstCSGDownLevelID = value;
                OnPropertyChanged("LstCSGDownLevelID");
            }
        }//DataGrid当前选择对象private CusGroup currentSelectItem;public CusGroup CurrentSelectItem
        {get { return currentSelectItem; }set{
                currentSelectItem = value;

                GetCutCmbSelect(value);
            }
        }private int errorCount;public int ErrorCount { get => errorCount; set => errorCount = value; }#endregion#region Commandspublic DelegateCommand<string> BtnChangedCommand { get; set; }public DelegateCommand<CusGroup> TxtChangedCommand { get; set; }        #endregionpublic CusGroupEditViewModel()
        {
            CGS = new CusGroupService();
            CsGroupsAll = new List<CusGroup>();
            csGroup = new CusGroup();
            LstCSGDownLevelID = new ObservableCollection<ComboBoxDataModel>();
            BtnChangedCommand = new DelegateCommand<string>(MenuClick);
            TxtChangedCommand = new DelegateCommand<CusGroup>(ChangeCMBValue);

            GetAllCusGroups();
        }#region ButtonClickprivate void MenuClick(string strMessage)
        {if (string.IsNullOrEmpty(strMessage)) return;if (CsGroup == null) return;switch (strMessage)
            {case "btnCusGroupSave":
                    Save();break;case "btnCusGroupAdd":
                    Add();break;case "btnCusGroupDelete":
                    Delete();break;
            }
        }#endregion ButtonClick#region motheds/// <summary>/// 获取全部Group/// </summary>private void GetAllCusGroups()
        {//获取满足条件的客户分组信息            CsGroupsAll.Clear();
            CsGroupsAll = CGS.Get(s => s.IsDelete == 0);

            GetAllCMBItems();//给降档分组下拉框赋值if ((gCsGroupID == null || gCsGroupID == Guid.Empty) && CsGroupsAll.Count > 0)
                CsGroup = CsGroupsAll[0];    //给基础信息等赋值StrCMBselectValue = CsGroup.DownLevelID.ToString();//设置降档分组默认值        }/// <summary>/// 添加/// </summary>/// <param name="cg"></param>private void AddCusGroup(CusGroup cg)
        {
            cg.ID = Guid.NewGuid(); //新建分组GUIDcg.IsDelete = 0;        //默认为0:不删除cg.CreateBy = App.GetCurrentUserId();//创建人员关联员工 GUIDcg.CreateTime = DateTime.Now;  //初始化创建时间,应该使用服务器当前时间bool c = CGS.Add(cg);if (c)
            {
                MessageBox.Show(string.Format("创建新组别【{0}】成功!", CsGroup.Name), "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                GetAllCusGroups();
                bIsAdd = false;
            }
        }/// <summary>/// 修改/// </summary>/// <param name="cg"></param>private void UpdateCusGroup(CusGroup cg)
        {
            bIsAdd = false;

            cg.UpdateTime = DateTime.Now;
            cg.UpdateBy = App.GetCurrentUserId();//更新人员关联员工 GUIDstring[] str = { "UpdateTime", "UpdateBy" };bool b = CGS.Edit(cg, str);if (b)
            {
                MessageBox.Show("更改组别【成功】!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                GetAllCusGroups();
            }
        }/// <summary>///删除方法(实为更新)/// </summary>/// <param name="cg"></param>private void DeleteCusGroup(CusGroup cg)
        {
            cg.IsDelete = 1; //更改数据库删除标志cg.UpdateTime = DateTime.Now;  //更新删除时间cg.UpdateBy = App.GetCurrentUserId();//更新人员关联员工 GUIDstring[] str = { "UpdateTime", "IsDelete", "UpdateBy" };bool b = CGS.Edit(cg, str);if (b)
            {//MessageBox.Show(string.Format("已删除组别【{0}】!", CsGroup.Name), "提示", MessageBoxButton.OK, MessageBoxImage.Information);                GetAllCusGroups();
                CsGroup = new CusGroup(); //清空对象bIsAdd = true;
            }
        }/// <summary>/// 插入和更新方法调用/// </summary>private void Save()
        {if (ErrorCount > 0)
            {//判断必填数据是否为空:为空则提示MessageBox.Show("请核对所填数据", "提示", MessageBoxButton.YesNo, MessageBoxImage.Information);return;
            }if (bIsAdd)
                AddCusGroup(CsGroup);elseUpdateCusGroup(CsGroup);
        }/// <summary>/// 获取降档分组下拉列表的值,并指定默认值/// </summary>/// <param name="value"></param>private void GetCutCmbSelect(CusGroup value)
        {
            bIsAdd = false;//点击新增后,再选择列表的逻辑if (value != null)
            {
                CsGroup = CGS.GetById(value.ID);//查找出当前选中的对象gCsGroupID = CsGroup.ID;        //保存当前选择对象的GUIDif (CsGroup != null)
                {if (CsGroup.DownLevelID.HasValue)
                    {//如果降档ID有值,则默认显示,如果没有,则显示为空GetExceptCMBSelect();//刷新下拉列表,先刷新,再赋值给默认值StrCMBselectValue = CsGroup.DownLevelID.ToString();
                    }else{
                        LstCSGDownLevelID.Clear();
                        StrCMBselectValue = string.Empty;
                    }
                }
            }
        }private void Add()
        {
            bIsAdd = true;//点击新建分组时,重新获取所有降档ID对应的中文名            GetAllCMBItems();

            CsGroup = new CusGroup();
        }private void Delete()
        {if (this.CsGroup.ID == Guid.Empty || CsGroup.ID == null)
                MessageBox.Show("请选择要删除组别", "提示", MessageBoxButton.OK, MessageBoxImage.Information);else{
                MessageBoxResult msgResult = MessageBox.Show(string.Format("确定要删除分组【{0}】吗?", CsGroup.Name), "提示", MessageBoxButton.YesNo, MessageBoxImage.Information);if (msgResult == MessageBoxResult.Yes)
                    DeleteCusGroup(CsGroup);
            }
        }/// <summary>/// 排除当前列的降档ID和对应的Name/// </summary>private void GetExceptCMBSelect()
        {
            LstCSGDownLevelID.Clear();
            CsGroupsAllMinPrestore = CGS.Get(s => s.IsDelete == 0 && s.MinPrestore <= CsGroup.MinPrestore);foreach (var iDlID in CsGroupsAllMinPrestore)
            {if (iDlID.ID != CsGroup.ID) //去除当前选择ID对应的NameLstCSGDownLevelID.Add(new ComboBoxDataModel() { Value = iDlID.ID.ToString(), Text = iDlID.Name });
            }
        }/// <summary>/// 获取列表中所有降档ID和对应的Name/// </summary>private void GetAllCMBItems()
        {
            LstCSGDownLevelID.Clear();foreach (var iDlID in CsGroupsAll)
            {
                LstCSGDownLevelID.Add(new ComboBoxDataModel() { Value = iDlID.ID.ToString(), Text = iDlID.Name });
            }
        }private void ChangeCMBValue(CusGroup cgMinPrestore)
        {
            LstCSGDownLevelID.Clear();
            List<CusGroup> lstTextChange = new List<CusGroup>();
            lstTextChange = CGS.Get(s => s.MinPrestore < cgMinPrestore.MinPrestore);foreach (var iDlID in lstTextChange)
            {
                LstCSGDownLevelID.Add(new ComboBoxDataModel() { Value = iDlID.ID.ToString(), Text = iDlID.Name });
            }
        }public void SizeChangedCommand(object obj, SizeChangedEventArgs e)
        {

            MessageBox.Show("日了狗");

        }#endregion}
}

 

View中代码:

<client:BaseWindow x:Class="HeYin.ERP.Client.Views.Customer.CusGroupEditWindow"
        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:Interaction="http://schemas.microsoft.com/expression/2010/interactions"
        xmlns:Interactivity="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:CommonValidation="clr-namespace:HeYin.ERP.Common.Validation;assembly=HeYin.ERP.Common"
        xmlns:client="clr-namespace:HeYin.ERP.Client"
        mc:Ignorable="d"
        x:Name="CusGroupWindow" 
        Title="客户分组" Height="500" Width="800" 
        WindowStartupLocation="CenterOwner"
        Loaded="Window_Loaded" 
        MaxboxEnable="True" 
        MinboxEnable="False" >

    <Interactivity:Interaction.Triggers>
        <Interactivity:EventTrigger EventName="SizeChanged">
            <Interaction:CallMethodAction TargetObject="{Binding}" MethodName="SizeChangedCommand"/>
        </Interactivity:EventTrigger>
    </Interactivity:Interaction.Triggers>

    <Grid>

        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="2*"/>
            </Grid.ColumnDefinitions>

            <!-- Left -->
            <Grid  Margin="5,0,5,5">
                <GroupBox Name="gbGroupData">
                    <GroupBox.HeaderTemplate>
                        <DataTemplate>
                            <WrapPanel Margin="{StaticResource WrapPanelMarginForInfo}">
                                <TextBlock Text="客户分组"  Height="20" />
                                <Button Width="20" Height="20" Margin="50,0,0,0" 
                                        Command="{Binding DataContext.BtnChangedCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=GroupBox}}"
                                        CommandParameter="btnCusGroupAdd"
                                        Visibility="{Binding SaveVisibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                                    <Image Source="..\..\Resources\Images\16\Add.png" />
                                </Button>

                                <Button Width="20" Height="20" Margin="10,0,0,0" 
                                        Command="{Binding  DataContext.BtnChangedCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=GroupBox}}" 
                                        CommandParameter="btnCusGroupDelete"
                                        Visibility="{Binding SaveVisibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                                    <Image Source="..\..\Resources\Images\16\Clear.png" />
                                </Button>
                            </WrapPanel>
                        </DataTemplate>
                    </GroupBox.HeaderTemplate>

                    <Grid>
                        <Grid Grid.Row="1">
                            <DataGrid ColumnWidth="*" SelectedItem="{Binding CurrentSelectItem}"  ItemsSource="{Binding CsGroupsAll}" AutoGenerateColumns="False"  IsReadOnly="True" >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Header="分组编号" Binding="{Binding Code}" />
                                    <DataGridTextColumn Header="分组名称" Binding="{Binding Name}" />
                                </DataGrid.Columns>
                            </DataGrid>
                        </Grid>
                    </Grid>
                </GroupBox>
            </Grid>

            <!-- Right -->
            <Grid Grid.Column="1" Margin="5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="100"/>
                    <RowDefinition Height="130"/>
                </Grid.RowDefinitions>

                <!-- 基础信息 -->
                <Grid>
                    <GroupBox>
                        <GroupBox.Header>
                            <TextBlock Text="基础信息" Height="20"/>
                        </GroupBox.Header>

                        <StackPanel>
                            <Grid Margin="0,10">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>

                                <TextBox  Visibility="Collapsed" x:Name="tbErrorCount" Text="{Binding ErrorCount, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
                                <WrapPanel Margin="{StaticResource WrapPanelMarginForInfo}">
                                    <TextBlock Width="60" Margin="{StaticResource TextBlockMarginForMostLeft}"><Run Text="分组编号" /></TextBlock>
                                    <TextBox Name="txtCusGropCrod" MaxWidth="150" Width="100" 
                                             ToolTip="{Binding RelativeSource={RelativeSource self},Path=(Validation.Errors).CurrentItem.ErrorContent}" Validation.Error="Validation_Error">
                                        <TextBox.Text>
                                            <Binding Path="CsGroup.Code" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True" NotifyOnValidationError="True">
                                                <Binding.ValidationRules>
                                                    <ExceptionValidationRule></ExceptionValidationRule>
                                                    <CommonValidation:RequiredValidationRule MaxLenth="15" ErrorMessage="分组编号" IsRequired="True" ValidatesOnTargetUpdated="True" />
                                                </Binding.ValidationRules>
                                            </Binding>
                                        </TextBox.Text>
                                    </TextBox>
                                </WrapPanel>

                                <WrapPanel Margin="{StaticResource WrapPanelMarginForInfo}" Grid.Column="1">
                                    <TextBlock Text="分组名称" Width="60" Margin="{StaticResource TextBlockMarginForMostLeft}"/>
                                    <TextBox Name="txtCusGropName"  MaxWidth="150" Width="100" 
                                             ToolTip="{Binding RelativeSource={RelativeSource self},Path=(Validation.Errors).CurrentItem.ErrorContent}" Validation.Error="Validation_Error">
                                        <TextBox.Text>
                                            <Binding Path="CsGroup.Name" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True" NotifyOnValidationError="True">
                                                <Binding.ValidationRules>
                                                    <ExceptionValidationRule></ExceptionValidationRule>
                                                    <CommonValidation:RequiredValidationRule MaxLenth="15" ErrorMessage="分组名称" IsRequired="True" ValidatesOnTargetUpdated="True" />
                                                </Binding.ValidationRules>
                                            </Binding>
                                        </TextBox.Text>
                                    </TextBox>
                                </WrapPanel>
                            </Grid>

                            <Grid>
                                <WrapPanel Margin="{StaticResource WrapPanelMarginForInfo}">
                                    <TextBlock Margin="{StaticResource TextBlockMarginForMostLeft}" Width="60" VerticalAlignment="Center"><Run Text="分组描述" /></TextBlock>

                                    <TextBox x:Name="tbRemark"  TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" Width="400" Height="90"
                             ToolTip="{Binding RelativeSource={RelativeSource self},Path=(Validation.Errors).CurrentItem.ErrorContent}" Validation.Error="Validation_Error">
                                        <TextBox.Text>
                                            <Binding Path="CsGroup.Description" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True" NotifyOnValidationError="True">
                                                <Binding.ValidationRules>
                                                    <ExceptionValidationRule></ExceptionValidationRule>
                                                    <CommonValidation:RequiredValidationRule MaxLenth="300" ErrorMessage="分组描述"  ValidatesOnTargetUpdated="True" />
                                                </Binding.ValidationRules>
                                            </Binding>
                                        </TextBox.Text>
                                    </TextBox>
                                </WrapPanel>
                            </Grid>
                        </StackPanel>
                    </GroupBox>
                </Grid>

                <!-- 消费相关 -->
                <Grid Grid.Row="1" Margin="0,10,0,10">
                    <Grid>
                        <GroupBox>
                            <GroupBox.Header>
                                <TextBlock Text="消费相关"/>
                            </GroupBox.Header>

                            <Grid Margin="0,10">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <WrapPanel Margin="{StaticResource WrapPanelMarginForInfo}">
                                    <TextBlock Text="消费积分" Width="60" Height="20" Margin="{StaticResource TextBlockMarginForMostLeft}" />
                                    <TextBox Name="txtCusGropJF" MaxWidth="150" Width="100" Text="{Binding CsGroup.PointConversion, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
                                </WrapPanel>
                                <WrapPanel Grid.Column="1" Margin="{StaticResource WrapPanelMarginForInfo}"  HorizontalAlignment="Left" VerticalAlignment="Center">
                                    <CheckBox Name="cbCash" Margin="0,0,5,0" IsChecked="{Binding CsGroup.IsCash}"/>
                                    <TextBlock Text="开通预存或储值时禁止现金交易" />
                                </WrapPanel>
                            </Grid>
                        </GroupBox>
                    </Grid>
                </Grid>

                <!-- 预存相关 -->
                <Grid Grid.Row="2">
                    <GroupBox>
                        <GroupBox.Header>
                            <TextBlock Text="预存相关"/>
                        </GroupBox.Header>

                        <StackPanel>
                            <Grid Margin="0,10">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <WrapPanel Margin="{StaticResource WrapPanelMarginForInfo}">
                                    <TextBlock Width="80" Margin="{StaticResource TextBlockMarginForMostLeft}" ><Run Text="预存最低充值"/></TextBlock>
                                    <TextBox MaxWidth="150" Width="100" Text="{Binding CsGroup.MinPrestore, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
                                </WrapPanel>
                                <WrapPanel Grid.Column="1" Margin="{StaticResource WrapPanelMarginForInfo}">
                                    <TextBlock Width="80" Text="金额低缺报警" Margin="{StaticResource TextBlockMarginForMostLeft}" />
                                    <TextBox MaxWidth="550" Width="100" Text="{Binding CsGroup.Alarm,Mode=TwoWay}" />
                                </WrapPanel>
                            </Grid>

                            <Grid Margin="0,5">
                                <WrapPanel Margin="{StaticResource WrapPanelMarginForInfo}">
                                    <TextBlock Width="190" Text="预存金额未达到最低要求时降档至" Margin="{StaticResource TextBlockMarginForMostLeft}"/>
                                    <ComboBox MaxWidth="150" Width="100" SelectedValue="{Binding StrCMBselectValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="Text"
                                              SelectedValuePath="Value" ItemsSource="{Binding LstCSGDownLevelID, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
                                </WrapPanel>
                            </Grid>
                        </StackPanel>
                    </GroupBox>
                </Grid>
            </Grid>
        </Grid>

        <!-- bottom -->
        <Grid Grid.Row="2">
            <WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{StaticResource WrapPanelMarginForInfo}">
                <Button Margin="1" Command="{Binding BtnChangedCommand}" CommandParameter="btnCusGroupSave" Background="#fc8530" Style="{StaticResource SaveButtonStyle}"
                        Visibility="{Binding SaveVisibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" >
                    <TextBlock  Text="保存"  FontWeight="Bold" FontSize="16"></TextBlock>
                </Button>
            </WrapPanel>
        </Grid>
    </Grid>
</client:BaseWindow>

 

热门AI工具

更多
DeepSeek
DeepSeek

幻方量化公司旗下的开源大模型平台

豆包大模型
豆包大模型

字节跳动自主研发的一系列大型语言模型

WorkBuddy
WorkBuddy

腾讯云推出的AI原生桌面智能体工作台

腾讯元宝
腾讯元宝

腾讯混元平台推出的AI助手

文心一言
文心一言

文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

讯飞写作
讯飞写作

基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿

即梦AI
即梦AI

一站式AI创作平台,免费AI图片和视频生成。

ChatGPT
ChatGPT

最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

相关专题

更多
C# ASP.NET Core微服务架构与API网关实践
C# ASP.NET Core微服务架构与API网关实践

本专题围绕 C# 在现代后端架构中的微服务实践展开,系统讲解基于 ASP.NET Core 构建可扩展服务体系的核心方法。内容涵盖服务拆分策略、RESTful API 设计、服务间通信、API 网关统一入口管理以及服务治理机制。通过真实项目案例,帮助开发者掌握构建高可用微服务系统的关键技术,提高系统的可扩展性与维护效率。

76

2026.03.11

Go高并发任务调度与Goroutine池化实践
Go高并发任务调度与Goroutine池化实践

本专题围绕 Go 语言在高并发任务处理场景中的实践展开,系统讲解 Goroutine 调度模型、Channel 通信机制以及并发控制策略。内容包括任务队列设计、Goroutine 池化管理、资源限制控制以及并发任务的性能优化方法。通过实际案例演示,帮助开发者构建稳定高效的 Go 并发任务处理系统,提高系统在高负载环境下的处理能力与稳定性。

38

2026.03.10

Kotlin Android模块化架构与组件化开发实践
Kotlin Android模块化架构与组件化开发实践

本专题围绕 Kotlin 在 Android 应用开发中的架构实践展开,重点讲解模块化设计与组件化开发的实现思路。内容包括项目模块拆分策略、公共组件封装、依赖管理优化、路由通信机制以及大型项目的工程化管理方法。通过真实项目案例分析,帮助开发者构建结构清晰、易扩展且维护成本低的 Android 应用架构体系,提升团队协作效率与项目迭代速度。

83

2026.03.09

JavaScript浏览器渲染机制与前端性能优化实践
JavaScript浏览器渲染机制与前端性能优化实践

本专题围绕 JavaScript 在浏览器中的执行与渲染机制展开,系统讲解 DOM 构建、CSSOM 解析、重排与重绘原理,以及关键渲染路径优化方法。内容涵盖事件循环机制、异步任务调度、资源加载优化、代码拆分与懒加载等性能优化策略。通过真实前端项目案例,帮助开发者理解浏览器底层工作原理,并掌握提升网页加载速度与交互体验的实用技巧。

97

2026.03.06

Rust内存安全机制与所有权模型深度实践
Rust内存安全机制与所有权模型深度实践

本专题围绕 Rust 语言核心特性展开,深入讲解所有权机制、借用规则、生命周期管理以及智能指针等关键概念。通过系统级开发案例,分析内存安全保障原理与零成本抽象优势,并结合并发场景讲解 Send 与 Sync 特性实现机制。帮助开发者真正理解 Rust 的设计哲学,掌握在高性能与安全性并重场景中的工程实践能力。

223

2026.03.05

PHP高性能API设计与Laravel服务架构实践
PHP高性能API设计与Laravel服务架构实践

本专题围绕 PHP 在现代 Web 后端开发中的高性能实践展开,重点讲解基于 Laravel 框架构建可扩展 API 服务的核心方法。内容涵盖路由与中间件机制、服务容器与依赖注入、接口版本管理、缓存策略设计以及队列异步处理方案。同时结合高并发场景,深入分析性能瓶颈定位与优化思路,帮助开发者构建稳定、高效、易维护的 PHP 后端服务体系。

458

2026.03.04

AI安装教程大全
AI安装教程大全

2026最全AI工具安装教程专题:包含各版本AI绘图、AI视频、智能办公软件的本地化部署手册。全篇零基础友好,附带最新模型下载地址、一键安装脚本及常见报错修复方案。每日更新,收藏这一篇就够了,让AI安装不再报错!

169

2026.03.04

Swift iOS架构设计与MVVM模式实战
Swift iOS架构设计与MVVM模式实战

本专题聚焦 Swift 在 iOS 应用架构设计中的实践,系统讲解 MVVM 模式的核心思想、数据绑定机制、模块拆分策略以及组件化开发方法。内容涵盖网络层封装、状态管理、依赖注入与性能优化技巧。通过完整项目案例,帮助开发者构建结构清晰、可维护性强的 iOS 应用架构体系。

246

2026.03.03

C++高性能网络编程与Reactor模型实践
C++高性能网络编程与Reactor模型实践

本专题围绕 C++ 在高性能网络服务开发中的应用展开,深入讲解 Socket 编程、多路复用机制、Reactor 模型设计原理以及线程池协作策略。内容涵盖 epoll 实现机制、内存管理优化、连接管理策略与高并发场景下的性能调优方法。通过构建高并发网络服务器实战案例,帮助开发者掌握 C++ 在底层系统与网络通信领域的核心技术。

34

2026.03.03

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
Vue.js 2.0 从入门到实战
Vue.js 2.0 从入门到实战

共192课时 | 17.6万人学习

vue 3.0全新实战课程-第一季
vue 3.0全新实战课程-第一季

共51课时 | 23.3万人学习

麦子学院Vue.js视频教程
麦子学院Vue.js视频教程

共30课时 | 8.7万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号