Detecting ‘MouseOver’ events in WPF / MVVM

Useful StackOverflow link https://stackoverflow.com/questions/36221118/how-to-make-mouseover-event-in-mvvm Step 1: Create a new WPF project Step 2: Create an example WPF window MainWindow.xaml Step 3: Create the MVVM View Model class MainWindowViewModel.cs Step 4: Add Event handling infrastructure RelayCommand.cs EventRaiser.cs EventArgs.cs Step 5: Add necessary reference to Interactivity Right click the References folder and select Add Reference… Step 6: …

Continue reading ‘Detecting ‘MouseOver’ events in WPF / MVVM’ »

How to get mouse cursor position in WPF MVVM applications using Dependency Properties

Very useful StackOverflow link, Mark Green‘s answer, from which I have borrowed heavily here, with one or two modifications in order to fully work in a Visual Studio 2015 environment. Step 1: Create a new WPF project Step 2: Create an example WPF window MainWindow.xaml We will use this window to showcase how the mouse …

Continue reading ‘How to get mouse cursor position in WPF MVVM applications using Dependency Properties’ »

Setting the visibility of individual GridViewColumn items in WPF

Some instructions for setting the visibility of GridViewColumn items in WPF. Some useful StackOverflow links as follows: https://stackoverflow.com/questions/1392811/c-wpf-make-a-gridviewcolumn-visible-false Helge Klein‘s contribution was particularly useful. Step 1: Create a new WPF application Step 2: Create the ViewModel class Our ViewModel class for inserting items into our ListView plus other required properties… Inherits from INotifyPropertyChanged in order …

Continue reading ‘Setting the visibility of individual GridViewColumn items in WPF’ »

Displaying changing graphics in Java

Some hints on how to display changing graphics in Java using a simple example I have borrowed from the following site: http://www.dreamincode.net/forums/topic/30222-working-with-graphics-in-java/ I use the same approach to draw a number of concentric circles of differing sizes, but with a small delay in between each draw, refreshing the display at each iteration to give the …

Continue reading ‘Displaying changing graphics in Java’ »

Using HierarchicalDataTemplate with TreeView in WPF / MVVM

Some instructions on how to create and display a hierarchical data structure in WPF by using HierarchicalDataTemplate with TreeView Visual Studio 2019 project downloadable from here. Stack Overflow link Step 1: Create a new WPF application Step 2: Create the model class The Model class we use to define our Directory ‘Item’ structure. In this …

Continue reading ‘Using HierarchicalDataTemplate with TreeView in WPF / MVVM’ »