小编Jul*_*bre的帖子

git commit message显示文件被复制而不是被修改.有什么影响?

git status显示文件已修改,但是在提交时显示文件已被复制,即:

git status
modified:foo/bar/baz.xml

git commit
复制:bar/foo/baz.xml - > foo/bar/baz.xml

如果不是,为什么将此文件显示为已复制.在更改之前,这两个文件是相同的.

git

32
推荐指数
1
解决办法
1万
查看次数

错误"包含类功能的模板必须以类功能结束"

当我得到以下compilaton错误时,我正在Visual Studio 2010下开发一个C#T4预处理模板:

包含类功能的模板必须以类功能结束

.net c# t4 compiler-errors visual-studio-2010

16
推荐指数
1
解决办法
4613
查看次数

在 Visual Studio 2022 的程序集中定义基本表单时,无法在表单设计器中显示继承的表单

MyForm继承自Form。我能够在VS2022应用程序中继承MyForm。但是,如果 MyForm 在库内,并且我的 VS2022 应用程序尝试创建从 MyForm 继承的表单,则会出现错误:

“无法显示此文件的设计器,因为无法设计其中的任何类。设计器检查了文件中的以下类: --- 无法加载基类 ''。确保已引用程序集并且所有项目都已建成。”

我认为这是 VS2022 最新版本中的一个错误。我在 Visual Studio 2019/2010 中没有遇到任何问题,解决此问题的任何解决方案都会很棒。

谢谢

c# vb.net forms inherited visual-studio-2022

5
推荐指数
1
解决办法
1249
查看次数

值不能为空.参数名称:key(仅在XAML Designer的设计视图中发生)

XAML Designer设计视图显示

抛出异常

ArgumentNullException:值不能为null.

参数名称:key

StackTrace(见照片后)

InnerException:无

在以下问题上我一直在苦苦挣扎几天,这使我无法在每个受影响的视图上使用XAML Designe r的设计视图.

昨天,我最终设法隔离了这个特别难以追踪的奇怪行为,因为它只在设计时发生,而且这似乎是泛型类型和DataGrid的ItemsSource属性(System.Windows.Controls)之间的混淆.

所以,这就是设计视图中显示的内容

在此输入图像描述

2.FindEntry(TKey key) at System.Collections.Generic.DictionarySystem.Wolows.Controls.DataGridRow.RestoreAttachedItemValue(DependencyObject)的System.Windows.Controls.DataGridItemAttachedStorage.TryGetValue(Object item,DependencyProperty property,Object&value)的System.Collections.Generic.Dictionary 2.TryGetValue(TKey key,TValue&value)在System.Windows.Coninds.Controls.DataPrid上的System.Windows.Controls.DataGridRow.PrepareRow(Object item,DataGrid owningDataGrid)的System.Windows.Controls.DataGridRow.SyncProperties(Boolean forcePrepareCells)中的objectWithProperty,DependencyProperty属性(DependencyObject元素, System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject)中System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer(DependencyObject容器,Object项)的对象项) System.Windows.Controls.VirtualizingStackPanel.InsertContainer(Int32 childIndex,UIElement)中的容器)System.Windows.Controls.VirtualizingStackPanel.AddContainerFromGenerator(Int32 childIndex,UIElement child,Boolean newRealized,Boolean isBeforeViewport)处理System.Windows.Controls.VirtualizingStackPanel.MeasureChild(IItemContainerGenerator&generator,IContainItemStorage&itemStorageProvider,IContainItemStorage&parentItemStorageProvider,Object&parentItem)中的container,Boolean isRecycled) ,布尔和hasUniformOrAverageContainerSizeBeenSet,双&computedUniformOrAverageContainerSize,双&computedUniformOrAverageContainerPixelSize,布尔和computedAreContainersUniformlySized,IList中和项目,对象和项目,IList的和孩子,的Int32&childIndex,布尔和visualOrderChanged,布尔和isHorizo​​ntal,大小和childConstraint,矩形和视口,VirtualizationCacheLength&CACHESIZE,VirtualizationCacheLengthUnit&cacheUnit,布尔和foundFirstItemInViewport,双&firstItemInViewportOffset,大小和stackPixelSize,Size&stackPixelSizeInViewport,Size&stackPixelSizeInCacheBeforeViewport,Siz E&stackPixelSizeInCacheAfterViewport,大小和stackLogicalSize,大小和stackLogicalSizeInViewport,大小和stackLogicalSizeInCacheBeforeViewport,大小和stackLogicalSizeInCacheAfterViewport,布尔逻辑mustDisableVirtualization,布尔isBeforeFirstItem,布尔isAfterFirstItem,布尔isAfterLastItem,布尔skipActualMeasure,布尔skipGeneration,布尔逻辑hasBringIntoViewContainerBeenMeasured,在System.Windows.Controls.VirtualizingStackPanel.MeasureOverrideImpl布尔&hasVirtualizingChildren)(1& lastPageSafeOffset, ListSystem.Windows上的System.Windows.Controls.Primitives.DataGridRowsPresenter.MeasureOverride(大小约束)处的System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(大小约束)处的大小约束,Nullable 1和previousMeasuredOffsets,Nullable`1&lastPagePixelSize,Boolean remeasure). System.Windows.Ujelement.UpdateLayo上System.Windows.ContextLayoutManager.UpdateLayout()的System.Windows.UIElement.Measure(Size availableSize)上的FrameworkElement.MeasureCore(Size availableSize)UT()

示例项目源代码

MyViewModelbase.cs(这是我的通用视图模型库)

namespace BugProof.ViewModels
{
    using System.Collections.Generic;

    public class MyViewModelBase<TItem> where TItem : class
    {
        public List<TItem> Items { get; set; }
        public MyViewModelBase() { }
    }
}
Run Code Online (Sandbox Code Playgroud)

MyExtendedViewModel.cs(这是我的扩展视图模型,它将基于 …

c# wpf xaml datagrid designer

4
推荐指数
1
解决办法
6148
查看次数