我正在寻找一篇比较MVVM Light,Caliburn Micro,Prism和任何其他Silverlight/WPF/WP7框架的好文章.我已经看过一些关于它们的好文章,但没有任何真正使它们相互对立的文章.有什么建议?
这个问题已被问过几次,不幸的是答案只适用于WPF.任何人都知道如何在silverlight中实现这一目标?基本上我需要专注于代码中的某个文本框.
我开始使用MVVM Light版本4,我无法理解:
我正在研究WPF应用程序.我已经为此应用程序实现了错误处理并实现了错误邮件发送功能.因此,如果应用程序中发生任何错误,管理员将收到错误消息.我的问题是我们总是收到以下错误消息.
错误:没有足够的配额可用于处理此命令
System.Windows.Interop.HwndTarget.UpdateWindowPos上的System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget,Nullable`1 channelSet)中的MS.Win32.UnsafeNativeMethods.PostMessage(HandleRef hwnd,WindowMessage msg,IntPtr wparam,IntPtr lparam)在System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,Boolean&handling)的System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg,IntPtr wparam,IntPtr lparam)中的IntPtr lParam) MS.Win32.HwndWrapper.WndProc(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,Boolean&handling)位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(委托回调,对象)的MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)在MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(对象源,委托方法,对象args,Int32 numArgs,Delegate catchHandler)中的args,Int32 numArgs)
我们已经为此应用程序使用了MVVM light toolkit信使,任务等.我在应用程序中也有一个数据网格.
我们如何追踪此错误?任何人都知道这个"没有足够的配额可用错误"的原因?任何帮助都会很明显.提前致谢.
我正在使用MVVM Light来构建WP7(Windows Phone 7)应用程序.我希望模型执行的所有工作都在后台线程上运行.然后,完成工作后,引发一个事件,以便ViewModel可以处理数据.
我已经发现我无法从WP7应用程序异步调用委托.
目前我正在尝试使用ThreadPool.QueueUserWorkItem()在后台线程上运行一些代码,并使用MVVM Light的DispatcherHelper.CheckBeginInvodeOnUI()在UI线程上引发一个事件,以通知ViewModel数据已被加载(这会导致VS2010崩溃)和Blend 4在尝试显示设计时视图时).
是否有任何示例代码在后台线程上运行某些代码,然后将事件调度回UI线程以获取WP7应用程序?
杰夫,先谢谢你.
编辑 - 这是一个示例模型
public class DataModel
{
public event EventHandler<DataLoadingEventArgs> DataLoadingComplete;
public event EventHandler<DataLoadingErrorEventArgs> DataLoadingError;
List<Data> _dataCasch = new List<Data>();
public void GetData()
{
ThreadPool.QueueUserWorkItem(func =>
{
try
{
LoadData();
if (DataLoadingComplete != null)
{
//Dispatch complete event back to the UI thread
DispatcherHelper.CheckBeginInvokeOnUI(() =>
{
//raise event
DataLoadingComplete(this, new DataLoadingEventArgs(_dataCasch));
});
}
}
catch (Exception ex)
{
if (DataLoadingError != null)
{
//Dispatch error event back to the UI …Run Code Online (Sandbox Code Playgroud) c# multithreading compact-framework windows-phone-7 mvvm-light
我正在寻找一个样本,以最轻微的方式演示以下内容:
一个调用基于SOAP的Web服务的模型; 定期轮询以获取最新值(假设SOAP服务返回一个布尔值).该模型还应支持调用更改服务器上的布尔值的SOAP方法.
一个ViewModel,它允许底层布尔值绑定到View中的控件(例如,复选框).
具有上述复选框控件的视图绑定到基础布尔值.根据轮询间隔,复选框将随服务器状态的变化而更新.如果单击该复选框,则会将事件分派给模型,从而导致服务器更新.
最好这个样本可以在Windows Phone 7上运行,但是在紧要关头我会对支持SL3的东西感到满意(不允许使用SL4命令路由).
我正在努力学习如何让MVVM-Light为我工作,我怀疑专家可以很快地对这样的代码进行编码...我也怀疑这是很多应用程序的相当常见的模式.
我正在尝试学习MVVM Light,我正在寻找一个展示模型以及如何加载不同视图的基本示例.
我下载MVVM Light后看到的模板没有模型,只有一个视图.(http://www.galasoft.ch/mvvm/creating/)
我发现的其他东西更复杂,有点令人困惑,我想看到的只是基础知识.
谢谢.
我正在尝试将MapTileSource的DataSource绑定到我的视图模型上的属性,但是我在Maps上获得了错误REGDB_E_CLASSNOTREG:MapTileSource行(蓝色下划线是VS编辑器).我总是可以使用绑定帮助器来实现相同的效果(我需要在我的应用程序的8.0版本中),但这似乎应该只是...工作.知道什么是错的吗?
<Maps:MapControl Style="{Binding Path=MapStyle}" Center="{Binding Path=MapCenter, Mode=TwoWay}" ZoomLevel="{Binding Path=ZoomLevel, Mode=TwoWay}" MapServiceToken="">
<Maps:MapControl.TileSources>
<Maps:MapTileSource Layer="BackgroundReplacement" DataSource="{Binding Path=BaseLayerDataSource}" />
</Maps:MapControl.TileSources>
</Maps:MapControl>
Run Code Online (Sandbox Code Playgroud)
我也尝试使用具有相同效果的静态数据源:
<Maps:MapControl Style="{Binding Path=MapStyle}" Center="{Binding Path=MapCenter, Mode=TwoWay}" ZoomLevel="{Binding Path=ZoomLevel, Mode=TwoWay}" MapServiceToken="">
<Maps:MapControl.TileSources>
<Maps:MapTileSource Layer="BackgroundReplacement">
<Maps:MapTileSource.DataSource>
<Maps:HttpMapTileDataSource UriFormatString="" />
</Maps:MapTileSource.DataSource>
</Maps:MapTileSource>
</Maps:MapControl.TileSources>
</Maps:MapControl>
Run Code Online (Sandbox Code Playgroud)
编辑:我在http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn632728.aspx上尝试了示例代码,它运行正常,因此很明显MapTileSource本身未注册.但这就是所有代码隐藏,并且不使用数据绑定,因此对我来说没什么用处.
编辑2:如果我忽略错误并尝试将应用程序部署到手机模拟器,我会在视图的InitializeComponent()上得到这个:
An exception of type 'Windows.UI.Xaml.Markup.XamlParseException' occurred in HikePoint.exe but was not handled in user code
WinRT information: Cannot deserialize XBF metadata type list as '%1' was not found in namespace '%0'. [Line: 0 Position: 0] …Run Code Online (Sandbox Code Playgroud) 我想在新的Windows Phone 8.1 AutoCompleteBox Control的TextChange事件上调用一个命令.我正在使用MVVM Light.
我有一个WPF Mvvm-Light应用程序,它使用选项卡控件向用户显示不同的视图.
我遇到的问题是,当程序首次加载时,选项卡控件显示为空.但在本地调试时,这个问题永远不会发生 这个应用程序已经开发了一年多没有这个问题,突然间它开始发生.见下图

如果用户调整其窗口大小,则选项卡控件中的内容将刷新并显示,并且在打开应用程序时问题永远不会再次出现.但是这个问题在第一个程序加载和第一个标签加载(同时发生)的100%时间内发生
这是我如何定义插入到选项卡控件中的视图
<DataTemplate DataType="{x:Type FtcViewModel:DashboardNavViewModel}">
<FtcView:DashboardNav />
</DataTemplate>
Run Code Online (Sandbox Code Playgroud)
这是我的标签控件:
<TabControl Grid.Column="1" Grid.Row="3"
SelectedItem="{Binding CurrentViewModel}"
ItemsSource="{Binding OpenViewModelCollection}"
Style="{StaticResource TabControlStyle}"
ItemContainerStyle="{StaticResource TabItemStyle}" >
</TabControl>
Run Code Online (Sandbox Code Playgroud)
然后在我的主窗口视图模型中,我将一个集合分配给选项卡控件,默认情况下将dashbaord设置为第一个像这样打开的选项卡(试图只包含相关代码,很明显在viewModel文件中还有更多):
Public Property OpenViewModelCollection As ObservableCollection(Of ViewModelHelper)
Get
Return Me._OpenViewModelCollection
End Get
Set(value As ObservableCollection(Of ViewModelHelper))
If _OpenViewModelCollection Is value Then
Return
End If
_OpenViewModelCollection = value
RaisePropertyChanged(OpenViewModelCollectionPropertyName)
End Set
End Property
Public Property CurrentViewModel As ViewModelHelper
Get
Return Me._CurrentViewModel
End Get
Set(value As ViewModelHelper)
If _CurrentViewModel Is value Then …Run Code Online (Sandbox Code Playgroud) mvvm-light ×10
mvvm ×5
c# ×4
wpf ×4
silverlight ×3
bing-maps ×1
caliburn ×1
clickonce ×1
command ×1
vb.net ×1
windows-8.1 ×1