christianruiz / mvvmcross-controlsnavigation Goto Github PK
View Code? Open in Web Editor NEWMvvmCross plugin for allowing multiple ViewModels in the same View.
License: Microsoft Public License
MvvmCross plugin for allowing multiple ViewModels in the same View.
License: Microsoft Public License
Hi,
After stacking views with same viewModel control resolver gets the first navigation control, but the stack head view has the last added control (not the first added), so application tries to update the old view control.
I think solution could be change the MvxControlContainer.cs GetControl method to return the last or default control instead the first. It solves the issue for stacked views:
// var control = _controls.FirstOrDefault(c => c.GetType().Name == controlName);
var control = _controls.LastOrDefault(c => c.GetType().Name == controlName);
regards.
Hi,
I'm new to MVVMCross and was experimenting with your code to try make a Ribbon/DockArea type WPF application.
I was trying to figure out why I didn't seem to get a ViewModel created by default when I add a Ribbon and DockArea control to my FirstView view.
In the MvxWpfControl constructor it has:
Loaded += OnLoaded;
which later in the OnLoaded method calls
_container.Add(this);
What I was finding is that MvxControlsContainer.GetControl(Type viewModelType) was being called before the OnLoaded is fired and the _controls used by the call:
var control = _controls.LastOrDefault(c => ...
is empty when it tries to locate the correct control.
Later, but too late, the OnLoaded event fires and now _controls is populated.
I found if I put an Add in the constructor it could now find the control, ie:
_container = Mvx.Resolve<IMvxControlsContainer>();
_container.Add(this);
Loaded += OnLoaded;
The OnLoaded could then perhaps test to see if it has already been added. I haven't got into the Loaded/Unloaded part yet.
Am I doing something wrong, or perhaps there is some other way to get it to find the control?
I just tried to install the v1.0.5 nuget package on iOS project which is using latest MvvmCross v4.1.5 but the intallation failed and I got the error below:
Could not install package 'MupApps.MvvmCross.Plugins.ControlsNavigation 1.0.5'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Is there any reason why a control has to be in /Controls
folder and needs to have a Control
suffix? This forces us to put views into two different folders as well as forces us to have inconsistency in our naming conventions. It would be better if it allowed us to at least use views ending in either -Control
or -View
. Thoughts?
We're using the plug-in with great success. Still, where having one minor issue with popups controls within an MvxStoreControl. We are making the popup full-screen by spanning the entire layout root (grid) rows and columns. Every so often duplicate controls will be displayed with one centered correctly and the other in the top left corner. Tried following all the recommendations on the home page for using the control which has helped suppress the issue but has not completely resolved it. Unfortunately, I don't have any precise steps to reproduce, it's very intermittent.
Your solution needs to be updated to support Windows Phone 8.1. I have pulled the code and was able to use all of your code with no .cs alterations. I also suggest you name the 8.1 plugin with the "windows" keyword. ie: MvxWindowsControlPresenter, as that is what mvvmcross is doing for 8.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.