Giter Site home page Giter Site logo

catel / catel Goto Github PK

View Code? Open in Web Editor NEW
857.0 58.0 136.0 73.83 MB

An application development platform

Home Page: https://www.catelproject.com

License: Other

C# 99.99% PowerShell 0.01%
mvvm c-sharp catel xamarin wpf mvvm-architecture mvvm-framework uwp

catel's Introduction

Catel

Name Badge
Chat Join the chat at https://gitter.im/catel/catel
Downloads NuGet downloads
NuGet stable version Version
NuGet unstable version Pre-release version
MyGet unstable version Pre-release version
Open Collective Backers on Open Collective Sponsors on Open Collective

Catel is an application development platform with the focus on MVVM (WPF, UWP, Xamarin.Android, Xamarin.iOS and Xamarin.Forms). The goal of Catel is to provide a complete set of modular functionality for Line of Business applications written in any .NET technology, from client to server.

Catel distinguishes itself by unique features to aid in the development of MVVM applications and server-side application development. Since Catel focuses on Line of Business applications, it provides professional support and excellent documentation which ensures a safe bet by professional companies and developers.

For documentation, please visit the documentation portal

Features and components

Below are a few features that are available in Catel.

Catel.Core

Catel.Core is the library you want to include in all your projects, whether you are writing a UI project or not. It contains lots of useful helper methods. The most important features are listed below:

  • Argument validation (e.g. Argument.IsNotNull(() => myArgument))
  • Caching
  • Data (ModelBase, PropertyBag, Validation)
  • IoC (ServiceLocator, TypeFactory)
  • Logging (LogManager, Log, several log listeners)
  • Messaging
  • Reflection (same reflection API for every supported platform)
  • Serialization (BinarySerializer, XmlSerializer and more)
  • Weak references (WeakEventListener)

And more....

Catel.MVVM

Catel.MVVM is the library you want to include when you are writing a UI project (e.g. WPF, UWP, Xamarin) and you want to use the MVVM pattern. Catel is the only MVVM library that has context-aware view and view-model creation, which can be used to solve the nested user controls problem.

The most important features are listed below:

  • Auditing
  • Collections (FastObservableCollection)
  • Commands (Command, TaskCommand, etc)
  • Converters (tons of converters out of the box)
  • Services
    • CameraService
    • LocationService
    • MessageService
    • NavigationService
    • OpenFileService
    • PleaseWaitService
    • SaveFileService
    • UIVisualizerService
  • View models
    • Automatic validation
    • Automatic mappings from model to view model
  • Views
    • DataWindow
    • UserControl
    • Window

Example code

Models

This model has automatic change notifications and validation.

public class Person : ValidatableModelBase
{
    public string FirstName { get; set; }

    public string LastName { get; set; }

    protected override void ValidateFields(List<IFieldValidationResult> validationResults)
    {
        if (string.IsNullOrWhitespace(FirstName))
        {
            validationResults.Add(FieldValidationResult.CreateError(nameof(FirstName), "First name is required"));
        }

        if (string.IsNullOrWhitespace(LastName))
        {
            validationResults.Add(FieldValidationResult.CreateError(nameof(LastName), "Last name is required"));
        }
    }    
}

View models

This is a view model with:

  • Automatic injection of the DataContext
  • Automatic mapping of properties & validation from model => view model
public class PersonViewModel : ViewModelBase
{
    public PersonViewModel(Person person)
    {
        Argument.IsNotNull(() => person);

        Person = person;
    }

    [Model]
    private Person Person { get; set; }

    [ViewModelToModel]
    public string FirstName { get; set; }

    [ViewModelToModel]
    public string LastName { get; set; }
}

How to contribute

Support on Open Collective

Please consider supporting Catel on Open Collective.

Translating

To add translations to Catel, the Multilingual App Toolkit (MAT) is required.

  1. Download the MAT Editor
  2. Open your specific language (or create it) in the MultilingualResources folder, e.g. ./src/Catel.MVVM/MultilingualResources/Catel.MVVM.nl.xlf
  3. Edit the xlf file and create a pull request (PR) with only this file

Building Catel

Prerequisites

Catel requires Visual Studio 2019 to compile successfully. You also need to ensure you have the following features installed:

