I'm Using Uno-Platform with MVVMLight trying to structure my project. Should I put platform specific code inside ViewModel? or should it mostly be in Utils/Services?
Where should most of my platform specific code be in MVVM? (Beside View)
210 views Asked by Flippidy Joe At
1
There are 1 answers
Related Questions in MVVM
- TelephonyCallback.CallStateListener with LiveData and ViewModel
- Jetpack compose - how I can hookup LiveData property from ViewModel with TextField in activity?
- Jetpack compose ViewModels - should I have one ViewModel for different api calls?
- How to Display UserControl as SplitView Content? - Avalonia C#
- ViewModel property is empty even after initializing it
- How to bind to the DataContext ViewModel of another view?
- Problem updating the interface under MAUI to MVVM
- x:Bind a embeded page to the parent window viewmodel in WinUI 3
- RelayCommand not firing on MenuItem click inside DataGridTextColumn WPF MVVM
- WinUI3 CommunityToolkit MVVM Messenger calling on disposed objects?
- MAUI: How to update an observable property and wait for UI update completion before updating it again?
- Viewmodel as ILogEventSink in a Prism application
- How do I modify ViewModel data from button in swiftui
- Proper way to return value from custom UserControl's DependencyProperty and uses viewModel?
- .NET MAUI MVVM View Initialization doesn't work properly
Related Questions in MVVM-LIGHT
- Bind to viewmodel from within an inherited DataContext
- Migrating data binding from MVVMLight to CommunityToolkit.Mvvm
- Preventing null value insertion through a RelayCommand in WPF MVVM?
- How to use a parameter with EventToCommand in mvvmlight on WPF
- How to subscribe to Navigated event from the WebBrowser control on a ViewModel? (MVVM)
- Showing two copy of dialog wpf mvvm
- RelayCommand not firing from Context Menu item in a user control
- Command Chaining in UWP
- MVVM Messenger Register / Send Message in VB.net
- RaisePropertyChanged throws AccessViolationException when update data
- DispatcherHelper in Windows Community Toolkit
- How to replace a registered service with a new one in MVVM?
- UWP Change theme in pop ups MVVM Light
- C# JsonIgnore to basic class
- GalaSoft MvvmLight not disabling UserControl with RelayCommand
Related Questions in UNO-PLATFORM
- Uno Platform app runs perfectly well in Debug but not so well in Release
- How to get rid of RemoteControlClient errors while viewing WASM page locally?
- Uno platform setup
- TextBlock rotation
- add routing to my webassembly app or urls from jsonfile the creates the side navmenu for my app
- Need to restart an Uno Platform based app
- Uno Platform - How to create a full screen Windows Desktop application
- Should ReactiveWindow be available when using ReactiveUI with Uno/WinUI3?
- How to use the appsettings.json file?
- Platform specific XAML not working for wasm
- How do I navigate to a web url from Uno?
- Multiple Windows with UNO platform
- How to wire up MSAL with the newest Uno platform
- setLSActiveProject failed: Error: Starting server failed
- How to migrate my WPF application to linux based application through UNO Platform?
Related Questions in SHARED-PROJECT
- Get shared project ".shproj" from a solution with Roslyn
- How to convert some functions for running in background? - Xamarin Forms
- Shared Project spilts WPF .xaml file into two files
- how to add new column in existing table in entity framework in xamarin shared project
- How to Use 2 libraries (contain a Shared Class) in a Project?
- Visual Studio 2019, how to use Image located in Shared Project in WPF/XAML?
- How to localize .net shared projects
- how to Add Shared Project to WPF Project in VS2019
- Include all folder files in a shared project
- Visual Studio Successfully Using Shared Project wwwroot Files on Publish but not on Build/Run
- Uno Platform - Reference resource dictionary within Shared project
- How to add references and packages to a shproj or shared project in a visual studio solution?
- Visual Studio project is referencing a Shared project which has been deleted
- Xamarin Forms: Get the path of an image file stored on the shared project?
- Preventing mobile projects from using certain .cs files in a Shared Project
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I would recommend placing platform-specific code inside utility classes or services. Placing that code inside ViewModels would make it harder to reuse and potentially make the ViewModel impossible to run tests against.
Ideally, (not mandatory) you'll want to use Interfaces and dependency injection, provide one implementation for each platform you want to support, and try to implement the same interface for all of them. That way, your ViewModel will not have
#if PLATFORM_Acode.Side note, remember Uno platform already offers a lot of platform abstractions through the UWP APIs. Like Geolocator, sensors etc.