自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 资源 (2)
  • 收藏
  • 关注

原创 CLI out

void foo(Bar^% x);transforms intoVoid foo(ref Bar x);----------------------------------------------------------------------------------------------------------------------------------------------------Void foo(out Bar x);transforms intousi..

2020-07-24 19:59:39 174

原创 C# 避免出现数组越界错误

需要对长度进行判断,如果下标越界,会出错:List<string> test = new List<string>();test.Add("beijing");test.Add("shanghai");test.Add(null);test.Add("quzhou");if (test.Count() >= 4){ string a = test[2] == null ? "" : "hello"; string b = test[3] ==

2020-05-22 22:41:12 2656

原创 wpf 资源字典作为类库,在程序集间共享资源

背景前提:将不同类库共同使用的资源文件,放在一个类库中。在需要使用时,引用这个类库;工程结构:其中ResourceDictionary为exe程序,引用了Style类库和User类库;同时User类库引用了Style类库,为了使用Style类库中的样式;App.xaml<Application x:Class="ResourceDictionary.App" xmlns="http://schemas.microsoft.com/winfx/2006

2020-05-13 21:37:53 1667

原创 WPF TextBlock文本对齐问题

<Grid Background="Gray"> <Grid Height="30" Width="200" Background="Wheat"> <Canvas x:Name="canvas"> <Ellipse Width="20" Height="20" Stroke...

2020-04-26 21:54:25 2362

转载 WPF 中双向绑定通知机制之ObservableCollection使用

WPF 中双向绑定通知机制之ObservableCollection使用</div>  msdn中   ObservableCollection<T> 类    表示一个动态数据集合,在添加项、移除项或刷新整个列表时,此集合将提供通知。在许多情况下,所使用的数据是对象的集合。&nbsp...

2020-03-07 18:57:58 864

原创 WPF中的Binding:单个属性绑定与变化

绑定到非元素对象唯一的要求是希望显示的信息必须存储在公有属性中。WPF数据绑定基础结构不能获取私有信息或公有字段。<Window x:Class="Wpf_ObservableCollection.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...

2020-03-07 12:44:32 775

原创 Polygon:鼠标手动画线+数据绑定

<Window x:Class="Polygon.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="ht...

2020-02-21 17:14:24 405

原创 Data Bingding:获取Code-behind数据

<Window x:Class="DataBinding.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d...

2020-02-21 16:58:59 120

原创 MVVM Prism WPF - Setting a public property and SetProperty

xaml中的变量与ViewModel中的公用属性绑定,当修改了公用属性时,xaml中绑定的值也会随之变化。注意:不是绑定字段。(this.Name = "hh"; 正确,触发通知) (this.name= "hh"; 错误,不会触发通知)using System.Windows;namespace PropertyChange{ /// <summary...

2020-01-14 19:00:49 572

原创 WPF:AvalonDock template ILayoutUpdateStrategy

参考文章:https://stackoverflow.com/questions/35335465/avalondock-ilayoutupdatestrategy-example-needed

2020-01-09 20:52:42 212

原创 WPF:Pan & Zoom Image

效果图:完整工程:参考文章:https://stackoverflow.com/questions/741956/pan-zoom-imageWPF编程宝典里说道ViewBox类,待看

2020-01-09 20:44:18 378

原创 WPF:Toggle button in

效果图:工程:<Window x:Class="ToggleButton.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"...

2020-01-09 20:42:25 555

原创 WPF:Command传递两个元素

//MainWindow.xaml<Window x:Class="Command_MultiElement.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/20...

2020-01-09 20:37:30 431

原创 C# 工程release模式下怎么进行debug调试

简单来说:Properties--Build--Advanced按钮--DebugInfo--将none替换成full,这样就可以生成pdb文件,用于Release下调试原因:主要是Debug,程序使用完整的符号调试信息进行编译,而不进行优化。而Release,对代码进行优化,优化使调试复杂化,因为源代码和生成的指令之间的关系更复杂。参考文章:https://docs.micr...

2020-01-09 20:02:39 2470

原创 CLI通过函数将C++自定义变量赋值给CLI自定义变量

// CLI-FunctionParameterPass.cpp : main project file.#include "stdafx.h"#include <iostream>#pragma managed#include <msclr\marshal_cppstd.h>using namespace System;using namespace ...

2020-01-09 19:53:36 206

原创 vtk获取内存中图像数据(灰度图和彩色图)

CMakeList.txtcmake_minimum_required(VERSION 2.8)PROJECT(GrayImageImport)find_package (Qt4 REQUIRED)include_directories ( ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${QT_QTCORE_INCLUDE_D...

2019-06-18 13:00:06 1252

翻译 必须返回对象时,别妄想返回其reference(static用法陷阱)

根据条款21的说明。实现了static版本的代码class Rational{public: Rational(){} Rational(int numerator/* = 0*/, int denominator = 5) { numerator1 = numerator; denominator1 = denominator;

2017-11-08 21:25:13 322

原创 Effective C++ 条款12:复制对象时勿忘其每一个成分 学习笔记

对Effective C++的条款12:复制对象时勿忘其每一个成员 学习笔记

2017-10-16 21:34:50 673

原创 Qlist赋值问题

QList list; list.append("item1"); list.append("item2"); list.append("item3"); list.append("item4"); for(int i=0; i<list.size(); i+=1) { qDebug()<<""<<list.at(i); }

2017-08-22 16:40:34 12593

转载 QT通过线程将数据传递给主函数进行显示

根据别人的代码,自己重新写一次加深印象。头文件mainwindow.h#ifndef MAINWINDOW_H#define MAINWINDOW_H#include #include #include #include #include #include class Thread : public QThread{ Q_OBJECTpublic:

2017-07-19 13:18:41 3518

转载 利用QT的QThread将一个类中的成员函数转到线程下执行

#include "displaythread.h"#include "mainwindow.h"DisplayThread::DisplayThread(MainWindow *pWindow, QObject *parent) : QThread(parent){ m_pWindow = pWindow;}void DisplayThread::run(){

2017-04-17 09:58:28 10197 7

转载 C++贪吃蛇编程过程

1、贪吃蛇类:数据成员:蛇头指针head、移动方向Direction(1,2,3,4对应上左下右)、蛇长Count、速度Speed(等级)、食物存在标记FoodExist、食物X坐标Food_x、食物Y坐标Food_y   成员函数:Sneak()构造函数:起始不存在食物、申请起始蛇身3节、方向为右、长为3、等级1void Map()画界面函数:坐标是向右为x轴,向下为y轴;x(1-50)

2016-08-01 13:57:28 497

ResourceDictionary.rar

程序将不同WPF类库中相同的资源文件提取出来,放到单独的WPF类库中,当工程中的类库需要这个资源时,可以通过添加引用的方式,同时在资源列表中声明这个资源文件后,就可以使用这个资源文件内部的样式。

2020-05-13

Command_MultiElement.rar

WPF:Command传递两个元素,通过MVVM实现,CommandParameter中添加两个xaml中的变量,在ViewModel中处理这两个变量

2020-01-09

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除