WPF in C# with MVVM using Caliburn Micro

IAmTimCorey · 380K views · 2017 · 1:23:30

Open on YouTube

Software architecture & designC, C++, Rust, Go & systems languagestutorial

Why Stack Overflow recommends it

Stack Overflow users link it as the go-to walkthrough for learning MVVM with Caliburn Micro in WPF, both in answers and as the tutorial that askers are following when they hit problems.

Recommended by 3 people across 3 different months, 2018 to 2020.

What it is

A 1h23m tutorial by Tim Corey (IAmTimCorey) that builds a WPF application from scratch using the MVVM pattern and the Caliburn Micro framework. It covers setup, view models, data binding, property change notification, comboboxes, buttons with guard methods, and switching between multiple views.

What people said

Recommends LOG · 2018-04 · Stack Overflow · on “Caliburn Micro actions”

I watched this video [this video] (time: 1:05:57 )on youtube and the author also used parameters in these methods.. it is interesing why..

Recommends skeezerbean · 2019-06 · Stack Overflow · on “Reusing views for multiple view models”

A little late to the party, but perhaps this will help someone. This video helped a lot for me - (Tim Corey, WPF and Caliburn with MVVM) [this video] Setting up the ShellView with a control that points to ActiveItem as you mentioned, allows that control to display whatever view you tell it from the ShellViewModel code. I was also using Fody with this project, so that took care of the change notifications so you won't see those listed in code. ShellView - <Button x:Name="LoadMainPage" /> <Button x:Name="LoadSecondPage" /> <ContentControl x:Name="ActiveItem"/> The ShellViewModel - public class ShellViewModel : Conductor<object>.Collection.OneActive { public MainPageViewModel MainPageVM = new MainPa

Recommends Rolandas Ulevicius · 2020-03 · Stack Overflow · on “Change the View on button Click in WPF MVVM Pattern”

Be aware that im using caliburn micro for this example private IEventAggregator _eventAggregator => IoC.Get<IEventAggregator>(key: nameof(EventAggregator)); private IWindowManager _windowManager => IoC.Get<IWindowManager>(key: nameof(WindowManager)); public ShellViewModel(IEventAggregator eventAggregator) { _eventAggregator.Subscribe(this); } public string _firstName; // public ShellViewModel page = new ShellViewModel(); public string FirstName { get { return _firstName; } set { _firstName = value; NotifyOfPropertyChange(() => FirstName); } } public ICommand ConvertTextCommand { get { return new DelegateCommand(ConvertText); } } void ConvertText() { //string url = " [LINK] "; string url = Fi

Cites MostHated · 2018-11 · Stack Overflow · on “Using Caliburn.Micro with Mahapps MetroTabItem not loading View to ContentControl”

I just started learning to use WPF as well as Caliburn.Micro(v3.2.0) and Mahapps(v2.0.0 a0105) and I am having an issue with trying to get a Mahapps MetroTabItem to display a View into a ContentControl box. The ContentControl was originally in a separate grid but from what I understand, that should be just fine. To test I moved it over and put it into the following: (Note that I set "Name" both as Name= and x:Name= and it didn't seem to make a difference.) <!-- This is in AppView.xaml --> <Grid.Resources> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" /> </Grid.Resources> <TabControl Height="150" Controls:TabControlHelper.U

Cites aboudirawas · 2019-08 · Stack Overflow · on “What is the difference between .xaml.cs and ViewModels/ViewModel.cs?”

I have been following this tutorial on MVVM pattern using caliburn micro [this video] What is the difference between .xaml.cs and ViewModels/ViewModel.cs ? I see we put our code for the shellview in ShellViewModel.cs, but when I, for example, choose an event handler for a Button, visual studio takes me to .xaml.cs and not to the ViewModels/ViewModel. Do I have to stick to one or each file has a different role/responsibility? ( considering that I want my code to still be following MVVM pattern )

Cites Daniel · 2019-12 · Stack Overflow · on “How to pass value to constructor of ViewModel - MVVM using Caliburn.Micro”

I'm getting started with MVVM using Caliburn.Micro and the following tutorial: [this video] The tutorial shows how to set up a ShellView and open one 'child' View at a time in a <ContentControl> . I have all of this working fine, but now I want to pass some parameters from one child view to the constructor of a new child view. My first child view is called FindQuotaView and the second is called QuotaView . Basically I want the FindQuotaView to take input and display the result on QuotaView . As the <ContentControl> is in the ShellView , I figure I need FindQuotaView to "ask" the ShellView to load QuotaView . After some searching I discovered the EventAggregator and I'm using that to notify the Sh

Cites GoodOldGuy · 2019-12 · Stack Overflow · on “C# Sending gmail with uploading large file on Google drive attachment”

No problem :) Yeah, take your time as this is not something that may be appropriate for new people. MVVM is just a pattern of how should one write their GUI apps. I learned MVVM from Tim Corey [this video] but if you're new to WPF I would just advise you to learn without MVVM. Feel free to post any questions and problems so hopefully, I will be able to help you :>

Cites Jakob Busk Sørensen · 2020-01 · Stack Overflow · on “Understanding MVVM pattern elements”

I understand your confusion, as many of the basic elements of MVVM aren't as simple as they are often promoted to be. For the sake of keeping it simple (or at least simpler), I will only focus on MVVM implemented in Windows Presentation Foundation (as that is what your tag suggests you want). View Is the most user faced layer. In the simplest form, it can be a single window. The window consists of an .xaml file, which is where you typically define the graphical properties of your application. It is paired with a .cs file as well though. The .cs part of the window (aka view) is not to be confused with the view model though. Often, in MVVM patterns, it contains only very little code, as the ma

Cites watashi16 · 2020-02 · Stack Overflow · on “How do you set up Caliburn Micro guard methods for items not in the view?”

I'm trying to get Caliburn Micro going in my project and I'm having trouble understanding guard methods ( Can* ) in the context of properties that aren't bound to the view (forgive me if I'm getting my terminology wrong). I've adapted Tim Corey's example [this video] to add this snippet: private bool _connected; public bool Connected { get { return _connected; } set { _connected = value; NotifyOfPropertyChange(() => Connected); } } public bool CanSayHello(bool connected) { return connected; } public void SayHello(bool connected) { Console.WriteLine("Hello!"); } public bool CanClearText(string firstName, string lastName) { if (String.IsNullOrWhiteSpace(firstName) && string.IsNullOrWhiteSpace(lastN