Comments (4)
@GreggAtCarfac thanks for contacting us.
You might be looking for MobileBlazorBindings. If you are looking for some way of using MVVM with Blazor components, I do not think there is anything that prevents you from doing so, but we do not have plans to more directly support the pattern in the framework.
Whether it is one or the other, none of the two pieces at this point are committed.
/cc: @Eilon
from mobileblazorbindings.
@javiercn Sorry is not resolved. yes the mobileblazorbindings is what i am doing. but it does not work multi screen. in a desktop wpf project i have 2 screens sharing the same viewmodel but if i click the counter button 3 times on screen 1 i see the counter increase from 0 to 1, then to 2 and finally 3 but on screen 2 it remains zero. if i then press the counter button on screen 2 once it jumps to 4. so i am sure they share the same viewmodel. and i do call the onproperychanged event so i would expect screen 2 to update if the counter on screen 1 button is pushed.
from mobileblazorbindings.
I transfered this to the Mobile Blazor Bindings repo.
I'm not familiar with how multi-screen/window works, but in any case, to get each page to update you'll need the model type to have some sort of change notification that occurs any time the model (such as the counter value) changes. Then each page using that model can listen to that change notification and call StateHasChanged()
to cause the UI to update.
To see an example, look at how and where this event is used in a ToDo sample app: https://github.com/dotnet/MobileBlazorBindings/blob/main/samples/MobileBlazorBindingsToDo/AppState.cs#L31
from mobileblazorbindings.
@Eilon Thanks for the help. Your solution worked. Its a but sad that you have to force the screens to update through the StateHasChanged() event on the blazor pages themselves. You would think as the view is bound through dependency injection with its viewmodel a simple onpropertychanged event on the viewmodel would be enough and no code is needed on the view. I hope the developers will add this in a future release.
from mobileblazorbindings.
Related Issues (20)
- Alternative approach to attached properties using CaptureUnmatchedValues
- debug windows app that has a blazorwebview HOT 1
- Renderer was called before InitAsync
- IJSRuntime : {System.NullReferenceException: Object reference not set to an instance of an object. in DelegatingHandler HOT 2
- Does blazor hybrid work on iOS? HOT 5
- Is this project is dead ? HOT 1
- this project are discontinued? HOT 2
- Revisit ObjectExtensions.This() internal extension method HOT 4
- True Fullscreen on blazor windows HOT 4
- How to change WebView EBWebView folder path? HOT 2
- OnParametersSet is not invoked on Shell navigation
- Allow text content for Label control
- Allow passing additional parameters during Shell navigation
- Blazor WebView freeze after maximizing WPF Windows App
- Update Picker.ItemDisplayBinding to be Func instead of string
- Unable to load image from URL HOT 1
- When will this project continue? HOT 3
- Window size
- NavigationManager does not work anymore on Hybrid Apps HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobileblazorbindings.