Open Child Window Standard

Disclaimer: I'm still learning MVVM and WPF so this might just be a ICommand vs RelayCommand question for all I know. I'm not using a MVVM framework or the like, just VS2010. Currently I have a MainWindow with a Login button that opens a child window. I've been able to make this happen by using either: standard ICommand that has all the code for opening the menu in the Command f

打开儿童窗口标准

免责声明:我仍然在学习MVVM和WPF,所以这可能只是一个ICommand和RelayCommand的问题。 我没有使用MVVM框架或类似的东西,只是VS2010。 目前我有一个带登录按钮的MainWindow,可以打开一个子窗口。 我已经能够通过使用以下任一方式来实现这一点: 标准ICommand,它具有在Command文件中打开菜单并使用StaticResource绑定和键(ViewModel中无代码)查看XAML的所有代码。 定义标准RelayCommand的RelayCommand命令文件,定义

Close window MVVM style

I'm programming an application in WPF which uses the MVVM concept. I'm trying to have no code-behind, and trying to keep my ViewModels and Views fully seperated. This means that I have to handle closing windows in xaml. I want to execute a relaycommand, when I close the window, but only if I press "OK". If I press Cancel, the command must not be executed. I have tried ex

关闭窗口MVVM样式

我正在使用MVVM概念编写WPF中的应用程序。 我试图没有代码隐藏,并试图保持我的ViewModels和视图完全分离。 这意味着我必须处理xaml中的关闭窗口。 当我关闭窗口时,我想执行一个继电器命令,但只有按下“确定”时才会执行。 如果我按取消,则不能执行该命令。 当触发器“IsClosing”上的窗口时,我试过执行relaycommand,但这不起作用,因为当按下“Cancel”时也会执行该命令。 我知道你可以发送视图作为继电器命令的参数,

WPF MVVM Modal Overlay Dialog only over a View (not Window)

I'm pretty much new to the MVVM architecture design... I was struggling lately to find a suitable control already written for such a purpose but had no luck, so I reused parts of XAML from another similar control and got make my own. What I want to achieve is: Have a reusable View (usercontrol) + viewmodel (to bind to) to be able to use inside other views as a modal overlay showing a di

WPF MVVM模态叠加对话框仅在视图(而非窗口)

我对MVVM架构设计非常陌生...... 最近我在努力寻找一个已经为此目的而编写的合适的控件,但没有运气,所以我从另一个类似的控件中重用了部分XAML,并取得了自己的成果。 我想要达到的是: 有一个可重复使用的View(usercontrol)+ viewmodel(绑定到)可以在其他视图中用作模式覆盖图,显示禁用其余视图的对话框,并显示对话框。 我想如何实现它: 创建一个视图模型,它接受字符串(消息)和动作+字符串集合(按钮)

Handling the window closing event with WPF / MVVM Light Toolkit

I'd like to handle the "Closing" event (when a user clicks the upper right 'X' button) of my window in order to eventually display a confirm message or/and cancel the closing. I know how to do this in the code-behind : subscribe to the "Closing" event of the window then use the "CancelEventArgs.Cancel" property. But I'm using MVVM so I'm not s

使用WPF / MVVM Light Toolkit处理窗口关闭事件

我想处理窗口的“关闭”事件(当用户点击右上角的'X'按钮),以便最终显示确认消息或/并取消关闭。 我知道如何在代码隐藏中做到这一点:订阅窗口的“关闭”事件,然后使用“CancelEventArgs.Cancel”属性。 但是我使用MVVM,所以我不确定这是不错的方法。 我认为好的方法是将Closing事件绑定到我的ViewModel中的Command中。 我试过了: <i:Interaction.Triggers> <i:EventTrigger EventName="Clo

WPF ICommand MVVM implementation

So in this particular MVVM implementation I'm doing, I need several commands. I really got tired of implementing the ICommand classes one by one, so I came up with a solution, but I don't know how good it is, so the input of any WPF expert here will be greatly appreciated. And if you could provide a better solution, even better! What I did is a single ICommand class and two delegates

WPF ICommand MVVM实现

所以在这个特定的MVVM实现中,我需要几个命令。 我真的厌倦了逐个实现ICommand类,所以我想出了一个解决方案,但我不知道它有多好,所以任何WPF专家的输入将不胜感激。 如果你能提供更好的解决方案,甚至更好! 我所做的是一个ICommand类和两个将对象作为参数的委托,一个委托是void(用于OnExecute),另一个是用于OnCanExecute的bool。 所以在我的ICommand(由ViewModel类调用)的构造函数中,我发送了两个方法,并在每个

WPF MVVM: How to close a window

I have a Button that closes my window when it's clicked: <Button x:Name="buttonOk" IsCancel="True">Ok</Button> That's fine until I add a Command to the Button ie <Button x:Name="buttonOk" Command="{Binding SaveCommand}" IsCancel="True">Ok</Button> Now it doesn't close presumably because I am handling the Command . I can fix this by putti

WPF MVVM:如何关闭一个窗口

点击时,我有一个Button可以关闭我的窗口: <Button x:Name="buttonOk" IsCancel="True">Ok</Button> 这很好,直到我添加一个Command Button ie <Button x:Name="buttonOk" Command="{Binding SaveCommand}" IsCancel="True">Ok</Button> 现在它不能关闭,大概是因为我正在处理Command 。 我可以通过将EventHandler放入并调用this.Close()即可解决此问题 <Button x:Name="bu

Good or bad practice for Dialogs in wpf with MVVM?

I lately had the problem of creating add and edit dialogs for my wpf app. All I want to do in my code was something like this. (I mostly use viewmodel first approach with mvvm) ViewModel which calls a dialog window: var result = this.uiDialogService.ShowDialog("Dialogwindow Title", dialogwindowVM); // Do anything with the dialog result How does it work? First, I created a dialog service:

用MVVM与wpf对话的好习惯或不好的做法?

我最近遇到了为我的wpf应用程序创建添加和编辑对话框的问题。 我想在我的代码中做的就是这样的。 (我主要使用mvvm的viewmodel第一种方法) 调用对话窗口的ViewModel: var result = this.uiDialogService.ShowDialog("Dialogwindow Title", dialogwindowVM); // Do anything with the dialog result 它是如何工作的? 首先,我创建了一个对话服务: public interface IUIWindowDialogService { bool? ShowDialog(s

Whole one core dedicated to single process

Is there any way in Linux to assign one CPU core to a particular given process and there should not be any other processes or interrupt handlers to be scheduled on this core? I have read about process affinity in Linux Binding Processes to CPUs using the taskset utility but that's not solving my problem because it just try to affine the given process to that core but it is possible that oth

整个一个核心致力于单一过程

在Linux中有没有办法将一个CPU内核分配给特定的给定进程,并且不应该在此内核上安排任何其他进程或中断处理程序? 我已经阅读了使用taskset实用程序在Linux 绑定进程到CPU的过程关联性,但这并不能解决我的问题,因为它只是试图将给定的进程仿射到该内核,但可能在此内核上安排其他进程 ,这是我想避免的。 我们是否应该更改内核代码进行调度? 就在这里。 事实上,有两种独立的方式来做到这一点:-) 现在,完成你想要的

Visual Studio debugger crashes when viewing a variable

Below is what I get shortly before VS Debugger crashes. When i don't have the debugger view it, it throws a segfault in the set function. The debugger has been working all day, on this same stuff too. Any ideas? Object i am viewing: [DataContract] public class SvnUrl { public string _type; public string _acronym; public string _location; public string _url; public i

查看变量时,Visual Studio调试器崩溃

以下是我在VS Debugger崩溃之前得到的内容。 当我没有调试器查看它时,它会在set函数中抛出一个segfault。 调试器整天都在工作,也在这个相同的东西上。 有任何想法吗? 我正在查看的对象: [DataContract] public class SvnUrl { public string _type; public string _acronym; public string _location; public string _url; public int _foundstatus; [DataMember] public string type

Getting stack overflows with a CUDA kernel

I have a huge problem with the code I am programming. I am not an expert, and i asked many people before coming here. corrected a lot of things, too. So, I guess I am ready to show you the code and ask you my questions. I will put the entire code here, as a way to make you understand well what my problem is. The thing i wanna do there is, if ARRAY_SIZE is too big for the THREAD_SIZE, so I pu

使用CUDA内核获取堆栈溢出

我正在编程的代码有一个很大的问题。 我不是专家,在来这里之前我问过很多人。 也纠正了很多事情。 所以,我想我已经准备好向您展示代码并向您提出我的问题。 我将把整个代码放在这里,以便让你很好地理解我的问题。 我想要做的事情是,如果ARRAY_SIZE对于ARRAY_SIZE来说太大了,那么我把大数组的数据放到一个更小的数组中,这个数组是专门用THREAD_SIZE大小THREAD_SIZE 。 然后,我将它发送给内核并执行我必须做的任何事