WPF ContentControl Content Binding

news/2025/10/5 22:12:56/文章来源:https://www.cnblogs.com/Fred1987/p/19127104
Install-Package Microsoft.Extensions.DependencyInjection;
Install-Package CommunityToolkit.mvvm;

 

<Window x:Class="WpfApp25.Views.MainWin"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:WpfApp25.Views"WindowState="Maximized"mc:Ignorable="d"Title="{Binding MainTitle}" Height="450" Width="800"><Grid><Grid.RowDefinitions><RowDefinition/></Grid.RowDefinitions><ContentControl Grid.Row="0"Content="{Binding DgViewInstance}"x:Name="MainRegion"/></Grid>
</Window>using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using WpfApp25.Views;namespace WpfApp25.ViewModels
{public partial class MainWinViewModel:ObservableObject{public MainWinViewModel(DgViewModel dgVM){MainTitle = $"In Main Win,now is {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}";InitTimer();DgViewInstance = new DgView(dgVM);}private void InitTimer(){System.Timers.Timer tmr = new System.Timers.Timer();tmr.Interval = 1000;tmr.Elapsed += Tmr_Elapsed;tmr.Start();}private void Tmr_Elapsed(object? sender, System.Timers.ElapsedEventArgs e){MainTitle = $"In Main Win,now is {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}";}[ObservableProperty]private string mainTitle;[ObservableProperty]private string statusMsg;[ObservableProperty]private object dgViewInstance;}
}

 

 

 

 

 

 

 

 

 

 

 

 

image

 

 

 

//App.xaml
<Application x:Class="WpfApp25.App"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local="clr-namespace:WpfApp25"><Application.Resources></Application.Resources>
</Application>//App.xaml.cs
using Microsoft.Extensions.DependencyInjection;
using System.Configuration;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using WpfApp25.Services;
using WpfApp25.ViewModels;
using WpfApp25.Views;namespace WpfApp25
{/// <summary>/// Interaction logic for App.xaml/// </summary>public partial class App : Application{ServiceProvider serviceProvider;protected override void OnStartup(StartupEventArgs e){base.OnStartup(e);ServiceCollection services = new ServiceCollection();ConfigureServices(services);serviceProvider = services.BuildServiceProvider();var mainWin = serviceProvider.GetRequiredService<MainWin>();mainWin?.Show();}private static void ConfigureServices(ServiceCollection services){services.AddSingleton<IIDService, IDService>();services.AddSingleton<IISBNService, ISBNService>();services.AddSingleton<INameService, NameService>();services.AddSingleton<DgView>();services.AddSingleton<DgViewModel>();services.AddSingleton<MainWin>();services.AddSingleton<MainWinViewModel>();}protected override void OnExit(ExitEventArgs e){base.OnExit(e);serviceProvider?.Dispose();serviceProvider = null;}}}//MainWindow.xaml
<Window x:Class="WpfApp25.Views.MainWin"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:WpfApp25.Views"WindowState="Maximized"mc:Ignorable="d"Title="{Binding MainTitle}" Height="450" Width="800"><Grid><Grid.RowDefinitions><RowDefinition/></Grid.RowDefinitions><ContentControl Grid.Row="0"Content="{Binding DgViewInstance}"x:Name="MainRegion"/></Grid>
</Window>//MainWin.xaml.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WpfApp25.ViewModels;namespace WpfApp25.Views
{/// <summary>/// Interaction logic for MainWin.xaml/// </summary>public partial class MainWin : Window{public MainWin(MainWinViewModel vm){InitializeComponent();this.DataContext = vm;}}
}//MainWinViewModel.cs
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using WpfApp25.Views;namespace WpfApp25.ViewModels
{public partial class MainWinViewModel:ObservableObject{public MainWinViewModel(DgViewModel dgVM){MainTitle = $"In Main Win,now is {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}";InitTimer();DgViewInstance = new DgView(dgVM);}private void InitTimer(){System.Timers.Timer tmr = new System.Timers.Timer();tmr.Interval = 1000;tmr.Elapsed += Tmr_Elapsed;tmr.Start();}private void Tmr_Elapsed(object? sender, System.Timers.ElapsedEventArgs e){MainTitle = $"In Main Win,now is {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}";}[ObservableProperty]private string mainTitle;[ObservableProperty]private string statusMsg;[ObservableProperty]private object dgViewInstance;}
}//DgView.xaml
<UserControl x:Class="WpfApp25.Views.DgView"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:WpfApp25.Views"mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"><Grid><Grid.RowDefinitions><RowDefinition/><RowDefinition Height="Auto"/></Grid.RowDefinitions><DataGrid    Grid.Row="0"ItemsSource="{Binding BooksCollection}"VirtualizingPanel.IsVirtualizing="True"VirtualizingPanel.VirtualizationMode="Recycling"VirtualizingPanel.CacheLengthUnit="Item"VirtualizingPanel.CacheLength="3,3"ScrollViewer.IsDeferredScrollingEnabled="True"ScrollViewer.CanContentScroll="True"AutoGenerateColumns="False"CanUserAddRows="False"><DataGrid.Resources><Style TargetType="DataGridRow"><Setter Property="FontSize" Value="30"/><Style.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="FontSize" Value="50"/><Setter Property="Foreground" Value="Red"/></Trigger></Style.Triggers></Style></DataGrid.Resources><DataGrid.Columns><!--Author,Name,Comment,Content,ISBN,Title,Topic--><DataGridTextColumn Binding="{Binding Id}"/><DataGridTextColumn Binding="{Binding Author}"/><DataGridTextColumn Binding="{Binding Name}"/><DataGridTextColumn Binding="{Binding Comment}"/><DataGridTextColumn Binding="{Binding Content}"/><DataGridTextColumn Binding="{Binding ISBN}"/><DataGridTextColumn Binding="{Binding Title}"/><DataGridTextColumn Binding="{Binding Topic}"/></DataGrid.Columns><DataGrid.ContextMenu><ContextMenu><MenuItem Header="Export In Excel"Command="{Binding ExportInExcelCommand}"CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ContextMenu},Path=PlacementTarget}"/></ContextMenu></DataGrid.ContextMenu></DataGrid><TextBlock Grid.Row="1"Text="{Binding LoadingMsg}"FontSize="30"/></Grid>
</UserControl>//Dgview.xaml.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WpfApp25.ViewModels;namespace WpfApp25.Views
{/// <summary>/// Interaction logic for DgView.xaml/// </summary>public partial class DgView : UserControl{public DgView(DgViewModel vm){InitializeComponent();this.DataContext = vm;this.Loaded += async (s, e) =>{await vm.InitBooksCollectionAsync();};}}
}//DgViewModel.cs
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.Win32;
using OfficeOpenXml;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Windows.Controls;
using System.Windows.Input;
using WpfApp25.Models;
using WpfApp25.Services;
using WpfApp25.Utitlity;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using System.Reflection;
using System.Windows;
using System.Linq;
using System.Linq.Expressions;
using Expression = System.Linq.Expressions.Expression;namespace WpfApp25.ViewModels
{public partial class DgViewModel : ObservableObject{IIDService idService;INameService nameService;IISBNService isbnService;        public DgViewModel(IIDService idServiceValue, INameService nameServiceValue, IISBNService isbnServiceValue){idService = idServiceValue;nameService = nameServiceValue;isbnService = isbnServiceValue;ExportInExcelCommand = new DelCommand(ExportInExcelCommandExecuted);}int globalProcessedCount = 0;private void ExportInExcelCommandExecuted(object? obj){var dg = obj as DataGrid;if (dg != null){Task.Run(() =>{var itemsList = dg.Items.Cast<Book>()?.ToList();if (itemsList == null || !itemsList.Any()){Application.Current.Dispatcher.Invoke(() =>{MessageBox.Show("No data to export!");});return;}string fileName = null;Application.Current.Dispatcher.Invoke(() =>{SaveFileDialog dialog = new SaveFileDialog();dialog.Filter = "Excel Files|*.xlsx;*.xls";dialog.FileName = $"Excel_{DateTime.Now:yyyyMMddHHmmss}";if (dialog.ShowDialog() == true){fileName = dialog.FileName;}});if (!string.IsNullOrEmpty(fileName)){var progress = new Progress<int>(percent =>{Application.Current.Dispatcher.Invoke(() =>{LoadingMsg = $"Exporting... {percent}%";});});try{ExportListT(itemsList, fileName, progress);Application.Current.Dispatcher.Invoke(() =>{MessageBox.Show($"Data saved successfully in {fileName}!");LoadingMsg = "Export completed!";});}catch (Exception ex){Application.Current.Dispatcher.Invoke(() =>{MessageBox.Show($"Export failed: {ex.Message}");LoadingMsg = "Export failed!";});}}});}}private void ExportListT<T>(List<T> dataList, string excelFileName, IProgress<int> progress = null){EPPlusLicense license = new EPPlusLicense();license.SetNonCommercialPersonal("Grit");using (var package = new ExcelPackage()){if (dataList == null || !dataList.Any()){var workSheet = package.Workbook.Worksheets.Add("Sheet_1");workSheet.Cells["A1"].Value = "No data available";package.SaveAs(new System.IO.FileInfo(excelFileName));return;}const int excelMaxRows = 1048576;// Reserve 1 row for headerconst int maxDataRows = excelMaxRows - 1;int totalCount = dataList.Count;int processedCount = 0;var props = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public);if (dataList.Count <= maxDataRows){ExportToWorkSheet_Fast(package, "sheet_1", dataList, progress, totalCount);}else{int sheetcount = (int)Math.Ceiling((double)dataList.Count / maxDataRows);for (int sheetIdx = 0; sheetIdx < sheetcount; sheetIdx++){var sheetDataList = dataList.Skip(sheetIdx * maxDataRows).Take(maxDataRows).ToList();ExportToWorkSheet_Fast(package, $"Sheet_{sheetIdx + 1}", sheetDataList, progress, totalCount);}}package.SaveAs(new System.IO.FileInfo(excelFileName));}}private void ExportToWorkSheet<T>(ExcelPackage package, string sheetName, List<T> dataList,IProgress<int> progress = null, int totalCount = 0){var workSheet = package.Workbook.Worksheets.Add(sheetName);//Headervar props = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public);for (int i = 0; i < props.Length; i++){var cell = workSheet.Cells[1, i + 1];cell.Value = props[i].Name;cell.Style.Font.Bold = true;cell.Style.Fill.PatternType = ExcelFillStyle.Solid;cell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightBlue);cell.Style.Border.Bottom.Style = ExcelBorderStyle.Thick;}//Datafor (int row = 0; row < dataList.Count; row++){++globalProcessedCount;var item = dataList[row];for (int col = 0; col < props.Length; col++){var value = props[col].GetValue(item);workSheet.Cells[row + 2, col + 1].Value = value;if (progress != null && (globalProcessedCount % 10000 == 0 || row == dataList.Count - 1)){int percent = (int)((double)globalProcessedCount / totalCount * 100);progress.Report(Math.Min(percent, 100));LoadingMsg = $"Export processed {percent}%100";}}}workSheet.Cells[workSheet.Dimension.Address].AutoFitColumns();}private void ExportToWorkSheet_Fast<T>(ExcelPackage package, string sheetName, List<T> dataList,IProgress<int> progress = null, int totalCount = 0){var workSheet = package.Workbook.Worksheets.Add(sheetName);// Properties and headervar props = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public);for (int i = 0; i < props.Length; i++){var cell = workSheet.Cells[1, i + 1];cell.Value = props[i].Name;cell.Style.Font.Bold = true;cell.Style.Fill.PatternType = ExcelFillStyle.Solid;cell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightBlue);cell.Style.Border.Bottom.Style = ExcelBorderStyle.Thick;}if (dataList == null || dataList.Count == 0){package.SaveAs(new System.IO.FileInfo("empty.xlsx"));return;}// Build fast delegates for property getters (cached)var getters = new Func<T, object>[props.Length];for (int i = 0; i < props.Length; i++){var p = props[i];// Create a compiled lambda (obj => (object)((T)obj).Prop)var param = Expression.Parameter(typeof(T), "x");var propertyAccess = Expression.Property(param, p);Expression converted = Expression.Convert(propertyAccess, typeof(object));var lambda = Expression.Lambda<Func<T, object>>(converted, param);getters[i] = lambda.Compile();}// Create an IEnumerable<object[]> of rows (deferred streaming)IEnumerable<object[]> Rows(){foreach (var item in dataList){globalProcessedCount++;var row = new object[props.Length];for (int i = 0; i < props.Length; i++){row[i] = getters[i](item);}// report progress periodically (not for every cell)if (progress != null && (globalProcessedCount % 10000 == 0)){int percent = totalCount > 0 ? (int)((double)globalProcessedCount / totalCount * 100) : 0;progress.Report(Math.Min(percent, 100));}yield return row;}// final reportif (progress != null)progress.Report(100);}// Bulk load rows starting at row 2, col 1workSheet.Cells[2, 1].LoadFromArrays(Rows());// Column sizing:// - For small/medium datasets, AutoFitColumns is OK// - For very large datasets (>100k rows) it is very slow. Here I show a sampling approach:try{if (dataList.Count <= 50000){workSheet.Cells[workSheet.Dimension.Address].AutoFitColumns();}else{// AutoFit only based on first N rows + header to get reasonable column widthsint sampleRows = Math.Min(2000, dataList.Count);for (int c = 1; c <= props.Length; c++){var from = workSheet.Cells[1, c, sampleRows + 1, c];//workSheet.Column(c).Width = from.AutoFitColumnsGetWidth(); // EPPlus internal helper? if not available, skip          // If AutoFitColumnsGetWidth isn't available in your EPPlus, you can skip or set a default width:// workSheet.Column(c).Width = 20;
                    }}}catch{// If AutoFit fails or is slow, fall back to default widthfor (int c = 1; c <= props.Length; c++)workSheet.Column(c).Width = 20;}}public async Task InitBooksCollectionAsync(){BooksCollection = new ObservableCollection<Book>();List<Book> booksList = new List<Book>();await Task.Run(async () =>{for (int i = 1; i < 3000001; i++){booksList.Add(new Book(){Id = idService.GetID(),Name = nameService.GetName(),ISBN = isbnService.GetISBN(),Author = $"Author_{i}",Comment = $"Comment_{i}",Content = $"Content_{i}",Title = $"Title_{i}",Topic = $"Topic_{i}"});if (i % 100000 == 0){await PopulateBooksCollectionAsync(booksList);}}if (booksList.Any()){await PopulateBooksCollectionAsync(booksList);}LoadingMsg = $"Loading Completed!";});}private async Task PopulateBooksCollectionAsync(List<Book> booksList){var tempList = booksList.ToList();booksList.Clear();await System.Windows.Application.Current.Dispatcher.InvokeAsync(() =>{foreach (var bk in tempList){BooksCollection.Add(bk);}LoadingMsg = $"Loaded {BooksCollection.Count} items";}, System.Windows.Threading.DispatcherPriority.Background);}[ObservableProperty]private ObservableCollection<Book> booksCollection;[ObservableProperty]private string loadingMsg;public ICommand ExportInExcelCommand { get; set; }}
}//Book.cs
using System;
using System.Collections.Generic;
using System.Text;namespace WpfApp25.Models
{public class Book{public int Id { get; set; }public string Author { get; set; }public string Name { get; set; }    public string Comment { get; set; }public string Content {  get; set; }public string ISBN { get; set; }public string Title { get; set; }public string Topic {  get; set; }              }
}//services.cs
using System;
using System.Collections.Generic;
using System.Text;namespace WpfApp25.Services
{public interface IIDService{int GetID();}public class IDService : IIDService{int id = 0;public int GetID(){return Interlocked.Increment(ref id);}}public interface INameService{string GetName();}public class NameService : INameService{int idx = 0;public string GetName(){return $"Name_{Interlocked.Increment(ref idx)}";}}public interface IISBNService{string GetISBN();}public class ISBNService : IISBNService{int idx = 0;public string GetISBN(){return $"ISBN_{Interlocked.Increment(ref idx)}_{Guid.NewGuid():N}";}}
}//DelCommand.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Input;namespace WpfApp25.Utitlity
{public class DelCommand : ICommand{private Action<Object?> execute;private Predicate<Object?> canExecute;public DelCommand(Action<Object?> executeValue, Predicate<Object?> canExecuteValue=null){execute = executeValue;canExecute = canExecuteValue;}public event EventHandler? CanExecuteChanged{add{CommandManager.RequerySuggested += value;}remove{CommandManager.RequerySuggested -= value;}}public bool CanExecute(object? parameter){return canExecute == null ? true : canExecute(parameter);}public void Execute(object? parameter){execute(parameter);}}
}

 

 

image

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/928787.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

做网站什么程序好东莞互联网公司排名

ArcGIS Pro SDK &#xff08;九&#xff09;几何 3 点 文章目录 ArcGIS Pro SDK &#xff08;九&#xff09;几何 3 点1 构造地图点2 地图点生成器属性3 地图点的相等性4 缩放至指定点 环境&#xff1a;Visual Studio 2022 .NET6 ArcGIS Pro SDK 3.0 1 构造地图点 // 使用生…

南京专业做网站公司地址查公司信息在哪里查

分布式架构中实现全局唯一ID的需求非常常见,业界上也有很多的工具可直接使用。以下总结一下在面试过程中被问到如何使用Redis 实现分布式全局唯一ID的问题 自定义全局唯一ID生成器 @Component public class RedisIdWorker {/*** 开始时间戳*/private static final long BEGIN…

男女生做恶心的网站网站后期维护管理

本帖最后由 神经病的春天 于 2014-9-18 15:36 编辑近来升级了一下主机&#xff0c;这样一来&#xff0c;终于能够拥有USB3.0和SATA3.0接口了&#xff0c;不过本人目前还木有SSD&#xff0c;所以尚无法完全发挥出这些接口的速度优势。 为了测试&#xff0c;上周的时候&#xff0…

学校网站建设责任书衡阳seo网站推广

1. DBoW3库介绍 DBoW3是DBoW2的增强版&#xff0c;这是一个开源的C库&#xff0c;用于给图像特征排序&#xff0c;并将图像转化成视觉词袋表示。它采用层级树状结构将相近的图像特征在物理存储上聚集在一起&#xff0c;创建一个视觉词典。DBoW3还生成一个图像数据库&#xff0c…

To PXS -- Words to be remembered 2025.10.5

To PXS Despite the great distance between us, our hearts still unite as one. The powerful bond of friendship between us will never fade but endure. Looking back at the days and nights we shared togethe…

网站截图怎么做做网站要收订金吗

为了精准、稳定地提取滚动轴承故障特征&#xff0c;提出了基于变分模态分解和奇异值分解的特征提取方法&#xff0c;采用标准模糊C均值聚类(fuzzy C means clustering, FCM)进行故障识 别。对同一负荷下的已知故障信号进行变分模态分解&#xff0c;利用 奇异值分解技术进一步提…

⭐ Unity AVProVideo插件自带播放器 脚本重构 实现视频激活重置功能 - 实践

⭐ Unity AVProVideo插件自带播放器 脚本重构 实现视频激活重置功能 - 实践2025-10-05 21:56 tlnshuju 阅读(0) 评论(0) 收藏 举报pre { white-space: pre !important; word-wrap: normal !important; overflow-x:…

dede网站打开慢做采集网站赚钱

旧项目用的 vue3-seamless-scroll 怎么写都不生效&#xff0c;一看源码两年没更新了&#xff0c;不想调试&#xff0c;还是自己写吧&#xff0c;再不济问问GPT都会更快一点 scroll.vue <template><div class"scroll-container" ref"scrollContainerR…

网站做视频的软件营销型网站哪家好

课程背景 2023年&#xff0c;以ChatGPT为代表的接近人类水平的对话机器人&#xff0c;AIGC不断刷爆网络&#xff0c;其强大的内容生成能力给人们带来了巨大的震撼。学术界和产业界也都形成共识&#xff1a;AIGC绝非昙花一现&#xff0c;其底层技术和产业生态已经形成了新的格局…

做损坏文档的网站seo搜索引擎推广

更新Milvus各个组件的配置参数。 调试 您可以在OpenAPI Explorer中直接运行该接口&#xff0c;免去您计算签名的困扰。运行成功后&#xff0c;OpenAPI Explorer可以自动生成SDK代码示例。 ​编辑调试 授权信息 下表是API对应的授权信息&#xff0c;可以在RAM权限策略语句的…

做网站怎么选服务器军队采购网

java中各map中是否可以存储null值情况

linux做网站服务器吗中企动力官网网站

‍ 侯建业 本文由是石科技CIO侯建业撰写并投递参与“数据猿年度金猿策划活动——2023大数据产业年度优秀CIO榜单及奖项”评选。 大数据产业创新服务媒体 ——聚焦数据 改变商业 是石科技&#xff08;江苏&#xff09;有限公司成立于2021年&#xff0c;由国家超级计算无锡中心与…

nodejs做网站的弊端网站备案中是什么意思

Title: 非线性最小二乘问题的数值方法 —— 从高斯-牛顿法到列文伯格-马夸尔特法 (I) 文章目录 前言I. 从高斯-牛顿法II. 到阻尼高斯-牛顿法III. 再到列文伯格-马夸尔特法1. 列文伯格-马夸尔特法的由来2. 列文伯格-马夸尔特法的说明说明一. 迭代方向说明二. 近似于带权重的梯度…

保险业网站建设想卖产品怎么推广宣传

要使用Python批量根据Excel数据绘制饼状图&#xff0c;可以使用pandas和matplotlib库来实现。以下是一个基本的代码示例&#xff1a; import pandas as pd import matplotlib.pyplot as plt # 读取Excel文件 data pd.read_excel(data.xlsx) # 提取需要用于绘制饼状图的数据列…

网站建设与服务技能实训心得体会采集网站如何收录

一、可继承的属性 1. 文本相关属性 color&#xff1a;文本的颜色。 font-family&#xff1a;字体系列。 font-size&#xff1a;文本的大小。 font-style&#xff1a;文本的样式。 line-height&#xff1a;行与行之间的垂直间距。 2. 列表相关属性 list-style-type&#xff1a;…

uboot 2020版本下gpio命令的使用

1.在uboot命令行中想要支持gpio的命令,需要打开如下宏CONFIG_CMD_GPIO=y2.选用gpio引脚,作为测试引脚 2.1 查看电路原理图,选用那种soc不和mcu连接的pin,这样可以避免mcu的干扰。 2.2 查看pinmux的配置文件pinmux.…

邢台建网站找谁广安做网站

需求&#xff1a; 创建A项目&#xff0c;有函数和类&#xff0c;将A项目生成DLL动态链接库 创建B项目&#xff0c;使用A项目生成的dll和lib相关文件 正常项目开发.h用于函数声明&#xff0c;.cpp用于函数实现&#xff0c;但是项目开发往往不喜欢将.cpp函数实现的代码发给别人&…

网站设计师简历wordpress分类目录模板

按住option之后&#xff0c;点击Enter就可以完成换行操作

网站推广怎么写牡丹江市西安区建设局网站

读 TCP 协议 RFC-793_rfc 793-CSDN博客TCP灌包中RTT时延与RTO超时关系 - konglingbin - 博客园 TCP的RTT算法 从前面的TCP重传机制我们知道Timeout的设置对于重传非常重要。 设长了&#xff0c;重发就慢&#xff0c;丢了老半天才重发&#xff0c;没有效率&#xff0c;性能差&…

C#定时器深度对比:System.Timers.Timer vs System.Threading.Timer性能实测与选型指南 - 教程

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …