GithubHelp home page GithubHelp logo

radicalfx / radical.windows Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 2.0 1.31 MB

Radical is an infrastructure framework whose primary role is to help in the development of composite WPF applications based on the Model View ViewModel pattern.

Home Page: http://www.radicalframework.com/

License: MIT License

C# 99.94% HLSL 0.06%
composite-wpf-applications hacktoberfest radical viewmodel-pattern wpf

radical.windows's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar github-actions[bot] avatar mauroservienti avatar micdenny avatar nazarenom avatar nazarenomanco avatar ucollina82 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

radical.windows's Issues

Allow services to be registered as resources

Plan

  • implementation in ApplicationBoostrapper
  • expose conventions for resource key generation
  • support in ViewResolver

Implementation details in #130

From @mauroservienti on April 21, 2016 9:2

Something like:

var conventions = s.GetService(typeof(IConventionsHandler));
this.Resources.Add("ConventionsHandler", conventions);

on boot completed

Copied from original issue: RadicalFx/housekeeping#58

ObserversGroup (was: AutoCommandBinding)

From @fabiocbr75 on September 15, 2015 19:15

With AutoCommandBinding the viewmodel is very clean but I don't found how is possibile convert following code in AutoCommandBinding way.

XXXCommand = DelegateCommand.Create()
.OnExecute(o => MyFunc())
.OnCanExecute(o => CanRun)
.AddMonitor(PropertyObserver.For(this).Observe(v => v.prp1))
.AddMonitor(PropertyObserver.For(this).Observe(v => v.prp2))
.AddMonitor(NotifyCollectionChangedMonitor.For(this.MyObservableCollection));

Is it possible?

Thanks

Copied from original issue: RadicalFx/Radical#190

MouseManager

e.g. track mouse position, handy when dealing with design surfaces

EnumBooleanConverter

public class EnumBooleanConverter : IValueConverter
    {
        #region IValueConverter Members
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string parameterString = parameter as string;
            if (parameterString == null)
                return DependencyProperty.UnsetValue;

            if (Enum.IsDefined(value.GetType(), value) == false)
                return DependencyProperty.UnsetValue;

            object parameterValue = Enum.Parse(value.GetType(), parameterString);

            return parameterValue.Equals(value);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string parameterString = parameter as string;
            if (parameterString == null)
                return DependencyProperty.UnsetValue;

            return Enum.Parse(targetType, parameterString);
        }
        #endregion
    }

Release 1.6.0 blockers

  • merge #51
  • fix nuget command line dependency in CI 592ba20
  • Update dependencies to latest stable
  • Update nuspect to reflect new dependencies and SemVer

ShowViewMessage should be supported by the framework

Whenever the user wants to show a view, modal or not, a variation of the following code needs to be used:

class OpenMyAmazingViewMessageHandler : AbstractMessageHandler<OpenMyAmazingViewMessage>, INeedSafeSubscription
{
   readonly IViewResolver viewResolver;
   readonly IConventionsHandler conventions;

   public OpenMyAmazingViewMessageHandler(IViewResolver viewResolver, IConventionsHandler conventions)
   {
       this.viewResolver = viewResolver;
       this.conventions = conventions;
   }

   public override void Handle(object sender, OpenMyAmazingViewMessage message)
   {
       var view = viewResolver.GetView<MyAmazingView, MyAmazingViewModel>(vm => 
       {
          //init code here
       });

       view.Owner = this.conventions.GetViewOfViewModel(sender) as Window;
       view.ShowDialog();
   }
}

One thing Radical could do is to introduce a ShowViewMessage class such as:

class ShowViewMessage
{
   public Type ViewType{ get; set; }
   public bool AsModal{ get; set; }
}

and a generic handler, similar to the above one that handles the logic to show the requested view, what the above misses is the ability to add custom initialization data that can be passed to the VM. One thing that we could introduce is something similar to RadicalFx/Radical.Windows.Presentation#5 or we can add an interface to the VM such as ICanBeInitialized<T> and add another message such as:

class ShowViewMessage<T> : ShowViewMessage
{
   public T Data{ get; set; }
}

with this in place opening a View would be as simple as:

await broker.DispatchAsync( this, new ShowViewMessage<MyInitData>()
{
   ViewType = typeof( MyAmazingView ),
   Data = new MyInitData()
   {
      //....
   }
} );

and at the same time implement ICanBeInitialized<MyInitData> on the VM.

@micdenny thoughts?

ElementInputHint behavior / template

From @mauroservienti on November 4, 2014 8:9

