Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup for Caliburn.Micro and WPF without a code behind. #52

Open
lorinkundert opened this issue Aug 4, 2021 · 1 comment
Open

Setup for Caliburn.Micro and WPF without a code behind. #52

lorinkundert opened this issue Aug 4, 2021 · 1 comment

Comments

@lorinkundert
Copy link

I have been using Jot a long time and have always loved it, now I have been tasked with converting everything to WPF and removing all write behind code and instead using a viewmodel. I have not been able to find a way to make jot work with this, Is it even possible? another change is Net core.

@Coke21
Copy link

Coke21 commented Nov 30, 2021

@lorinkundert Although this is quite an old issue, I've decided to help anyone who comes to this issue in the future.
Yes, it is possible to use this library with the MVVM framework, I've tested it with Caliburn.Micro and Stylet.

An example of the app which uses .NET Core 3.1 + WPF MVVM (Caliburn.Micro):
https://github.com/Coke21/GTA-Mission-Downloader/blob/master/GTAMissionDownloader/ViewModels/MainViewModel.cs#L115

Persistence class:
https://github.com/Coke21/GTA-Mission-Downloader/blob/0f58c1db12601b8e6419016a876c0253b8cbc3ec/GTAMissionDownloader/Classes/Persistence.cs#L5

You can just put the above in your constructor:
Tracker tracker = new();

It's one of the app which I've created in the past. So basically put Jot stuff in the constructor (in your ViewModel), make the stuff that you want to save as properties and it should do the job.

Just don't use Caliburn.Micro or Stylet's Screen in your Model since it seems to be bugged (implement your own INotifyPropertyChanged), see this issue:
#39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants