09 2024 档案
摘要:Right click project/Properties/Publish Then click Publish Wizard step by step,then will create a setup.exe file in publish folder Click the setup.exe
阅读全文
摘要:<Image Grid.Column="0" Source="pack://application:,,,/WpfApp431;component/Images/1.jpg" RenderOptions.BitmapScalingMode="Fant"/> <Image Grid.Column="1
阅读全文
摘要:private static Mutex mtx = null; public MainWindow() { bool isCreateNew; string appName = System.IO.Path.GetFileName(System.Reflection.Assembly.GetExe
阅读全文
摘要:<Window x:Class="WpfApp428.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要://xaml <Window x:Class="WpfApp427.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要:<Window x:Class="WpfApp426.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要://xaml <Window x:Class="WpfApp425.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要://xaml <Window x:Class="WpfApp424.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要:<Window x:Class="WpfApp419.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<Window x:Class="WpfApp418.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:Install dapper using Dapper; using MySql.Data.MySqlClient; namespace ConsoleApp87 { internal class Program { static string connStr = @"Server=serverna
阅读全文
摘要:using System.Collections.Concurrent; using System.Diagnostics; namespace ConsoleApp85 { internal class Program { static void Main(string[] args) { try
阅读全文
摘要://xaml <Window x:Class="WpfApp417.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要://xaml <Window x:Class="WpfApp416.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要://https://img1.baidu.com/it/u=3991277133,2041185316&fm=253 <Image Source="https://img1.baidu.com/it/u=3991277133,2041185316&fm=253"/> Severity Code De
阅读全文
摘要:<Window x:Class="WpfApp413.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<Window x:Class="WpfApp412.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<Window x:Class="WpfApp412.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<Window x:Class="WpfApp411.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:1. dotnet add package Pomelo.EntityFrameworkCore.MySql using Microsoft.EntityFrameworkCore; namespace ConsoleApp84 { internal class Program { static v
阅读全文
摘要:<Window x:Class="WpfApp410.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<Window x:Class="WpfApp408.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:WindowState="Maximized" WindowStyle="None" <Window x:Class="WpfApp409.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xm
阅读全文
摘要:<Window x:Class="WpfApp407.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要://xaml <Window x:Class="WpfApp406.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要:<Window x:Class="WpfApp403.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要://xaml <Window x:Class="WpfApp402.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要:AllowsTransparency="True" WindowStyle="None" KeyDown="Window_KeyDown" public MainWindow() { InitializeComponent(); this.SizeChanged += MainWindow_Size
阅读全文
摘要:<ListBox.ItemTemplate> <DataTemplate> <Grid> <Image Source="{Binding ImgUrl}" RenderOptions.BitmapScalingMode="LowQuality" Width="{Binding ActualWidth
阅读全文
摘要:CommandParameter pass SelectedItem of control <ListBox.ContextMenu> <ContextMenu> <MenuItem Header="Save Image" Command="{Binding SaveImgCommand}" Com
阅读全文
摘要:<Window x:Class="WpfApp399.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<DataGrid ItemsSource="{StaticResource booksData}" EnableColumnVirtualization="True" EnableRowVirtualization="True" FrozenColumnCount="2" AreRowDetail
阅读全文
摘要:<Grid> <DataGrid ItemsSource="{StaticResource booksData}" EnableColumnVirtualization="True" EnableRowVirtualization="True" RowDetailsVisibilityMode="V
阅读全文
摘要:<DataGrid ItemsSource="{StaticResource booksData}" ClipboardCopyMode="IncludeHeader"/> //xaml <Window x:Class="WpfApp398.MainWindow" xmlns="http://sch
阅读全文
摘要:System.Collections.IList items = (System.Collections.IList)obj; var booksList = items.Cast<Book>()?.ToList();
阅读全文
摘要:SelectedItems convert to IList as below failed; IList<Book> collection2 = (IList<Book>)obj; System.InvalidCastException HResult=0x80004002 Message=Una
阅读全文
摘要:private void SelectedCommandExecuted(object obj) { if (obj != null && obj is DataGrid dg) { if (dg != null) { var selectedBks = dg.SelectedItems; if (
阅读全文
摘要:<Window x:Class="WpfApp397.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
WPF DataGrid DataGridTextColumn DataGridCheckBoxColumn DataGridCheckBoxColumn DataGridTemplateColumn
摘要:<Window x:Class="WpfApp397.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<Window.Resources> <ObjectDataProvider x:Key="kindEnum" MethodName="GetValues" ObjectType="{x:Type sys:Enum}"> <ObjectDataProvider.MethodParameters> <
阅读全文
摘要:<Window x:Class="WpfApp395.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<ComboBox ItemsSource="{StaticResource dataList}" SelectedIndex="0" VirtualizingPanel.IsContainerVirtualizable="True" VirtualizingPanel.IsVirtualizing
阅读全文
摘要:<Window x:Class="WpfApp392.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<ComboBox x:Name="cbx" Grid.Row="0" Grid.Column="0" SelectedIndex="0" ItemsSource="{StaticResource booksData}" FontSize="20" Foreground="Red" Vertical
阅读全文
摘要:<ComboBox Grid.Row="0" Grid.Column="0" SelectedIndex="0" ItemsSource="{StaticResource booksData}" FontSize="20" Foreground="Red" VerticalAlignment="St
阅读全文
摘要:private void FillGridRandomly() { rowsColsSet = new HashSet<XY>(); if (gd != null) { gd.Children.Clear(); } for (int i = 0; i < 50; i++) { while (true
阅读全文
摘要://custom control <UserControl x:Class="WpfApp389.ElpImageTbk" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schema
阅读全文
摘要:<ListBox.ItemTemplate> <DataTemplate> <local:ImageTbk UCImgUrl="{Binding DataContext.ImgUrl, RelativeSource={RelativeSource Mode=FindAncestor,Ancestor
阅读全文
摘要:When an items control is using a virtualizing panel and it contains a large number of complex items, setting IsDeferredScrollingEnabled to true can re
阅读全文
摘要://xaml <Window x:Class="WpfApp386.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要:public class MyData : ObservableCollection<string> { public MyData() { for(int i=0;i<100000;i++) { Add($"{i+1}__{Guid.NewGuid().ToString("N")}"); } }
阅读全文
摘要:<ListBox x:Name="lbx" SelectedIndex="0" ItemsSource="{Binding BooksCollection,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VirtualizingPanel.IsCo
阅读全文
摘要:<ListBox x:Name="lbx" SelectedIndex="0" ItemsSource="{Binding BooksCollection,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VirtualizingPanel.IsCo
阅读全文
摘要://xaml <ListBox x:Name="lbx" SelectedIndex="0" ItemsSource="{Binding BooksCollection,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VirtualizingPan
阅读全文
摘要:private Color GetRndColor() { Color cr = new Color(); cr.A = 255; cr.R = (byte)(rnd.Next(0, 255)); cr.G = (byte)(rnd.Next(0, 255)); cr.B = (byte)(rnd.
阅读全文
摘要://usercontrol.xaml <UserControl x:Class="WpfApp381.ElpImgTbk" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schema
阅读全文
摘要://converter using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.T
阅读全文
摘要://Register Messenger.Default.Register<object>(this, "ShowItemsCountToken", ShowItemsCount); //Send Messenger.Default.Send<object>(obj, "ShowItemsCount
阅读全文
摘要:<ListBox.ContextMenu> <ContextMenu> <MenuItem Header="Export NewtonSoftJson" FontSize="50" Foreground="Red" Command="{Binding ExportNewtonJsonCmd}" Co
阅读全文
摘要://usercontrol xaml <UserControl x:Class="WpfApp379.ImgTbk" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.m
阅读全文
摘要://xaml <Window x:Class="WpfApp378.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要:Script Error,An error has occured in the script on this page. Do you want to continue running scripts on this page? //xaml <Window x:Class="WpfApp378.
阅读全文
摘要:<Window x:Class="WpfApp377.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<Window x:Class="WpfApp375.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<Window x:Class="WpfApp372.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要://App.xaml <Application x:Class="WpfApp369.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.co
阅读全文
摘要://xaml <DataGrid.ContextMenu> <ContextMenu> <MenuItem Header="Serialize Binary" Command="{Binding BinSerializeCmd}" CommandParameter="{Binding Relativ
阅读全文
摘要://xaml <Window x:Class="WpfApp367.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要:Managed Debugging Assistant 'ContextSwitchDeadlock' : 'The CLR has been unable to transition from COM context 0x28ab560 to COM context 0x28ab4a8 for 6
阅读全文
摘要:public DelCmd ExportAllCmd { get; set; } public DelCmd ExportAllBinaryFormatterCmd { get; set; } public DelCmd DeserializeJsonFileCmd { get; set; } pu
阅读全文
摘要:Install-package newtonsoft.json <DataGrid.ContextMenu> <ContextMenu> <MenuItem Header="Export Selected" Command="{Binding ExportSelectedCmd}" CommandP
阅读全文
摘要:<ListBox ItemsSource="{Binding BooksCollection,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> <ListBox.ItemTemplate> <DataTemplate> <Viewbox> <loc
阅读全文
摘要:DataGridTemplate.CellTemplate contains one datatemplae will display the customoized control,the key located at the custom control's dependency propert
阅读全文
摘要:add default command timeout=0 as below string connStr = "Server=localhost;database=mydb;username=root;pwd=root;default command timeout=0";
阅读全文
摘要:use mydb; drop table if exists t1; create table t1 (id int auto_increment primary key, firstname varchar(100) not null default '', lastname varchar(10
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System
阅读全文
摘要:1.New Console application; 2.Add reference,PresentationCore and WindowsBase 3. using System; using System.Collections.Generic; using System.Linq; usin
阅读全文
摘要:<DataGridTemplateColumn> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Image Source="{Binding ImgUrl}" Width="200" Height="500"> <behavior:Int
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace
阅读全文
摘要:using System.Diagnostics; // See https://aka.ms/new-console-template for more information Console.WriteLine("Hello, World!"); string path= @"..\..\..\
阅读全文
摘要:<DataGridTemplateColumn Header="Image" > <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Image Source="{Binding ImgUrl}" Width="20" Height="50">
阅读全文
摘要:private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.A && e.KeyboardDevice.Modifiers == ModifierKeys.Control) { MessageBox.Sh
阅读全文
摘要:public MainWindow() { InitializeComponent(); this.AddHandler(ListBox.SelectionChangedEvent, new SelectionChangedEventHandler(GenericHandler)); this.Ad
阅读全文
摘要:<Window x:Class="WpfApp340.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:<Window x:Class="WpfApp333.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要://xaml <UserControl x:Class="WpfApp332.BtnTbk" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com
阅读全文
摘要://xaml <Window x:Class="WpfApp332.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要:<Window x:Class="WpfApp330.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要://server using System; using System.Net; using System.Net.Sockets; using System.Text; namespace ConsoleApp63 { internal class Program { static void Ma
阅读全文
摘要://Runtime project,c class library using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text;
阅读全文
摘要:Blob stands for binary large object byte[] bytesArr= (byte[])rows[i]["congest"]; bk.Congest = Encoding.UTF8.GetString(bytesArr) public static DataSet
阅读全文
摘要://sql drop database if exists mydb; create database mydb; use mydb; drop table if exists mt; create table mt (id int auto_increment primary key, name
阅读全文
摘要:namespace ConsoleApp59 { internal class Program { static string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly
阅读全文