在我的wpf应用程序中,我使用Caliburn Micro。现在我创建了一个名为VariableView.xaml的UserControl。Caliburn Micro将查找相应的VariableViewModel.cs。这里没有问题。VariableViewModel类有三个属性,视图使用它们来绑定: VariableName、VariableValue和VariableUnit。例如,对于温度,它们被设置为“温度”、"40.5“和"°C”。 在我的MainViewModel.cs中,我使用VariableViewModel三次。 public class MainView
在用于其他框架的其他MVVM API中,例如Caliburn Micro for WPF,您可以子类视图模型。举个例子,我有一个视图模型
Customer
Id : int
Selected : bool
Name : string
Edit : ViewModel
根据不同的客户类型,我会有不同的编辑ViewModels,在Caliburn micro中,它会根据ViewMOdel的类型自动呈现正确的视图,类型在JS中当然不存在,但您能在Knockout中以某种方式实现这一点吗?
我有一个WPF Caliburn.Micro应用程序。下面是我的代码的一部分:
protected override void OnViewLoaded( object view )
{
base.OnViewLoaded( view );
var firstDataEntryVM = new FirstDataEntryViewModel();
ActivateItem(firstDataEntryVM);
这会导致
A first chance exception of type 'System.NullReferenceException&
在我的WPF应用程序中,我试图将控件“ProgressBar”中的属性“Maximum”绑定到ViewModel中的属性(借助Caliburn.micro)。
视图(xaml):
<ProgressBar x:Name="CurrentProgress"/>
ViewModel:
private int currentProgress;
public int CurrentProgress
{
get { return currentProgress; }
set
{
if (currentProgress == value)
{
我开始学习MVVM,我决定选择来尝试一下。我只是在 (甚至在那之前)。我正在打开这个项目。首先,我收到一个错误,说我需要安装一些silverlight的东西。安装了它们。现在我才明白
One or more projects in the solution were not loaded correctly.
// output window
D:\ResourceLibrary\Frameworks\Caliburn.Micro\src\Caliburn.Micro.WP7\Caliburn.Micro.WP7.csproj : error : The project file '