Comments (6)
You might be interested by TimLariviere/Fabulous#25
There, I tried to create something similar touseElmish
that would be compatible with Fabulous and support bidirectional communication (receive messages from outside the loop and send messages to outside the loop).
Let me know if this is the concept you need.
And if the API (usability) makes sense to you.
from fabulous.xamarinforms.
Thanks for the feedback!
I fear it will take a few months before I can add that feature, since it is dependent on the new architecture I've been playing with.
I need to do a few things before being able to implement that.
Currently my priorities are as follow:
- Complete the picture for the new shapes controls (PR fabulous-dev/Fabulous#782)
- Migrate the documentation website to Fornax
- Reduce allocations in Fabulous
- Rework the experiments to take into account the optimizations done for the allocations
- Write the specifications to implement the new architecture (that would enable that new feature) while being backward-compatible with the existing DSL.
- ... and finally implement bit by bit the new architecture and the new features.
from fabulous.xamarinforms.
@JordanMarr Unfortunately no, not currently at least. I don't think Xamarin.Forms even support it at all.
On which platform do you need to open a new window, WPF?
from fabulous.xamarinforms.
I only need to target WPF. It doesn't necessarily have to be two separate windows, as much as the ability to run multiple loops at the same time. What I would love to be able to recreate is the experience in Fable.React of being able to create multiple views with their own dispatch loops. This makes it so much easier to have a multi-page app because you don't have to deal with wiring up all the messages. This has become a staple for me.
In React, each view is declared as a function component, and I can use a function like "useReducer" or "useElmish" to start up an isolated dispatch loop just for that view. This makes it trivial to have multiple views, where each view is somewhat isolated and self-contained by having its own dispatch loop.
/// EditUserDialog.fs
module EditUserDialog
type Model = { User: User }
type Msg = | Load | Save | Cancel ...
let init (user: User) = ...
let update msg model = ...
type Props = { IsDialogOpen: bool; User: User; OnSave: User -> unit }
let dialog = React.functionComponent(fun (props: Props) ->
let model, dispatch = React.useElmish(init props, update, [||])
div [ Visible model.IsDialogOpen ] [
div [] [
label [] [ str "First Name:" ]
input [ Value model.User.FName ]
]
div [] [
label [] [ str "Last Name:" ]
input [ Value model.User.LName ]
]
div [] [
button [ Click (dispatch Save) ] [ str "Save" ]
]
]
)
/// UsersPage.fs
module UsersPage
type Model = { ... }
type Msg = | ListUsers | EditUser ...
let init () = ...
let update msg model = ...
let page = React.functionComponent(fun () ->
let model, dispatch = React.useElmish(init props.Type, update, [||])
div [] [
for user in model.Users do
...
EditUserDialog.dialog
{ IsDialogOpen = model.SelectedUser.IsSome
User = user
OnSave = (fun user -> dispatch (UpdateUser user)) }
]
)
The "downside" in this approach is that you have multiple disparate dispatch loops as opposed to one unified loop.
But really, this doesn't feel like a downside to me, and the ease of adding introducing new views more than makes up for it.
from fabulous.xamarinforms.
That looks very promising!
In the CounterApp sample, I really like AboutCard.asComponent(model.Count, CardChanged)
. The way you are splicing that view element directly into the view is exactly what I had in mind.
The optional withExternalMessages
is a pretty slick way of routing messages back to another view.
This looks great!
from fabulous.xamarinforms.
Any chance of this fabulous feature making making it into a release in the near future?
from fabulous.xamarinforms.
Related Issues (19)
- GeastureRecognizers are not updated via UpdateIncremental on iOS HOT 4
- Create iOS extensions with Fabulous HOT 5
- Cannot build default Android project from template HOT 4
- Question: Shell and BackButtonBehaviour/OnBackButtonPressed HOT 8
- Question: using Media.Plugin with Fabulous HOT 2
- [Bug] Reordering WebView in XamarinForms WPF sometimes loses the source HTML value
- Image rotation using Fabulous.XamarinForms.FFImageLoading? HOT 4
- Question: adding child views at runtime to FlexLayout or StackLayout? HOT 4
- Dynamically setting light/dark themes at runtime HOT 2
- [Bug] Getting error while trying to build project created from "fabulous-xf-app" template HOT 14
- AppLinkEntry support HOT 4
- [Experiment] New NavigationView with route-based navigation HOT 4
- Add support for Glide or Nuke Image caching library
- Add "maintenace mode only" message at the top of README
- Question: CollectionView items are not displayed on iOS (XF 5.0 bug) HOT 2
- SwipeItems not showing up correctly HOT 1
- Fabulous.XamarinForms.Templates references Fabulous.2.1.3 which is not released HOT 2
- ListView: disable animation when selectedItem changes HOT 1
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 fabulous.xamarinforms.