catel

SplashScreenService doesn't work as I want

非 Y 不嫁゛ 提交于 2020-01-06 14:46:24
问题 I am trying to get the SplashScreenService up and running. It does show my splashscreen, but it doesn't close, never. I have this code in app.xaml.cs: protected override void OnStartup(StartupEventArgs e) { ServiceLocator.Default.RegisterTypeIfNotYetRegistered<ISplashScreenService, SplashScreenService>(); var splashScreenService = ServiceLocator.Default.ResolveType<ISplashScreenService>(); splashScreenService.Enqueue(new ActionTask("Task1", tracker => Thread.Sleep(2000))); splashScreenService

Why CanxxxCommandExecute is fired so much times?

ぃ、小莉子 提交于 2020-01-05 12:58:36
问题 I've got some problems with Commands and their CanXXXExecute... I was thinking it was a Catel (MVVM framework) problem but I've tested myself with a standard WPF application and it still happen.. In the example I'm posting I've got the "CanClickCommandExecute" method called 2 times at load (one at constructor and I agree with this, the other one I think at view's load) and 3 times when I click the button!! Here's the XAML <Window x:Class="StandardWPF.MainWindow" xmlns="http://schemas

Binding from within a ResourceDictionary in a Catel WPF UserControl

老子叫甜甜 提交于 2020-01-04 14:17:31
问题 I am converting some of the views and view models of our WPF application over to Catel, as a proof-of-concept. One of the user controls doesn't seem to be correctly binding to the view model at runtime. I think I understand why that is, but would like to get some feedback on what the best remedy is. The code I have a simple view whose model is actually an ObservableCollection : PersonTable.xaml Key things to note: I'm using a CollectionViewSource that wraps the main collection that the

MissingManifestException in mscorlib.dll on IMessageService.ShowXXXX

ぐ巨炮叔叔 提交于 2019-12-13 07:17:03
问题 In my view model, I have a IMessageService, which is initialized in the constructor: private IMessageService messageService; public MyViewModel() { messageService = ServiceLocator.Default.ResolveType<IMessageService>(); } Its Show method works, but ShowError, ShowInformation and ShowWarning (anything in need of a resource, here the icons) crash with a MissingManifestException pointing towards Catel.Properties.Resources.resources manifest. Is the error on my side (wrongly installed Catel) or

Catel/Ninject: Ninject.ActivationException when resolving IUIVisualizerService

怎甘沉沦 提交于 2019-12-12 05:54:11
问题 when i was trying to resolve the IUIVisualizerService a Ninject.ActivationException came up in Ninject.dll. Can someone help me pls? This code section calls the problem: NinjectDependencyResolver resolver = new NinjectDependencyResolver(); var item = resolver.GetService<IUIVisualizerService>(); Code for Resolver: using System; using System.Collections.Generic; using Catel.Services; using Ninject; using NLog; namespace MS_Modell.Infrastructure { internal class NinjectDependencyResolver {

SerializationException on Catel auto create of ViewModel with EF Entity Model

折月煮酒 提交于 2019-12-12 04:58:03
问题 When Catel attempts to auto create an instance of the ViewModel class belonging to a view I get a SerializationException complaining that System.Data.Entity.DynamicProxies is not expected. The Model is an EF 6.1 Entity (inherits from ModelBase) and I am using Catel 3.9. How do I prevent this ? 回答1: Note: this all applies to Catel 4.0 (latest prerelease versions, since that is stable and has much improvements). Catel serializes the model for the purpose of the IEditableObject implementation.

CanExecute method of command not firing after update to Catel 4.4.0

喜夏-厌秋 提交于 2019-12-12 02:37:03
问题 I've recently updated my application from Catel 3.9.0 to 4.4.0. Things are generally working well with the exception of a Print button which appears on most of my views. The application lets the Customer select and load a text file which is then parsed and validated. If there are any errors, they are displayed in the View in a grid control. Displaying any errors should also enable a Print button to let the Customer preview and print a report of the errors. The View architecture is: MyView

Catel ViewToViewModel attribute

走远了吗. 提交于 2019-12-12 02:24:37
问题 Thank you so much for your help. I'm trying to understand the ViewToViewModel attribute by getting a small example to work. I've go a couple of questions. My code is below. Is the [ViewToViewModel] attribute supposed to be placed to be placed in the View, ViewModel or both? If I try to use an attribute, MappingType, such as: [ViewToViewModel, MappingType = ...] MappingType gives me an error. Am I missing a "using" statement/Assembly Reference? Is there an example of syntax? I'm able to get

Get a property of a tabitem's viewmodel when it's selected

僤鯓⒐⒋嵵緔 提交于 2019-12-12 01:48:56
问题 I have a UserControl ParentView containing a DataGrid and a catel:TabControl , in which each TabItem is a tiny UserControl and whose ViewModel is a subclass of a BaseTabViewModel . This BaseTabViewModel contains a ObservableCollection of a custom class, whose properties will generate the columns of the DataGrid . Since I have only one DataGrid for all tabs, how can I fill it with the ObservableCollection of selected tab's viewmodel automatically? Right now, I just unload tabs ( LoadTabItems=

How Instantiate Control Programmatically in Catel

淺唱寂寞╮ 提交于 2019-12-11 19:46:39
问题 I am trying to dynamically create and load controls into a data window. I have tabs across the top which are different types of reports. I want to be able to create new reports without having to remember to add them to the tab control. I am trying to do this using a factory, using reflection to identify views that implement a certain interface. Once the controls are instantiated (code below) I want to wrap them in a TabItem and add them to my tab control. Here's the Factory: class