Note that the .vsconfig in the src root should notify about missing components when opening the solution.

  • .NET desktop development
  • Universal Windows Platform development
  • Mobile development with .NET
  • .NET Core cross-platform development
  • Select the following components from Individual components
    • Windows 10 SDK (10.0.16299.0)
    • MSVC v141 and v142 (ARM, ARM64 and x64/x86)
    • C++ ATL v141 and v142 (ARM, ARM64 and x86 & x64) build tools
    • C++ MFC v141 and v142 (ARM, ARM64 and x86 & x64) build tools
  • Latest Version of .NET Core 3.0 Preview SDK
    • Ensure you enable Use previews of the .NET Core SDK under Tools -> Options -> Projects and Solutions -> .NET Core

Note that you should run these commands using powershell in the root of the repository.

Running a build

.\build.ps1 -target build

Running a build with unit tests

.\build.ps1 -target buildandtest

Running a build with local packages

Note that this assumes a local packages directory at C:\Source\_packages, which can be added to the NuGet feeds:

.\build.ps1 -target buildandpackagelocal

Apps using Catel

There are a lot of (both free & commercial) apps using Catel. This list provides a few examples that are built with Catel:

// todo: add wpf

// todo: add uwp

WPF components based on Catel

If you are planning on using WPF, there is a huge set (60+) of free open-source components available based on Catel. All these open source are developed by a company called WildGums (see https://www.wildgums.com) and provided to the community for free. The components are well maintained and being used in several commercial WPF applications.

For more information, see https://github.com/wildgums

Tools for Catel

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! ๐Ÿ™ [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

catel's People

Contributors

afussit avatar alexfdezsauco avatar bertrandr avatar bigworld12 avatar danielkuehner avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar fxam avatar gautamsi avatar geertvanhorrik avatar github-actions[bot] avatar greenkn1ght avatar ikupriyanov avatar iselyakov avatar jensweller avatar jgoelten avatar johncbaur avatar lukekolodziej avatar mattiaseppler avatar mazzelfassel avatar mennodeij avatar michu avatar miktor avatar mkhomutov avatar rajivhost avatar simoncropp avatar szogun1987 avatar ttustonic avatar ziez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

catel's Issues

CTL-54: Can't create a New Windows Phone 7 Project in Visual Studio 2012

Jira issue originally created by user Hegi:

I've installed Catel 3.5 with the installer, then wanted to create a new Empty Windows Phone 7 Application with Catel.

First of all, there was no templates shown in the template selector by default. I had to search for "Catel" to the templates to be displayed.
After I created a new Windows Phone 7 Application with Catel (C#), I wanted to run the application, but there were some references missing.
I added the following libraries manually to the project. After that, the project complied.
C:\Program Files (x86)\Catel 3.5\libraries\WP7\Catel.Core.dll
C:\Program Files (x86)\Catel 3.5\libraries\WP7\Catel.MVVM.dll

After installing the example to an emulator however, the program would not start, simply exits.
If I create a new Windows Phone 8 Application with Catel (C#), the references are still missing.
If I add the same references from C:\Program Files (x86)\Catel 3.5\libraries\WP8, then the WP8 application is working fine.

I also tried the samples from Catel.Examples (checked out from github), end none of the three WP7 examples are working (BingMaps, Sensors, ShoppingList).

I also tried adding the references from NuGet, but the project still won't run.

CTL-35: Exception in ModelBase.ValidatePropertyUsingAnnotations

Jira issue originally created by user @GeertvanHorrik:

I have a problem in the method "ValidatePropertyUsingAnnotations" with properties exposed (Expose). Calling the method "ValidateProperty" throws an exception which considerably slows down the first display window.

To solve this problem, I have added a test before calling this method:

if(type.GetProperty(propertyName) != null)
{
System.ComponentModel.DataAnnotations.Validator.ValidateProperty(value, _dataAnnotationsValidationContext[propertyName]);

// If succeeded, clear any previous error
if (_dataAnnotationValidationResults.ContainsKey(propertyName))
{
     _dataAnnotationValidationResults[propertyName] = null;
}

}

Can you tell me if my correction is good, and it is possible to include it in a future version ?

CTL-3: SavableModelBase: how to serialize not-serializable properties?

Jira issue originally created by user @GeertvanHorrik:

Hi Geert,

cannot get it to work.Please check this sample (.NET console app)

Problems:1) when the NotSerializableUsingClassProperty exists, no instance of the Settings class is creatable.2) when the NotSerializableUsingInterface != null, serialization fails.3) the serialization should use the string-convert properties SerializeNotSerializableUsingInterface and SerializeNotSerializableUsingClass

thanks, alex.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using Catel.Data;

namespace CatelNotSerializableSpike
{
class Program
{
static void Main(string[] args)
{
var saveFileDPNE = System.Reflection.Assembly.GetExecutingAssembly().Location ".settings.xml";

    // create settings
    var settings = new Settings();
    settings.Name = "Test";
    settings.NotSerializableUsingInterface = new NotSerializable { Content = "some content on NotSerializableUsingInterface" };
    settings.NotSerializableUsingClass = new NotSerializable { Content = "some content on NotSerializableUsingClass" };

    // save it
    System.Diagnostics.Debug.WriteLine("Saving settings to: [" </ins> saveFileDPNE + "]");
    settings.Save(saveFileDPNE, SerializationMode.Xml);

    // load it
    var loadedSettings = Settings.Load(saveFileDPNE);
    Console.WriteLine("Should be the same: {0}={1}",
                      settings.NotSerializableUsingInterface.Content,
                      loadedSettings.NotSerializableUsingInterface.Content);
    Console.WriteLine("Should be the same: {0}={1}",
                      settings.NotSerializableUsingClass.Content,
                      loadedSettings.NotSerializableUsingClass.Content);
    Console.ReadLine();

}

}

[AllowNonSerializableMembers]
class Settings : Catel.Data.SavableModelBase
{
#region Constructors

public Settings()
{
}

public Settings(SerializationInfo info, StreamingContext context)
    : base(info, context)
{
}

#endregion

#region simple serializable property

// Name
public static readonly PropertyData
    NameProperty = RegisterProperty(@"Name",
                                    typeof(string),
                                    default(string));

public string Name
{
    get { return GetValue<string>(NameProperty); }
    set { SetValue(NameProperty, value); }
}

#endregion


#region NotSerializableUsingInterface

// NotSerializableUsingInterface
public static readonly PropertyData
    NotSerializableUsingInterfaceProperty = RegisterProperty(@"NotSerializableUsingInterface",
                                                             typeof(INotSerializable),
                                                             default(INotSerializable),
                                                             includeInSerialization: false);

public INotSerializable NotSerializableUsingInterface
{
    get { return GetValue<INotSerializable>(NotSerializableUsingInterfaceProperty); }
    set { SetValue(NotSerializableUsingInterfaceProperty, value); }
}

// alternate POCO property for serializing the NotSerializableUsingInterface type
public string SerializeNotSerializableUsingInterface
{
    get { return this.NotSerializableUsingInterface != null ? this.NotSerializableUsingInterface.Content : null; }
    set { this.NotSerializableUsingInterface = new NotSerializable {Content = value}; }
}

#endregion


#region NotSerializableUsingClass

// NotSerializableUsingClass
public static readonly PropertyData
    NotSerializableUsingClassProperty = RegisterProperty(@"NotSerializableUsingClass",
                                                         typeof(NotSerializable),
                                                         default(NotSerializable),
                                                         includeInSerialization: false);

public NotSerializable NotSerializableUsingClass
{
    get { return GetValue<NotSerializable>(NotSerializableUsingClassProperty); }
    set { SetValue(NotSerializableUsingClassProperty, value); }
}

// alternate POCO property for serializing the NotSerializableUsingClass type
public string SerializeNotSerializableUsingClass
{
    get { return this.NotSerializableUsingClass != null ? this.NotSerializableUsingClass.Content : null; }
    set { this.NotSerializableUsingClass = new NotSerializable {Content = value}; }
}

#endregion

}

interface INotSerializable
{
string Content { get; set; }
}

class NotSerializable : INotSerializable
{
public string Content { get; set; }
}
}

CTL-47: Rebind view with ViewModel in tabcontrol

Jira issue originally created by user castaingregis:

Hi,

I am still struggling when implementing a tabcontrol.
I provided a sample for the problem I have.
In the sample provided, there are 2 tabs: home and settings.
when I select the settings tab for the first time, I can click the button and the command associated is executed (the break point is hit correctly). But if then I select the home tab and get back to the setting tab again, the button is not bind to the command any more and nothing happen when it's clicked.

Could you please let me know if I am missing a setting or if there is anything in MVVM pattern I am missing when dealing with tabControl.

PS: would you have prefered me to first post this question on the discussion forum on codeplex?

Thank you
Regis

CTL-34: WP7: NullReferenceException unhandled in Catel.Core.dll

Jira issue originally created by user @GeertvanHorrik:

Today I updated the Catel NuGet packages for my WP7 project, and the ServiceLocator.Default property throws a NullReferenceException.

Partial stacktrace:

at Catel.EnvironmentHelper.get_IsProcessHostedByVisualStudio()
at Catel.EnvironmentHelper.get_IsProcessHostedByTool()
at Catel.Reflection.StaticHelper.GetCallingType()
at Catel.Logging.LogManager.GetCurrentClassLogger()
at Catel.Argument..cctor()
at System.Lazy1..ctor(Func1 valueFactory)
at Catel.EnvironmentHelper..cctor()
at Catel.Reflection.StaticHelper.GetCallingType()
at Catel.Logging.LogManager.GetCurrentClassLogger()
at Catel.Logging.LogManager..cctor()
at Catel.Phone.Controls.PhoneApplicationPage..cctor()

CTL-48: Move to GitHub

Jira issue originally created by user @GeertvanHorrik:

Move all repositories to github for better integration with JIRA. And it seems the world has chosen git over mercurial.

CTL-10: multi-language support

Jira issue originally created by user @GeertvanHorrik:

At the moment, this is not possible. However, if you implement a provider (IResourceProvider) that provides a GetResources(string), then we can easily integrate it. We already created a "ResourceHelper" to allow the same resources to be used by .NET and WinRT. Maybe we can re-use it.

CTL-20: WeakEventListener can't register for explicitly implemented events

Jira issue originally created by user @GeertvanHorrik:

The WeakEventListener_ in Catel 3.5 tries to register automatically to Catel properties that implement INotifyPropertyChanged or INotifyCollectionChanged. However, the way it does this throws an exception if the class of the object implements one of these interfaces explicitly. In this case, the object must be cast to INotifyPropertyChanged or _INotifyCollectionChanged to gain access to the event add or remove methods.

Some Microsoft collections implement INotifyCollectionChanged_ explicitly - _ListCollectionView, ReadOnlyObservableCollection, for example.

I have been able to create a simple workaround by modifying WeakEventListener.SubscribeToEventUsingNormalImplementation_ so that it tries to cast the source object to _ICollectionViewChanged if the first attempt at getting the event Add method fails. However, I believe the "right" way for Catel to handle this is to work with the Type of the property, not the Type of the value of the property. For example, let's say I have a Catel property 'MyCollectionView' of type ICollectionView:

public ICollectionView MyCollectionView
{
get { return GetValue<ICollectionView>(MyCollectionViewProperty); }
set { SetValue(MyCollectionViewProperty, value); }
}

/// <summary>
/// Register the MyCollectionView property so it is known in the class.
/// </summary>
public static readonly PropertyData MyCollectionViewProperty = RegisterProperty("MyCollectionView", typeof(ICollectionView));

Now, if this property gets set to a ListCollectionView_ object, The WeakEventListener should be dealing with the ICollectionView type, not _ListCollectionView.

CTL-26: EntityRepositoryBase only 1 (get) method viable when lazy loading is disabled.

Jira issue originally created by user maxim:

If you disable LazyLoading so you can control what "extra" data is loaded.
And then use the EntityRepositoryBase from Catel, you are not able to load extra properties like it is possible with Include("Name Of Property to load") like you are able from the DbSet.

GetQuery Returns IQueryable, and it supports ".Include". However all the other methods don't.
Also if you only need to get 1 item. Instead of using the Repository "First" or "Find", we ll have to do GetQuery().Include("value").First(x=>x.blabla).
We can use the repository and write GetQuery everytime we need an include, but it makes 5 methods useless(when you need lazy loading).
List of methods that don t support LazyLoading in the RepositoryBase:

Find
First
GetAll
GetByKey
Single

I ve read that IQueryable isn't good for unit testing, but I am a still new to unit testing etc so that might be totaly wrong.
For now I ll always use GetQuery I think.

CTL-57: Performance problems with unloading ViewModels

Jira issue originally created by user IvanKupriyanov:

We have some strange perfomance problems. Typical Master-Details view. We have listview with items (fuel nozzles). Binding set to BindingListCollectionView. And we have user control for details, which is wired with CollectionView CurrentItem. In that details we have list of subitems (fuel tanks, for which current nozzle can be linked).

The problem is when i select another nozzle program stops responding for a second. More tanks - more delay.

If you not just select another nozzle, but deselect current with Ctrl+Click and then select another - there is no delay at all.

Any ideas whats wrong with it?

This is a part of code. If you need more logs or code - i'll post.

20.500: [Catel.MVVM.ViewModelBase] Closed view model 'GasKitUILib.ViewModels.Configuration.FuelPump.LinkableTankViewModel'
20.500: [Catel.MVVM.ManagedViewModel] Removed view model instance, currently containing '9' instances of type 'GasKitUILib.ViewModels.Configuration.FuelPump.LinkableTankViewModel'
20.500: [Catel.MVVM.Views.ViewToViewModelMappingHelper] Initializing view model 'null'
20.500: [Catel.MVVM.Views.ViewToViewModelMappingHelper] Uninitializing view model 'LinkableTankViewModel'
20.500: [Catel.MVVM.Views.ViewToViewModelMappingHelper] Uninitialized view model 'LinkableTankViewModel'
20.500: [Catel.MVVM.Views.ViewToViewModelMappingHelper] Initialized view model 'null'
20.624: [Catel.MVVM.Views.ViewToViewModelMappingHelper] Uninitializing view model container to manage ViewToViewModel mappings
20.624: [Catel.MVVM.Views.ViewToViewModelMappingHelper] Uninitialized view model container to manage ViewToViewModel mappings
20.624: [Catel.Windows.Controls.MVVMProviders.Logic.LogicBase] Target control 'AvailableTankControl' is unloaded```

View with listbox of nozzles and details

<controls:NozzleTanksListControl DataContext="{Binding Nozzles.CurrentItem}"/>


**NozzleTanksListControl** code:
```

AvailableTankControl code:

<StackPanel Orientation="Horizontal">
    <CheckBox IsChecked="{Binding Path=Linked}"/>
    <TextBox Text="{Binding Path=TankId, Mode=OneWay}"/>
    <TextBox Text=":"/>
    <TextBox Text="{Binding FuelName}"/>
</StackPanel>

All viewmodels constructed with ": base(false)" and without default constructor.

public class LinkableTankViewModel : ViewModelBase
{
    public LinkableTankViewModel(ILinkableFuelTank LinkableFuelTank)
        : base(false)
    {
        Argument.IsNotNull("LinkableFuelTank", LinkableFuelTank);
        this.LinkableFuelTank = LinkableFuelTank;

        Init();
    }

    private void Init()
    {
        FuelName = LinkableFuelTank.FuelKindData.ShortName;
        TankId = LinkableFuelTank.Id;
    }

    public Id<CFuelTank> TankId
    {
        get {
            return GetValue<Id<CFuelTank>>(TankIdProperty);
        }
        private set {
            SetValue(TankIdProperty, value);
        }
    }

    [ViewModelToModel("LinkableFuelTank", "IsLinked")]
    public bool Linked
    {
        get {
            return GetValue<bool>(LinkedProperty);
        }
        set {
            SetValue(LinkedProperty, value);
        }
    }

    public string FuelName
    {
        get {
            return GetValue<string>(FuelNameProperty);
        }
        private set {
            SetValue(FuelNameProperty, value);
        }
    }

    [Model]
    ILinkableFuelTank LinkableFuelTank
    {
        get {
            return GetValue<ILinkableFuelTank>(LinkableFuelTankProperty);
        }
        set {
            SetValue(LinkableFuelTankProperty, value);
        }
    }
}

CTL-58: Automatic de/serialization of specified fields within ModelBase

Jira issue originally created by user facos:

Example:

public class Test : ModelBase
{
[IncludeWithSerialization] <- attribute to mark this field for automatic de/serialization
private int value;

 protected string name;

 ..... Catel properties ....

}

Test.Clone() <-- value field is also cloned

CTL-6: Support dependency injection in child view models

Jira issue originally created by user @GeertvanHorrik:

To support dependency injection in child view models, the TypeFactory must be extended with this behavior:

public T CreateTypeWithFixedParameters(object[] fixedParameters). The fixed parameters must be in the right order. Catel will then search for the right constructor with the fixed parameters and find the one with the most parameters.

CTL-24: ServiceLocator should register types with a callback

Jira issue originally created by user @GeertvanHorrik:

The ServiceLocator allows the registration of an instance and a type. It should be 2 options:

  1. Instance
  2. Type with a func to create the type.

The register type without a function should be used as extension methods. The extension methods then use the TypeFactory (of the ServiceLocator, not .Default) to create the type.

CTL-25: Add events to ServiceLocator

Jira issue originally created by user @GeertvanHorrik:

ResolvingType
ResolvedType

RegisteringType
RegisteredType

InstantiatingType
InstantiatedType

TypeFactory should also have events:
InstantiatingType
InstantiatedType

CTL-38: Default values from Catel Properties do not get observed

Jira issue originally created by user facos:

public class TestModel
{
    public static readonly PropertyData ItemsProperty = RegisterProperty
        <TestModel, FastObservableCollection<int>>(
            o => o.Items, () => new FastObservableCollection<int>());    // default value

public TestModel()
    {
         // crude workaround (manually set Catel Property to force observation)
         // without it does not work!
         // this.Items = new FastObservableCollection<int>();
    }

    protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
    {
          // never gets called with default value only
    }

    protected override void OnPropertyObjectCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
    {
          // never gets called with default value only
    }

    protected override void OnPropertyObjectPropertyChanged(object sender, PropertyChangedEventArgs e)
    {
          // never gets called with default value only
    }
}

CTL-1: Implement MainViewModelBase

Jira issue originally created by user @GeertvanHorrik:

MainViewModelBase is a ViewModel that will receive an event when the bootstrapper done with the StartupEventArgs.

public class MyMainViewModel : MainViewModelBase
{
public void OnMain(StartupEventArgs args)
{
}
}

This view model can use as the "main entry point" of the application to continue the application flow when the bootstrapper done if is necesary.

CTL-31: Catel MVC needs more code to allow DI for ctor of controllers

Jira issue originally created by user maxim:

At the Global.asax - Application_Start() I put:

Catel.Mvc.DependencyInjectionConfig.RegisterServiceLocatorAsDependencyResolver();
then I registered my services. Once going running the site it gave error that there needs to be an empty ctor of the controller. After alot of searching I found the solution. (Dunno or this is the best but here you ll be able to finalize the code for catel ofc :)).

