草庐IT

WPF-dataGrid

全部标签

c# - 如何制作 WPF Expander Stretch?

WPF中的Expander控件不会拉伸(stretch)以填充所有可用空间。XAML中是否有针对此的任何解决方案? 最佳答案 您需要做的就是:Iamsomecontent...http://joshsmithonwpf.wordpress.com/2007/02/24/stretching-content-in-an-expander-header/ 关于c#-如何制作WPFExpanderStretch?,我们在StackOverflow上找到一个类似的问题:

c# - 我如何知道 WPF 窗口是否打开

在WPF窗口中,我如何知道它是否打开?我的目标是一次只打开窗口的1个实例。所以,我在父窗口中的伪代码是:if(this.m_myWindow!=null){if(this.m_myWindow.ISOPENED)return;}this.m_myWindow=newMyWindow();this.m_myWindow.Show();编辑:我找到了解决我最初问题的解决方案。窗口.ShowDialog();它阻止用户打开任何其他窗口,就像模态弹出窗口一样。使用此命令,无需检查窗口是否已打开。 最佳答案 在WPF中,Application

c# - 我如何知道 WPF 窗口是否打开

在WPF窗口中,我如何知道它是否打开?我的目标是一次只打开窗口的1个实例。所以,我在父窗口中的伪代码是:if(this.m_myWindow!=null){if(this.m_myWindow.ISOPENED)return;}this.m_myWindow=newMyWindow();this.m_myWindow.Show();编辑:我找到了解决我最初问题的解决方案。窗口.ShowDialog();它阻止用户打开任何其他窗口,就像模态弹出窗口一样。使用此命令,无需检查窗口是否已打开。 最佳答案 在WPF中,Application

c# - 如何在 WPF/XAML 中绑定(bind)背景颜色?

我必须对以下代码进行哪些更改才能使背景为红色,我尝试过的两种方法均无效:(来源:deviantsart.com)XAML:代码隐藏:usingSystem.Windows;usingSystem.ComponentModel;namespaceTestBackground88238{publicpartialclassWindow1:Window,INotifyPropertyChanged{#regionViewModelProperty:Backgroundprivatestring_background;publicstringBackground{get{return_back

c# - 如何在 WPF/XAML 中绑定(bind)背景颜色?

我必须对以下代码进行哪些更改才能使背景为红色,我尝试过的两种方法均无效:(来源:deviantsart.com)XAML:代码隐藏:usingSystem.Windows;usingSystem.ComponentModel;namespaceTestBackground88238{publicpartialclassWindow1:Window,INotifyPropertyChanged{#regionViewModelProperty:Backgroundprivatestring_background;publicstringBackground{get{return_back

c# - ReSharper WPF错误: “Cannot resolve symbol ” MyVariable“due to unknown DataContext”

我在VisualStudio2012中使用WPF+XAML+MVVM时遇到此错误。Cannotresolvesymbol”MyVariable“duetounknownDataContext解决办法是什么? 最佳答案 ReSharper在为WPF设计XAML时会产生此错误,并且指示XAML找不到包含运行时绑定(bind)的类。这通常表明DataContext设置不正确。此错误意味着:用于XAML的Intellisense在设计时无法正常运行。在设计时,不能使用Ctrl单击XAML中的binding从XAML自动导航到C#类。当我们在

c# - ReSharper WPF错误: “Cannot resolve symbol ” MyVariable“due to unknown DataContext”

我在VisualStudio2012中使用WPF+XAML+MVVM时遇到此错误。Cannotresolvesymbol”MyVariable“duetounknownDataContext解决办法是什么? 最佳答案 ReSharper在为WPF设计XAML时会产生此错误,并且指示XAML找不到包含运行时绑定(bind)的类。这通常表明DataContext设置不正确。此错误意味着:用于XAML的Intellisense在设计时无法正常运行。在设计时,不能使用Ctrl单击XAML中的binding从XAML自动导航到C#类。当我们在

c# - C# wpf 中的确认框

这个问题在这里已经有了答案:IsthereaMessageBoxequivalentinWPF?(9个回答)关闭9年前。我想在C#代码中显示确认框。我已经看到上面的解决方案,但它显示"is"的异常,因为“System.Nullable”不包含"is"的定义。我应该如何消除这个错误?privatevoidlistBox1_MouseRightButtonDown(objectsender,MouseButtonEventArgse){if(senderisListBoxItem){ListBoxItemitem=(ListBoxItem)sender;Harvest_TimeSheetE

c# - C# wpf 中的确认框

这个问题在这里已经有了答案:IsthereaMessageBoxequivalentinWPF?(9个回答)关闭9年前。我想在C#代码中显示确认框。我已经看到上面的解决方案,但它显示"is"的异常,因为“System.Nullable”不包含"is"的定义。我应该如何消除这个错误?privatevoidlistBox1_MouseRightButtonDown(objectsender,MouseButtonEventArgse){if(senderisListBoxItem){ListBoxItemitem=(ListBoxItem)sender;Harvest_TimeSheetE

c# - .NET/C#/WPF 项目的命名约定

广泛接受的.NET/C#/WPF项目命名约定是什么? 最佳答案 Microsoft有一篇关于命名约定的广泛MSDN文章here. 关于c#-.NET/C#/WPF项目的命名约定,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/2846805/