Hints are an amazing way to help the user to understand what to do and to document the application. We currently support CueBanners via an attached property and a behavior.
We should also support a way to automatically show documentation, beside of each control, rendering for example a "?" that when clicked will popup a list of hints/suggestions statically known or bound to the view model.

Copied from original issue: RadicalFx/Radical#103

Log a warning ⚠️ if the user tries to intercept a singleton `ViewModel` more than once

When using the IViewResolver the user can inject an interceptor action that will be invoked before the ViewModel is wired to the View to manipulate the ViewModel.

When dealing with singleton ViewModels the above interceptor will be invoked only the first time, then is ignored. We should log a warning ⚠️:

viewModelInterceptor(viewModel);

Copied from original issue: RadicalFx/Radical#175

DisableManipulationBoundaryFeedback

When using a touch enabled device controls such as ListView have the elastic behavior when scrolling and reaching the end or the top of the scroll area. This behavior allows the user to disable the elastic behavior.

class DisableManipulationBoundaryFeedback : Behavior<ListBox>
    {
        protected override void OnAttached()
        {
            base.OnAttached();
            this.AssociatedObject.ManipulationBoundaryFeedback += listBox_ManipulationBoundaryFeedback;
        }

        void listBox_ManipulationBoundaryFeedback(object sender, System.Windows.Input.ManipulationBoundaryFeedbackEventArgs e)
        {
            e.Handled = true;
        }

        protected override void OnDetaching()
        {
            base.OnDetaching();
            this.AssociatedObject.ManipulationBoundaryFeedback -= listBox_ManipulationBoundaryFeedback;

        }
    }

Release 1.4.0

We have a bunch of features to release and I started to think that the build failures we are facing might be due to the actual Radical.Windows package

ElementErrorsBehavior / Template

From @mauroservienti on November 4, 2014 8:6

Add a behavior that shows all the errors related to a control on the UI.
Currently WPF has the notion of error template, the default template renders only one error at a time, since in the real world each control, bound to a property, can have multiple errors at the same time we and we support it we should provide a built-in way to show all the errors

Copied from original issue: RadicalFx/Radical#102

Introduce the concept of Region(s) lifecycle events callbacks

A Region is a WPF MarkupExtension, thus it's instance is created and managed by WPF, there are scenarios in which it could be interesting to enable regions to have dependencies coming from other sources, such the IoC container. We have no control on regions creation however we have full control on region registration and shutdown via the RegionManager.
The RegionManager could be evolved to allow injection of callbacks so that a third party can add custom behaviors when a region is registered and when a region is shutdown. Would be interesting to:

IValidationService.StatusChanged event is too poor

Replace the EventArgs with a

public class ValidationStatusChangedEventArgs : EventArgs
{
    public ValidationStatusChangedEventArgs( string ruleSet, string propertyName )
    {
        this.RuleSet = ruleSet;
        this.PropertyName = propertyName;
    }

    public ValidationStatusChangedEventArgs( string ruleSet )
    {
        this.RuleSet = ruleSet;
    }

    public string RuleSet { get; private set; }
    public string PropertyName { get; private set; }
}

Related to RadicalFx/Radical#178

ExposeViewModelAsStaticResource conventions design is wrong

The conventions design in RadicalFx/Radical.Windows.Presentation#24 is wrong. The thing a user might need to change more frequently is not how to expose the VM as a resource but which key to use for the resource.
Actually the only way to do it is to override the ExposeViewModelAsStaticResource conventions and replace other than the resource key the whole logic to expose the VM.

This is useless, IMO. We should at first allow users to have a ViewModelStaticResourceKeySelector convention.

DelegateCommand add Rx support

We have the Observer/Monitor concept to connect sources of changes, mostly, to commands.

Could be interesting to add support for Reactive Extensions' Observer/Observable concepts greatly increasing options for end users.

Support IExpectViewClosingCallback cancellation in nested views

From @mauroservienti on March 20, 2014 7:32

Since we support IExpectViewClosingCallback w/ CancelEventArgs even for views managed by the UI Composition system (RegionService) it means that a view can block the close process, but currently this view must be the root view that we are explicetly closing because the "closing" state is not notified to nested views, only the closed and dispose.
In orther to achieve that a 2-phase closing process must be introduced, the first stage is to ask to all the view chan, in that specific scope, if they agree to be closed, and if "true" proceed with the closing process otherwise block everything.

How does this interacts with the application shutdown process?

Copied from original issue: RadicalFx/Radical#1

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.