Register 1 more Class for the IOC:
Catel.IoC.ServiceLocator.Default.RegisterType<IControllerActivator, MyCustomControllerActivator>();

The class I made:

public class MyCustomControllerActivator : IControllerActivator
{
public IController Create(RequestContext requestContext, Type controllerType)
{
return Catel.IoC.ServiceLocator.Default.GetService(controllerType) as IController;
}
}

After this the IOC was also injecting the classes into the interfaces in the ctors of the controllers.

CTL-37: InterestedIn and OnViewModelPropertyChanged not firing when property is being updated from UI

Jira issue originally created by user castaingregis:

I try to take advantage of the InterrestedIn attribute in order to check the change on 2 properties from an other viewmodel.
Both viewmodel are kept alive in a list of viewmodel used as source of items to a tab controller.

The OnViewModelPropertyChanged is firing when the viewmodel is created and the property are being assigned but it's not firing if the properties are modified via the UI.

I also have a save button on the page. When I clicked it the properties are already assigned the typed values so it seems the UI is updating the viewmodel properties as expected.

Is it normal? Am I missing something in the way the feature is supposed to work?

CTL-42: Wcf IoC support

Jira issue originally created by user rajiv.mounguengue:

Write a ServiceHostFactory and an InstanceProviderBehaviorAttribute for Wcf will use ServiceLocator in instanciation process.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.